You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
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>
This commit is contained in:
committed by
Darrick J. Wong
parent
b597dd5373
commit
1fc4d33fed
+1
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user