diff options
author | Amir Goldstein <amir73il@gmail.com> | 2017-02-02 07:56:01 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-02-04 08:47:12 (GMT) |
commit | b5f68e24cc7bc3492ebc5c70f3ef6babcbd4188b (patch) | |
tree | 1d649f96a2455dd0597fb3886cead8d7d74a3a4d /fs/xfs/xfs_iops.c | |
parent | 4fac84ba1da7aa62dea520dcedd4f6de117d8f2b (diff) | |
download | linux-b5f68e24cc7bc3492ebc5c70f3ef6babcbd4188b.tar.xz |
xfs: replace xfs_mode_to_ftype table with switch statement
commit 1fc4d33fed124fb182e8e6c214e973a29389ae83.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/xfs/xfs_iops.c')
-rw-r--r-- | fs/xfs/xfs_iops.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c index 405a65c..1abe719 100644 --- a/fs/xfs/xfs_iops.c +++ b/fs/xfs/xfs_iops.c @@ -103,7 +103,7 @@ xfs_dentry_to_name( { namep->name = dentry->d_name.name; namep->len = dentry->d_name.len; - namep->type = xfs_mode_to_ftype[(mode & S_IFMT) >> S_SHIFT]; + namep->type = xfs_mode_to_ftype(mode); } STATIC void |