From patchwork Tue Nov 20 09:29:44 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zheng Liu X-Patchwork-Id: 1772041 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id F320A3FCA5 for ; Tue, 20 Nov 2012 09:17:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752987Ab2KTJRZ (ORCPT ); Tue, 20 Nov 2012 04:17:25 -0500 Received: from mail-pb0-f46.google.com ([209.85.160.46]:51686 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752915Ab2KTJRW (ORCPT ); Tue, 20 Nov 2012 04:17:22 -0500 Received: by mail-pb0-f46.google.com with SMTP id wy7so4139518pbc.19 for ; Tue, 20 Nov 2012 01:17:22 -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=sMwPixAcsbk4iWSWMopQCpvzuG8ic/IxUIu2mSl1ZWg=; b=cPY0mH1agTArA47pkn+jU4Q+xjhjDJbW5hBmgwB38gZjaGJ4vr5tQXsGGh+jW37r4f Z7na3mtEfaoc1zOhS7NQfHEiAoHUzwDFHrAvNitBeoZQ/C3iLj042M63LjgHBtiwmPev MzurDByZsoZCydMDNvFN8QcqXmrghe8QyxoCKqpBqrYVKUDd66YzztyxdRmOegbdMyx1 UwahGxSHuH0WFsDmX34BmyyYkVjOVsqBc3CzKFXYrCPRUp/x3x1k9+1hkojZ4BpSAjl9 BCboPF7Do+7A6kskMdZB6P9coM5C4omxr8/wKY82QeLj3WQcFLf70PakkKaCcDo1cJan eTgw== Received: by 10.66.83.201 with SMTP id s9mr6280932pay.74.1353403042189; Tue, 20 Nov 2012 01:17:22 -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.19 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 20 Nov 2012 01:17:21 -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 3/4][RFC] btrfs: remove duplicated check from btrfs_fallocate Date: Tue, 20 Nov 2012 17:29:44 +0800 Message-Id: <1353403785-3489-4-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 btrfs_fallocate because vfs has already checked it. Reported-by: Guo Chao Signed-off-by: Zheng Liu --- 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);