From patchwork Mon May 19 06:26:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ZhangZhen X-Patchwork-Id: 4199681 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D71B6BEEAB for ; Mon, 19 May 2014 06:27:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1CBA22025A for ; Mon, 19 May 2014 06:27:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2B7562018E for ; Mon, 19 May 2014 06:27:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752834AbaESG1X (ORCPT ); Mon, 19 May 2014 02:27:23 -0400 Received: from [119.145.14.64] ([119.145.14.64]:6080 "EHLO szxga01-in.huawei.com" rhost-flags-FAIL-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1752732AbaESG1U (ORCPT ); Mon, 19 May 2014 02:27:20 -0400 Received: from 172.24.2.119 (EHLO szxeml209-edg.china.huawei.com) ([172.24.2.119]) by szxrg01-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id BVR12539; Mon, 19 May 2014 14:26:35 +0800 (CST) Received: from SZXEML410-HUB.china.huawei.com (10.82.67.137) by szxeml209-edg.china.huawei.com (172.24.2.184) with Microsoft SMTP Server (TLS) id 14.3.158.1; Mon, 19 May 2014 14:26:32 +0800 Received: from [127.0.0.1] (10.111.69.77) by szxeml410-hub.china.huawei.com (10.82.67.137) with Microsoft SMTP Server id 14.3.158.1; Mon, 19 May 2014 14:26:27 +0800 Message-ID: <5379A412.3050806@huawei.com> Date: Mon, 19 May 2014 14:26:26 +0800 From: Zhang Zhen User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: , CC: linux-btrfs Subject: [PATCH] btrfs: remove a FIXME in btrfs_get_acl() References: <1400480536-18691-1-git-send-email-zhenzhang.zhang@huawei.com> In-Reply-To: <1400480536-18691-1-git-send-email-zhenzhang.zhang@huawei.com> X-Forwarded-Message-Id: <1400480536-18691-1-git-send-email-zhenzhang.zhang@huawei.com> X-Originating-IP: [10.111.69.77] X-CFilter-Loop: Reflected Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 There is no function returns a value of -ENOENT, so the check is useless. Remove it, and the redundant braces. Signed-off-by: Zhang Zhen --- fs/btrfs/acl.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/fs/btrfs/acl.c b/fs/btrfs/acl.c index ff9b399..cae7480 100644 --- a/fs/btrfs/acl.c +++ b/fs/btrfs/acl.c @@ -53,14 +53,12 @@ struct posix_acl *btrfs_get_acl(struct inode *inode, int type) return ERR_PTR(-ENOMEM); size = __btrfs_getxattr(inode, name, value, size); } - if (size > 0) { + if (size > 0) acl = posix_acl_from_xattr(&init_user_ns, value, size); - } else if (size == -ENOENT || size == -ENODATA || size == 0) { - /* FIXME, who returns -ENOENT? I think nobody */ + else if (size == -ENODATA || size == 0) acl = NULL; - } else { + else acl = ERR_PTR(-EIO); - } kfree(value); if (!IS_ERR(acl))