summaryrefslogtreecommitdiff
path: root/fs/xfs/linux-2.6/xfs_iops.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2011-01-14 12:07:30 (GMT)
committerAl Viro <viro@zeniv.linux.org.uk>2011-01-17 07:25:30 (GMT)
commit64c23e86873ee410554d6d1c76b60da47025e96f (patch)
treeb30c5ff8782ebfdec6956d7834f796731fd3a1d4 /fs/xfs/linux-2.6/xfs_iops.c
parenteb745dbccce56f1bbe3f80b95ad2a325145171c2 (diff)
downloadlinux-64c23e86873ee410554d6d1c76b60da47025e96f.tar.xz
make the feature checks in ->fallocate future proof
Instead of various home grown checks that might need updates for new flags just check for any bit outside the mask of the features supported by the filesystem. This makes the check future proof for any newly added flag. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_iops.c')
-rw-r--r--fs/xfs/linux-2.6/xfs_iops.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c
index da54403..a4ecc21 100644
--- a/fs/xfs/linux-2.6/xfs_iops.c
+++ b/fs/xfs/linux-2.6/xfs_iops.c
@@ -518,6 +518,9 @@ xfs_vn_fallocate(
xfs_inode_t *ip = XFS_I(inode);
int cmd = XFS_IOC_RESVSP;
+ if (mode & ~(FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE))
+ return -EOPNOTSUPP;
+
/* preallocation on directories not yet supported */
error = -ENODEV;
if (S_ISDIR(inode->i_mode))