aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/libxfs/xfs_dir2.c
diff options
context:
space:
mode:
authorDave Chinner <david@fromorbit.com>2014-12-04 09:46:17 +1100
committerDave Chinner <david@fromorbit.com>2014-12-04 09:46:17 +1100
commit6044e4386cd51dece882ea42352cdaaab0f24cad (patch)
treecde51132ea9d6afefdf05ad621fc22bbb796d5f4 /fs/xfs/libxfs/xfs_dir2.c
parentMerge branch 'xfs-coccinelle-cleanups' into for-next (diff)
parentxfs: split metadata and log buffer completion to separate workqueues (diff)
downloadlinux-dev-6044e4386cd51dece882ea42352cdaaab0f24cad.tar.xz
linux-dev-6044e4386cd51dece882ea42352cdaaab0f24cad.zip
Merge branch 'xfs-misc-fixes-for-3.19-2' into for-next
Conflicts: fs/xfs/xfs_iops.c
Diffstat (limited to 'fs/xfs/libxfs/xfs_dir2.c')
-rw-r--r--fs/xfs/libxfs/xfs_dir2.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/fs/xfs/libxfs/xfs_dir2.c b/fs/xfs/libxfs/xfs_dir2.c
index d399f174a809..a69fb3a1e161 100644
--- a/fs/xfs/libxfs/xfs_dir2.c
+++ b/fs/xfs/libxfs/xfs_dir2.c
@@ -34,6 +34,22 @@
struct xfs_name xfs_name_dotdot = { (unsigned char *)"..", 2, XFS_DIR3_FT_DIR };
+/*
+ * @mode, if set, indicates that the type field needs to be set up.
+ * This uses the transformation from file mode to DT_* as defined in linux/fs.h
+ * for file type specification. This will be propagated into the directory
+ * structure if appropriate for the given operation and filesystem config.
+ */
+const unsigned char xfs_mode_to_ftype[S_IFMT >> S_SHIFT] = {
+ [0] = XFS_DIR3_FT_UNKNOWN,
+ [S_IFREG >> S_SHIFT] = XFS_DIR3_FT_REG_FILE,
+ [S_IFDIR >> S_SHIFT] = XFS_DIR3_FT_DIR,
+ [S_IFCHR >> S_SHIFT] = XFS_DIR3_FT_CHRDEV,
+ [S_IFBLK >> S_SHIFT] = XFS_DIR3_FT_BLKDEV,
+ [S_IFIFO >> S_SHIFT] = XFS_DIR3_FT_FIFO,
+ [S_IFSOCK >> S_SHIFT] = XFS_DIR3_FT_SOCK,
+ [S_IFLNK >> S_SHIFT] = XFS_DIR3_FT_SYMLINK,
+};
/*
* ASCII case-insensitive (ie. A-Z) support for directories that was