aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_dir2.c
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2013-08-12 06:49:36 -0400
committerBen Myers <bpm@sgi.com>2013-08-12 17:39:56 -0400
commit4a8af273de63d9656559ba5289e91f40aae0441f (patch)
treeac3d22e894df58c38326bada04073d283c90dee5 /fs/xfs/xfs_dir2.c
parent1fd7115eda5661e872463694fc4a12821c4f914a (diff)
xfs: move getdents code into it's own file
The directory readdir code is not used by userspace, but it is intermingled with files that are shared with userspace. This makes it difficult to compare the differences between the userspac eand kernel files are the userspace files don't have the getdents code in them. Move all the kernel getdents code to a separate file to bring the shared content between userspace and kernel files closer together. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Mark Tinguely <tinguely@sgi.com> Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_dir2.c')
-rw-r--r--fs/xfs/xfs_dir2.c31
1 files changed, 0 insertions, 31 deletions
diff --git a/fs/xfs/xfs_dir2.c b/fs/xfs/xfs_dir2.c
index 8f023dee404d..431be441347f 100644
--- a/fs/xfs/xfs_dir2.c
+++ b/fs/xfs/xfs_dir2.c
@@ -363,37 +363,6 @@ xfs_dir_removename(
363} 363}
364 364
365/* 365/*
366 * Read a directory.
367 */
368int
369xfs_readdir(
370 xfs_inode_t *dp,
371 struct dir_context *ctx,
372 size_t bufsize)
373{
374 int rval; /* return value */
375 int v; /* type-checking value */
376
377 trace_xfs_readdir(dp);
378
379 if (XFS_FORCED_SHUTDOWN(dp->i_mount))
380 return XFS_ERROR(EIO);
381
382 ASSERT(S_ISDIR(dp->i_d.di_mode));
383 XFS_STATS_INC(xs_dir_getdents);
384
385 if (dp->i_d.di_format == XFS_DINODE_FMT_LOCAL)
386 rval = xfs_dir2_sf_getdents(dp, ctx);
387 else if ((rval = xfs_dir2_isblock(NULL, dp, &v)))
388 ;
389 else if (v)
390 rval = xfs_dir2_block_getdents(dp, ctx);
391 else
392 rval = xfs_dir2_leaf_getdents(dp, ctx, bufsize);
393 return rval;
394}
395
396/*
397 * Replace the inode number of a directory entry. 366 * Replace the inode number of a directory entry.
398 */ 367 */
399int 368int