From patchwork Mon Sep 28 13:39:00 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yaowei Bai X-Patchwork-Id: 7277701 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5D1D89F39B for ; Mon, 28 Sep 2015 13:41:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9ABD520760 for ; Mon, 28 Sep 2015 13:41:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CC90D2075A for ; Mon, 28 Sep 2015 13:41:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933653AbbI1Nlk (ORCPT ); Mon, 28 Sep 2015 09:41:40 -0400 Received: from m12-11.163.com ([220.181.12.11]:47221 "EHLO m12-11.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754663AbbI1Nlj (ORCPT ); Mon, 28 Sep 2015 09:41:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=/h9WU6dtBVwMPnt68P Dd1TC+SoYs1Prqv+TwL+uSEz0=; b=ZrXQ6iA7Uz/20L/3MbqBcvmqWwKfwJCaGl fbtdw5OtwDl1IN5tqNmArEjtBGxnbLoN5VGlwgjsLBjwHCaPLJcFUTLKPfQihz00 9CgIVDvKH5fBovznLNB3En/ri6U87cULsfbVYEu3oRiiCtbmY+4HQ9/0mSmURZ4S Ut+qjnJjc= Received: from localhost.localdomain (unknown [58.209.166.48]) by smtp7 (Coremail) with SMTP id C8CowECJTVVrQwlWz8__Cw--.396S3; Mon, 28 Sep 2015 21:41:01 +0800 (CST) From: Yaowei Bai To: viro@zeniv.linux.org.uk, clm@fb.com, jbacik@fb.com, dsterba@suse.com Cc: linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 04/17] fs/btrfs: remove unnecessary new_valid_dev check Date: Mon, 28 Sep 2015 21:39:00 +0800 Message-Id: <1443447540-5098-1-git-send-email-bywxiaobai@163.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1443446807-4838-1-git-send-email-bywxiaobai@163.com> References: <1443446807-4838-1-git-send-email-bywxiaobai@163.com> X-CM-TRANSID: C8CowECJTVVrQwlWz8__Cw--.396S3 X-Coremail-Antispam: 1Uf129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7v73 VFW2AGmfu7bjvjm3AaLaJ3UbIYCTnIWIevJa73UjIFyTuYvjxU33C7DUUUU X-Originating-IP: [58.209.166.48] X-CM-SenderInfo: xe1z5x5dretxi6rwjhhfrp/xtbBFA+DT1D+Zc+nIwAAsX Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP As new_valid_dev always returns 1, so !new_valid_dev check is not needed, remove it. Signed-off-by: Yaowei Bai Acked-by: David Sterba --- fs/btrfs/inode.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 611b66d..0946790 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -6268,9 +6268,6 @@ static int btrfs_mknod(struct inode *dir, struct dentry *dentry, u64 objectid; u64 index = 0; - if (!new_valid_dev(rdev)) - return -EINVAL; - /* * 2 for inode item and ref * 2 for dir items