diff options
author | Dave Chinner <dchinner@redhat.com> | 2013-08-12 06:50:10 -0400 |
---|---|---|
committer | Ben Myers <bpm@sgi.com> | 2013-08-22 09:44:49 -0400 |
commit | 1c55cece084aa4c9a3fa34ed4eecbdf18afbf05d (patch) | |
tree | b849301088d3e21e91992ad3ccf0ed0f5f492446 /fs/xfs/xfs_dir2_data.c | |
parent | 0cb97766f2928579f1029ea7b28ae946cdd6fbe1 (diff) |
xfs: Add write support for dirent filetype field
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: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_dir2_data.c')
-rw-r--r-- | fs/xfs/xfs_dir2_data.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/xfs/xfs_dir2_data.c b/fs/xfs/xfs_dir2_data.c index 1b59e43d97d9..47e1326c169a 100644 --- a/fs/xfs/xfs_dir2_data.c +++ b/fs/xfs/xfs_dir2_data.c | |||
@@ -149,6 +149,8 @@ __xfs_dir3_data_check( | |||
149 | XFS_WANT_CORRUPTED_RETURN( | 149 | XFS_WANT_CORRUPTED_RETURN( |
150 | be16_to_cpu(*xfs_dir3_data_entry_tag_p(mp, dep)) == | 150 | be16_to_cpu(*xfs_dir3_data_entry_tag_p(mp, dep)) == |
151 | (char *)dep - (char *)hdr); | 151 | (char *)dep - (char *)hdr); |
152 | XFS_WANT_CORRUPTED_RETURN( | ||
153 | xfs_dir3_dirent_get_ftype(mp, dep) < XFS_DIR3_FT_MAX); | ||
152 | count++; | 154 | count++; |
153 | lastfree = 0; | 155 | lastfree = 0; |
154 | if (hdr->magic == cpu_to_be32(XFS_DIR2_BLOCK_MAGIC) || | 156 | if (hdr->magic == cpu_to_be32(XFS_DIR2_BLOCK_MAGIC) || |