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>
This commit is contained in:
@ -362,37 +362,6 @@ xfs_dir_removename(
|
||||
return rval;
|
||||
}
|
||||
|
||||
/*
|
||||
* Read a directory.
|
||||
*/
|
||||
int
|
||||
xfs_readdir(
|
||||
xfs_inode_t *dp,
|
||||
struct dir_context *ctx,
|
||||
size_t bufsize)
|
||||
{
|
||||
int rval; /* return value */
|
||||
int v; /* type-checking value */
|
||||
|
||||
trace_xfs_readdir(dp);
|
||||
|
||||
if (XFS_FORCED_SHUTDOWN(dp->i_mount))
|
||||
return XFS_ERROR(EIO);
|
||||
|
||||
ASSERT(S_ISDIR(dp->i_d.di_mode));
|
||||
XFS_STATS_INC(xs_dir_getdents);
|
||||
|
||||
if (dp->i_d.di_format == XFS_DINODE_FMT_LOCAL)
|
||||
rval = xfs_dir2_sf_getdents(dp, ctx);
|
||||
else if ((rval = xfs_dir2_isblock(NULL, dp, &v)))
|
||||
;
|
||||
else if (v)
|
||||
rval = xfs_dir2_block_getdents(dp, ctx);
|
||||
else
|
||||
rval = xfs_dir2_leaf_getdents(dp, ctx, bufsize);
|
||||
return rval;
|
||||
}
|
||||
|
||||
/*
|
||||
* Replace the inode number of a directory entry.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user