From patchwork Tue Jul 11 21:54:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trond Myklebust X-Patchwork-Id: 9835517 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7482860363 for ; Tue, 11 Jul 2017 21:54:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6766B2856A for ; Tue, 11 Jul 2017 21:54:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5C7DE28572; Tue, 11 Jul 2017 21:54:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 06B922856A for ; Tue, 11 Jul 2017 21:54:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934169AbdGKVyl (ORCPT ); Tue, 11 Jul 2017 17:54:41 -0400 Received: from mail-io0-f196.google.com ([209.85.223.196]:34148 "EHLO mail-io0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933186AbdGKVyk (ORCPT ); Tue, 11 Jul 2017 17:54:40 -0400 Received: by mail-io0-f196.google.com with SMTP id f66so487003iof.1 for ; Tue, 11 Jul 2017 14:54:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=GXqNCTIp7V8Spe3aBzLpQhlg2j6qy3WNA4EtldlIJEY=; b=utMRcpIdgn6iPyZi+A3PAGjt8Y7zq/GHllss7yGSU8ot+cgU1XZcT+NwcVdEmL3f7f 4WmhLTRTO7XJ84RNgNNHUlyrDzmSTC9YLEjUNvtKsSNCn7JRslQr7uN8YV0A3Fu9GHfO 8JbAvsiOKAH/4fOdPd9anBND1XXYholh0fdgvTa8SKcUB09xc6wHccJ6zejxeoQ3jixI WZdsIbeTAjgg36OJi/1TQgprM0IKbIGx7X4OWaAZRJVt4gNgvFI5eP89Nzdm3yUXTgH7 OvmyeAocekfAWeX1dnNiSfVZd2Q0oZ+5A3B/dlAYwLCFhLqQon05YWedgwMgwOoSgUzI uKjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=GXqNCTIp7V8Spe3aBzLpQhlg2j6qy3WNA4EtldlIJEY=; b=t8/ah+jl+ylGzg3lV2gmQDRTn/B0uBSPm+kXzJpmzuxag2IC8lNBbkF5fkB7ox5Bfv djD8a+NS9IveqhmvTZGJh0dxnSte1pH6Oh5MA2FVqOu575h9f6uj41rhc+5Qbn51NWZq Fsse5e4/TDvYtyseWEFn6K+dcwK9op8xWdNSJ4AtIyoAYcvVucSDVob9lbw3I/PfN/yf yf+1XEL/y+YD8CuwC4+yQ4txyjwrM6jJOJUgOiHeAB4X0Lo6iwVlAiivfHypjbWoGUp2 UkpT/o+b52MbNJBfsBuJ+FHW9sBh+hT2bs/zjiUJ3PVSVKsDjwxtluvj7RDvbeyZLC+Z W3Tg== X-Gm-Message-State: AIVw111vHHNIsY6kn2N9/2UlB3ADcydtBy+THxhErYSburib1JjZ361i 5wPDVaN+30Gz7g== X-Received: by 10.107.181.22 with SMTP id e22mr2306416iof.85.1499810079532; Tue, 11 Jul 2017 14:54:39 -0700 (PDT) Received: from leira.trondhjem.org (c-68-49-162-121.hsd1.mi.comcast.net. [68.49.162.121]) by smtp.gmail.com with ESMTPSA id d188sm570285ioe.52.2017.07.11.14.54.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Jul 2017 14:54:39 -0700 (PDT) From: Trond Myklebust To: anna.schumaker@netapp.com Cc: linux-nfs@vger.kernel.org Subject: [PATCH 2/4] NFSv3: Convert nfs3_proc_access() to use nfs_access_set_mask() Date: Tue, 11 Jul 2017 17:54:33 -0400 Message-Id: <20170711215435.18736-2-trond.myklebust@primarydata.com> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170711215435.18736-1-trond.myklebust@primarydata.com> References: <20170711215435.18736-1-trond.myklebust@primarydata.com> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Trond Myklebust --- fs/nfs/nfs3proc.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c index 0c07b567118d..dd43f1cf0485 100644 --- a/fs/nfs/nfs3proc.c +++ b/fs/nfs/nfs3proc.c @@ -220,15 +220,8 @@ static int nfs3_proc_access(struct inode *inode, struct nfs_access_entry *entry) status = rpc_call_sync(NFS_CLIENT(inode), &msg, 0); nfs_refresh_inode(inode, res.fattr); - if (status == 0) { - entry->mask = 0; - if (res.access & NFS3_ACCESS_READ) - entry->mask |= MAY_READ; - if (res.access & (NFS3_ACCESS_MODIFY | NFS3_ACCESS_EXTEND | NFS3_ACCESS_DELETE)) - entry->mask |= MAY_WRITE; - if (res.access & (NFS3_ACCESS_LOOKUP|NFS3_ACCESS_EXECUTE)) - entry->mask |= MAY_EXEC; - } + if (status == 0) + nfs_access_set_mask(entry, res.access); nfs_free_fattr(res.fattr); out: dprintk("NFS reply access: %d\n", status);