From patchwork Tue May 15 17:03:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anna Schumaker X-Patchwork-Id: 10401665 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 40749601F9 for ; Tue, 15 May 2018 17:03:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3315127F94 for ; Tue, 15 May 2018 17:03:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 27E8227FB0; Tue, 15 May 2018 17:03:48 +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=-7.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, 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 80A0227F94 for ; Tue, 15 May 2018 17:03:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754315AbeEORDo (ORCPT ); Tue, 15 May 2018 13:03:44 -0400 Received: from mail-it0-f66.google.com ([209.85.214.66]:37010 "EHLO mail-it0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754300AbeEORDm (ORCPT ); Tue, 15 May 2018 13:03:42 -0400 Received: by mail-it0-f66.google.com with SMTP id 70-v6so3482204ity.2 for ; Tue, 15 May 2018 10:03:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id; bh=bxv5nkziAj4kypUSOCLOxRncA5+IocjKdoELS95nofA=; b=flj5IwEx2bBq/A+Dm1v0kpSQRRrVzUFnQCBK6se2fpmEdr+MpkeXmyWmzbp+TspYUw FITHgHliaUtzV5xULLr8AQrjAzIc5uSfQW4KHM/0+BkI5o1Srk4rOBA4HKlwRdDXA6Y8 NA8xc+RpvR66Aw/L/gMkbJRm1DTT/RZfevsAEStnWl0SAjn6vbBoqg+nUSRMMUwGGotc uWjMAVNpMh+6cuTHriSyfkzuJ5RJ79VhS9EUxmiMkQGnVxqqjOtieytbMHHaL/ODCt2s wgwOKnimvipHuNbM0/mNzp3koqocpauvKxo5R7i/aeh4IVwRT/q5D9R9trTCnZsGX6E/ B29Q== 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:subject:date:message-id; bh=bxv5nkziAj4kypUSOCLOxRncA5+IocjKdoELS95nofA=; b=Xmtge1lu9U/GlIC/ZdlBr0oRZRNB4dsoUZUM6yShQJ63/35JYcX+x25JJjz2aVh3h8 Yziew3uFDD32CKqdjRu69pZyzyo7X86ut0a6ZCBrMBUYafp25CpoiS2Qa5XAu0/oLetB nvFk+e9EmDkLnyQUntkMZIxSdshxthNG4bjck/7PwniXnjbt7SW4hX9FhBjyGpiM9Up4 jVw3h7KNVKQG1poybZLU7Wlp/aKkdRnnKyS4xHSWWj81TjtekNNmtu7ZNLGsmVJ4miPo pzndbWbzvhayUIZ7GlvU0+3B4FdKxOACUoCfJdEYbXDjujx1ytOhJTaqJGv60PWb8fSc oPRQ== X-Gm-Message-State: ALKqPwdmKAuSRgUzN9gsUmTCERgKnebioC1DBJiCLWj5Opaim7Lze2rL Ck3yr5bD91SJOD8kyhnpQoiGhaKa X-Google-Smtp-Source: AB8JxZpyCYli/ku4s3+CfJ7fX2FCKUShdBg+0nW56lb0GfAp2pL2xsYJp13g7bLIYGnfZ9B1fK5/tw== X-Received: by 2002:a24:f00c:: with SMTP id s12-v6mr14577570ith.129.1526403821528; Tue, 15 May 2018 10:03:41 -0700 (PDT) Received: from gouda.nowheycreamery.com.nowheycreamery.com (99-9-112-69.lightspeed.livnmi.sbcglobal.net. [99.9.112.69]) by smtp.gmail.com with ESMTPSA id e1-v6sm396952ita.23.2018.05.15.10.03.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 May 2018 10:03:40 -0700 (PDT) From: schumaker.anna@gmail.com X-Google-Original-From: Anna.Schumaker@Netapp.com To: Trond.Myklebust@hammerspace.com, linux-nfs@vger.kernel.org Subject: [PATCH] NFS: Merge nfs41_free_stateid() with _nfs41_free_stateid() Date: Tue, 15 May 2018 13:03:39 -0400 Message-Id: <20180515170339.12971-1-Anna.Schumaker@Netapp.com> X-Mailer: git-send-email 2.17.0 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 From: Anna Schumaker Having these exist as two functions doesn't seem to add anything useful, and I think merging them together makes this easier to follow. Signed-off-by: Anna Schumaker --- fs/nfs/nfs4proc.c | 37 ++++++++++++++----------------------- 1 file changed, 14 insertions(+), 23 deletions(-) diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 9cf678477a37..33e24c971d1a 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -9299,7 +9299,17 @@ static const struct rpc_call_ops nfs41_free_stateid_ops = { .rpc_release = nfs41_free_stateid_release, }; -static struct rpc_task *_nfs41_free_stateid(struct nfs_server *server, +/** + * nfs41_free_stateid - perform a FREE_STATEID operation + * + * @server: server / transport on which to perform the operation + * @stateid: state ID to release + * @cred: credential + * @is_recovery: set to true if this call needs to be privileged + * + * Note: this function is always asynchronous. + */ +static int nfs41_free_stateid(struct nfs_server *server, const nfs4_stateid *stateid, struct rpc_cred *cred, bool privileged) @@ -9315,6 +9325,7 @@ static struct rpc_task *_nfs41_free_stateid(struct nfs_server *server, .flags = RPC_TASK_ASYNC, }; struct nfs_free_stateid_data *data; + struct rpc_task *task; nfs4_state_protect(server->nfs_client, NFS_SP4_MACH_CRED_STATEID, &task_setup.rpc_client, &msg); @@ -9322,7 +9333,7 @@ static struct rpc_task *_nfs41_free_stateid(struct nfs_server *server, dprintk("NFS call free_stateid %p\n", stateid); data = kmalloc(sizeof(*data), GFP_NOFS); if (!data) - return ERR_PTR(-ENOMEM); + return -ENOMEM; data->server = server; nfs4_stateid_copy(&data->args.stateid, stateid); @@ -9331,27 +9342,7 @@ static struct rpc_task *_nfs41_free_stateid(struct nfs_server *server, msg.rpc_argp = &data->args; msg.rpc_resp = &data->res; nfs4_init_sequence(&data->args.seq_args, &data->res.seq_res, 1, privileged); - return rpc_run_task(&task_setup); -} - -/** - * nfs41_free_stateid - perform a FREE_STATEID operation - * - * @server: server / transport on which to perform the operation - * @stateid: state ID to release - * @cred: credential - * @is_recovery: set to true if this call needs to be privileged - * - * Note: this function is always asynchronous. - */ -static int nfs41_free_stateid(struct nfs_server *server, - const nfs4_stateid *stateid, - struct rpc_cred *cred, - bool is_recovery) -{ - struct rpc_task *task; - - task = _nfs41_free_stateid(server, stateid, cred, is_recovery); + task = rpc_run_task(&task_setup); if (IS_ERR(task)) return PTR_ERR(task); rpc_put_task(task);