diff options
author | Amir Goldstein <amir73il@gmail.com> | 2017-01-17 11:41:43 -0800 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2017-01-17 11:41:43 -0800 |
commit | 1fc4d33fed124fb182e8e6c214e973a29389ae83 (patch) | |
tree | d9b1fe50fada342ee0d7e1eee47c8d79f1741a50 /fs/xfs/libxfs/xfs_dir2.h | |
parent | b597dd5373a1ccc08218665dc8417433b1c09550 (diff) |
xfs: replace xfs_mode_to_ftype table with switch statement
The size of the xfs_mode_to_ftype[] conversion table
was too small to handle an invalid value of mode=S_IFMT.
Instead of fixing the table size, replace the conversion table
with a conversion helper that uses a switch statement.
Suggested-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/xfs/libxfs/xfs_dir2.h')
-rw-r--r-- | fs/xfs/libxfs/xfs_dir2.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/xfs/libxfs/xfs_dir2.h b/fs/xfs/libxfs/xfs_dir2.h index 72df0dc1bd2a..d4b77ab37a98 100644 --- a/fs/xfs/libxfs/xfs_dir2.h +++ b/fs/xfs/libxfs/xfs_dir2.h @@ -35,10 +35,9 @@ struct xfs_dir2_data_unused; extern struct xfs_name xfs_name_dotdot; /* - * directory filetype conversion tables. + * Convert inode mode to directory entry filetype */ -#define S_SHIFT 12 -extern const unsigned char xfs_mode_to_ftype[]; +extern const unsigned char xfs_mode_to_ftype(int mode); /* * directory operations vector for encode/decode routines |