xfs
[Top] [All Lists]

[PATCH 1/4][RFC] ext4: remove duplicated check from ext4_fallocate

To: linux-fsdevel@xxxxxxxxxxxxxxx, linux-ext4@xxxxxxxxxxxxxxx, xfs@xxxxxxxxxxx, linux-btrfs@xxxxxxxxxxxxxxx, ocfs2-devel@xxxxxxxxxxxxxx
Subject: [PATCH 1/4][RFC] ext4: remove duplicated check from ext4_fallocate
From: Zheng Liu <gnehzuil.liu@xxxxxxxxx>
Date: Tue, 20 Nov 2012 17:29:42 +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=Klj1BzmVfcz/1Qj/f+ZzXBZhl0I5r7IWV8igPTBMm5g=; b=L5ddDLFUnxxtadg/xTcGrtwYRZfit1qkDCRpqF/JCja84d0bKNM5wYv/7F5J4EzmeE 1uh5YmZ5AsHZhWkjGl99147DmhXa0ZoMkiMTsGhN4aXeGKnQ0Oen58J8LQty8mDj750i I4QErjN4IqbSg6CBGzLGXYMSSdh0FZFqqd/Tm8iAJ+s4F1AqCq2lOapY2e2GRyyqavNs RLO39rzqKqAa1O8EM0I5pu7rqiZNTJI8KnlZ2YPcttV60I8KnKtgAW9E/gOAvARQwu0M QENZxApEQSVJkPm6GJZX8jNCIyBA2rzK9pE/liBcqXcOB61C7IfgvdbeauELmywoqAzi 1qYA==
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 ext4_fallocate because vfs has already checked it.

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

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 7011ac9..c2eb409 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -4427,10 +4427,6 @@ long ext4_fallocate(struct file *file, int mode, loff_t 
offset, loff_t len)
        if (!(ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS)))
                return -EOPNOTSUPP;
 
-       /* Return error if mode is not supported */
-       if (mode & ~(FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE))
-               return -EOPNOTSUPP;
-
        if (mode & FALLOC_FL_PUNCH_HOLE)
                return ext4_punch_hole(file, offset, len);
 
-- 
1.7.12.rc2.18.g61b472e

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