From patchwork Fri Feb 24 22:19:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Adamson X-Patchwork-Id: 9591311 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 CD246601AE for ; Fri, 24 Feb 2017 22:20:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AE3D2287AC for ; Fri, 24 Feb 2017 22:20:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A3239287B6; Fri, 24 Feb 2017 22:20:19 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 13FC0287C8 for ; Fri, 24 Feb 2017 22:20:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751348AbdBXWUF (ORCPT ); Fri, 24 Feb 2017 17:20:05 -0500 Received: from mx141.netapp.com ([216.240.21.12]:18075 "EHLO mx141.netapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751163AbdBXWUE (ORCPT ); Fri, 24 Feb 2017 17:20:04 -0500 X-IronPort-AV: E=Sophos;i="5.35,201,1484035200"; d="scan'208";a="185740710" Received: from vmwexchts03-prd.hq.netapp.com ([10.122.105.31]) by mx141-out.netapp.com with ESMTP; 24 Feb 2017 14:11:55 -0800 Received: from smtp2.corp.netapp.com (10.57.159.114) by VMWEXCHTS03-PRD.hq.netapp.com (10.122.105.31) with Microsoft SMTP Server id 15.0.1210.3; Fri, 24 Feb 2017 14:20:02 -0800 Received: from fc25-1.androsad.fake (dros-16.vpn.netapp.com [10.55.72.26]) by smtp2.corp.netapp.com (8.13.1/8.13.1/NTAP-1.6) with ESMTP id v1OMK0nQ020915; Fri, 24 Feb 2017 14:20:02 -0800 (PST) From: To: CC: , , , Andy Adamson Subject: [PATCH Version 5 02/17] SUNRPC: RPCNULL call with payload for GSSv3 Date: Fri, 24 Feb 2017 17:19:38 -0500 Message-ID: <20170224221953.5502-3-andros@netapp.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170224221953.5502-1-andros@netapp.com> References: <20170224221953.5502-1-andros@netapp.com> MIME-Version: 1.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: Andy Adamson RPCSEC_GSS_CREATE and RPCSEC_GSS_LIST are RPCNULL calls with a payload Signed-off-by: Andy Adamson --- include/linux/sunrpc/clnt.h | 3 +++ net/sunrpc/clnt.c | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h index 333ad11..6d9e4ac 100644 --- a/include/linux/sunrpc/clnt.h +++ b/include/linux/sunrpc/clnt.h @@ -175,6 +175,9 @@ int rpc_call_sync(struct rpc_clnt *clnt, const struct rpc_message *msg, int flags); struct rpc_task *rpc_call_null(struct rpc_clnt *clnt, struct rpc_cred *cred, int flags); +struct rpc_task *rpc_call_null_payload(struct rpc_clnt *clnt, + struct rpc_cred *cred, int flags, void *argp, + void *resp, struct rpc_procinfo *pinfo); int rpc_restart_call_prepare(struct rpc_task *); int rpc_restart_call(struct rpc_task *); void rpc_setbufsize(struct rpc_clnt *, unsigned int, unsigned int); diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index 1dc9f3b..c6f1d04 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c @@ -2508,6 +2508,26 @@ static int rpcproc_decode_null(void *rqstp, struct xdr_stream *xdr, void *obj) return 0; } +struct rpc_task * +rpc_call_null_payload(struct rpc_clnt *clnt, struct rpc_cred *cred, int flags, + void *argp, void *resp, struct rpc_procinfo *pinfo) +{ + struct rpc_message msg = { + .rpc_proc = pinfo, + .rpc_argp = argp, + .rpc_resp = resp, + .rpc_cred = cred, + }; + struct rpc_task_setup task_setup_data = { + .rpc_client = clnt, + .rpc_message = &msg, + .callback_ops = &rpc_default_ops, + .flags = flags, + }; + return rpc_run_task(&task_setup_data); +} +EXPORT_SYMBOL_GPL(rpc_call_null_payload); + static struct rpc_procinfo rpcproc_null = { .p_encode = rpcproc_encode_null, .p_decode = rpcproc_decode_null,