diff options
Diffstat (limited to 'fs/xfs/libxfs/xfs_dir2.c')
-rw-r--r-- | fs/xfs/libxfs/xfs_dir2.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/fs/xfs/libxfs/xfs_dir2.c b/fs/xfs/libxfs/xfs_dir2.c index 7075aaf131f4..a69fb3a1e161 100644 --- a/fs/xfs/libxfs/xfs_dir2.c +++ b/fs/xfs/libxfs/xfs_dir2.c | |||
@@ -20,9 +20,6 @@ | |||
20 | #include "xfs_format.h" | 20 | #include "xfs_format.h" |
21 | #include "xfs_log_format.h" | 21 | #include "xfs_log_format.h" |
22 | #include "xfs_trans_resv.h" | 22 | #include "xfs_trans_resv.h" |
23 | #include "xfs_inum.h" | ||
24 | #include "xfs_sb.h" | ||
25 | #include "xfs_ag.h" | ||
26 | #include "xfs_mount.h" | 23 | #include "xfs_mount.h" |
27 | #include "xfs_da_format.h" | 24 | #include "xfs_da_format.h" |
28 | #include "xfs_da_btree.h" | 25 | #include "xfs_da_btree.h" |
@@ -34,10 +31,25 @@ | |||
34 | #include "xfs_dir2_priv.h" | 31 | #include "xfs_dir2_priv.h" |
35 | #include "xfs_error.h" | 32 | #include "xfs_error.h" |
36 | #include "xfs_trace.h" | 33 | #include "xfs_trace.h" |
37 | #include "xfs_dinode.h" | ||
38 | 34 | ||
39 | struct xfs_name xfs_name_dotdot = { (unsigned char *)"..", 2, XFS_DIR3_FT_DIR }; | 35 | struct xfs_name xfs_name_dotdot = { (unsigned char *)"..", 2, XFS_DIR3_FT_DIR }; |
40 | 36 | ||
37 | /* | ||
38 | * @mode, if set, indicates that the type field needs to be set up. | ||
39 | * This uses the transformation from file mode to DT_* as defined in linux/fs.h | ||
40 | * for file type specification. This will be propagated into the directory | ||
41 | * structure if appropriate for the given operation and filesystem config. | ||
42 | */ | ||
43 | const unsigned char xfs_mode_to_ftype[S_IFMT >> S_SHIFT] = { | ||
44 | [0] = XFS_DIR3_FT_UNKNOWN, | ||
45 | [S_IFREG >> S_SHIFT] = XFS_DIR3_FT_REG_FILE, | ||
46 | [S_IFDIR >> S_SHIFT] = XFS_DIR3_FT_DIR, | ||
47 | [S_IFCHR >> S_SHIFT] = XFS_DIR3_FT_CHRDEV, | ||
48 | [S_IFBLK >> S_SHIFT] = XFS_DIR3_FT_BLKDEV, | ||
49 | [S_IFIFO >> S_SHIFT] = XFS_DIR3_FT_FIFO, | ||
50 | [S_IFSOCK >> S_SHIFT] = XFS_DIR3_FT_SOCK, | ||
51 | [S_IFLNK >> S_SHIFT] = XFS_DIR3_FT_SYMLINK, | ||
52 | }; | ||
41 | 53 | ||
42 | /* | 54 | /* |
43 | * ASCII case-insensitive (ie. A-Z) support for directories that was | 55 | * ASCII case-insensitive (ie. A-Z) support for directories that was |