Patchwork [3/4,RFC] btrfs: remove duplicated check from btrfs_fallocate

login
register
mail settings
Submitter Zheng Liu
Date Nov. 20, 2012, 9:29 a.m.
Message ID <1353403785-3489-4-git-send-email-wenqing.lz@taobao.com>
Download mbox | patch
Permalink /patch/200267/
State Not Applicable
Headers show

Comments

Zheng Liu - Nov. 20, 2012, 9:29 a.m.
From: Zheng Liu <wenqing.lz@taobao.com>

Remove a sanity check from btrfs_fallocate because vfs has already checked it.

Reported-by: Guo Chao <yan@linux.vnet.ibm.com>
Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
---
 fs/btrfs/file.c | 4 ----
 1 file changed, 4 deletions(-)

Patch

diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index 9ab1bed..fd260a0 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -1999,10 +1999,6 @@  static long btrfs_fallocate(struct file *file, int mode,
 	alloc_start = offset & ~mask;
 	alloc_end =  (offset + len + mask) & ~mask;
 
-	/* Make sure we aren't being give some crap mode */
-	if (mode & ~(FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE))
-		return -EOPNOTSUPP;
-
 	if (mode & FALLOC_FL_PUNCH_HOLE)
 		return btrfs_punch_hole(inode, offset, len);