xfs
[Top] [All Lists]

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

To: linux-fsdevel@xxxxxxxxxxxxxxx, linux-ext4@xxxxxxxxxxxxxxx, xfs@xxxxxxxxxxx, linux-btrfs@xxxxxxxxxxxxxxx, ocfs2-devel@xxxxxxxxxxxxxx
Subject: [PATCH 3/4][RFC] btrfs: remove duplicated check from btrfs_fallocate
From: Zheng Liu <gnehzuil.liu@xxxxxxxxx>
Date: Tue, 20 Nov 2012 17:29:44 +0800
Cc: yan@xxxxxxxxxxxxxxxxxx, Zheng Liu <wenqing.lz@xxxxxxxxxx>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=sMwPixAcsbk4iWSWMopQCpvzuG8ic/IxUIu2mSl1ZWg=; b=cPY0mH1agTArA47pkn+jU4Q+xjhjDJbW5hBmgwB38gZjaGJ4vr5tQXsGGh+jW37r4f Z7na3mtEfaoc1zOhS7NQfHEiAoHUzwDFHrAvNitBeoZQ/C3iLj042M63LjgHBtiwmPev MzurDByZsoZCydMDNvFN8QcqXmrghe8QyxoCKqpBqrYVKUDd66YzztyxdRmOegbdMyx1 UwahGxSHuH0WFsDmX34BmyyYkVjOVsqBc3CzKFXYrCPRUp/x3x1k9+1hkojZ4BpSAjl9 BCboPF7Do+7A6kskMdZB6P9coM5C4omxr8/wKY82QeLj3WQcFLf70PakkKaCcDo1cJan eTgw==
In-reply-to: <1353403785-3489-1-git-send-email-wenqing.lz@xxxxxxxxxx>
References: <1353403785-3489-1-git-send-email-wenqing.lz@xxxxxxxxxx>
From: Zheng Liu <wenqing.lz@xxxxxxxxxx>

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

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

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);
 
-- 
1.7.12.rc2.18.g61b472e

<Prev in Thread] Current Thread [Next in Thread>