• Dave Chinner's avatar
    xfs: Add write support for dirent filetype field · 1c55cece
    Dave Chinner authored
    Add support to propagate and add filetype values into the on-disk
    directs. This involves passing the filetype into the xfs_da_args
    structure along with the name and namelength for direct operations,
    and encoding it into the dirent at the same time we write the inode
    number into the dirent.
    
    With write support, add the feature flag to the
    XFS_SB_FEAT_INCOMPAT_ALL mask so we can now mount filesystems with
    this feature set.
    
    Performance of directory recursion is now much improved. Parallel
    walk of ~50 million directory entries across hundreds of directories
    improves significantly. Unpatched, no CRCs:
    
    Walking via ls -R
    
    real    3m19.886s
    user    6m36.960s
    sys     28m19.087s
    
    THis is doing roughly 500 getdents() calls per second, and 250,000
    inode lookups per second to determine the inode type at roughly
    17,000 read IOPS. CPU usage is 90% kernel space.
    
    With dtype support patched in and the fileset recreated with CRCs
    enabled:
    
    Walking via ls -R
    
    real    0m31.316s
    user    6m32.975s
    sys     0m21.111s
    
    This is doing roughly 3500 getdents() calls per second at 16,000
    IOPS. There are no inode lookups at all. CPU usages is almost 100%
    userspace.
    
    This is a big win for recursive directory walks that only need to
    find file names and file types.
    Signed-off-by: default avatarDave Chinner <dchinner@redhat.com>
    Reviewed-by: default avatarMark Tinguely <tinguely@sgi.com>
    Signed-off-by: default avatarBen Myers <bpm@sgi.com>
    1c55cece
xfs_dir2_leaf.c 51.2 KB