aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_dir2_readdir.c
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2014-12-03 17:43:17 -0500
committerDave Chinner <david@fromorbit.com>2014-12-03 17:43:17 -0500
commit1b767ee386c5f58660ca9be70d3076f2b6484e72 (patch)
treeca368107e810c67a75214966cb1399af52ceb727 /fs/xfs/xfs_dir2_readdir.c
parent2d3d0c53df99587e1d58759f805c3aae79fac453 (diff)
xfs: move ftype conversion functions to libxfs
These functions are needed in userspace for repair and mkfs to do the right thing. Move them to libxfs so they can be easily shared. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/xfs/xfs_dir2_readdir.c')
-rw-r--r--fs/xfs/xfs_dir2_readdir.c18
1 files changed, 1 insertions, 17 deletions
diff --git a/fs/xfs/xfs_dir2_readdir.c b/fs/xfs/xfs_dir2_readdir.c
index f1b69edcdf31..d4b301a85288 100644
--- a/fs/xfs/xfs_dir2_readdir.c
+++ b/fs/xfs/xfs_dir2_readdir.c
@@ -44,7 +44,7 @@ static unsigned char xfs_dir3_filetype_table[] = {
44 DT_FIFO, DT_SOCK, DT_LNK, DT_WHT, 44 DT_FIFO, DT_SOCK, DT_LNK, DT_WHT,
45}; 45};
46 46
47unsigned char 47static unsigned char
48xfs_dir3_get_dtype( 48xfs_dir3_get_dtype(
49 struct xfs_mount *mp, 49 struct xfs_mount *mp,
50 __uint8_t filetype) 50 __uint8_t filetype)
@@ -57,22 +57,6 @@ xfs_dir3_get_dtype(
57 57
58 return xfs_dir3_filetype_table[filetype]; 58 return xfs_dir3_filetype_table[filetype];
59} 59}
60/*
61 * @mode, if set, indicates that the type field needs to be set up.
62 * This uses the transformation from file mode to DT_* as defined in linux/fs.h
63 * for file type specification. This will be propagated into the directory
64 * structure if appropriate for the given operation and filesystem config.
65 */
66const unsigned char xfs_mode_to_ftype[S_IFMT >> S_SHIFT] = {
67 [0] = XFS_DIR3_FT_UNKNOWN,
68 [S_IFREG >> S_SHIFT] = XFS_DIR3_FT_REG_FILE,
69 [S_IFDIR >> S_SHIFT] = XFS_DIR3_FT_DIR,
70 [S_IFCHR >> S_SHIFT] = XFS_DIR3_FT_CHRDEV,
71 [S_IFBLK >> S_SHIFT] = XFS_DIR3_FT_BLKDEV,
72 [S_IFIFO >> S_SHIFT] = XFS_DIR3_FT_FIFO,
73 [S_IFSOCK >> S_SHIFT] = XFS_DIR3_FT_SOCK,
74 [S_IFLNK >> S_SHIFT] = XFS_DIR3_FT_SYMLINK,
75};
76 60
77STATIC int 61STATIC int
78xfs_dir2_sf_getdents( 62xfs_dir2_sf_getdents(