From patchwork Tue Nov 20 09:29:42 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zheng Liu X-Patchwork-Id: 1772021 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 68457DF2AB for ; Tue, 20 Nov 2012 09:17:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752888Ab2KTJRT (ORCPT ); Tue, 20 Nov 2012 04:17:19 -0500 Received: from mail-pa0-f46.google.com ([209.85.220.46]:40222 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752773Ab2KTJRQ (ORCPT ); Tue, 20 Nov 2012 04:17:16 -0500 Received: by mail-pa0-f46.google.com with SMTP id bh2so1120565pad.19 for ; Tue, 20 Nov 2012 01:17:16 -0800 (PST) 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== Received: by 10.66.72.100 with SMTP id c4mr5858345pav.64.1353403036530; Tue, 20 Nov 2012 01:17:16 -0800 (PST) Received: from lz-desktop.taobao.ali.com ([182.92.247.2]) by mx.google.com with ESMTPS id t1sm7770405paw.11.2012.11.20.01.17.13 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 20 Nov 2012 01:17:16 -0800 (PST) From: Zheng Liu To: linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, xfs@oss.sgi.com, linux-btrfs@vger.kernel.org, ocfs2-devel@oss.oracle.com Cc: yan@linux.vnet.ibm.com, Zheng Liu Subject: [PATCH 1/4][RFC] ext4: remove duplicated check from ext4_fallocate Date: Tue, 20 Nov 2012 17:29:42 +0800 Message-Id: <1353403785-3489-2-git-send-email-wenqing.lz@taobao.com> X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e In-Reply-To: <1353403785-3489-1-git-send-email-wenqing.lz@taobao.com> References: <1353403785-3489-1-git-send-email-wenqing.lz@taobao.com> Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org From: Zheng Liu Remove a sanity check from ext4_fallocate because vfs has already checked it. Reported-by: Guo Chao Signed-off-by: Zheng Liu --- 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);