From patchwork Fri Apr 22 00:51:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 8905051 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B9F5DBF29F for ; Fri, 22 Apr 2016 00:52:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B8E98202EC for ; Fri, 22 Apr 2016 00:52:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C864C20270 for ; Fri, 22 Apr 2016 00:52:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751814AbcDVAwM (ORCPT ); Thu, 21 Apr 2016 20:52:12 -0400 Received: from mail-qg0-f46.google.com ([209.85.192.46]:35173 "EHLO mail-qg0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751594AbcDVAwL (ORCPT ); Thu, 21 Apr 2016 20:52:11 -0400 Received: by mail-qg0-f46.google.com with SMTP id f74so48437943qge.2 for ; Thu, 21 Apr 2016 17:52:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poochiereds-net.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=HqsbTgaEoIp4klMCgDhBtDrE1obe3eYSODIu+fz+pQY=; b=UZniI5CT1h7ERA/H7OuHSW1FMPeJHRto6EIioVwz0aw9D2UkmnUlsUReQc6JEJ54Bv DcgUrp/TFi2aXL5yDV4lMWtU7Qh4oXkDlOGj3YYFNc/BqvHA2gu+XGsxGVhXVLloF7vW sxF3fy26AKd+XLeyhYM7kYIQvXN03oORJ2ItvKRr2fzWHPbxOX7J4GJFrqVtGS65ZNW9 qECnmjHb6vXp7Ne01GTz5tZZ2IIanLTMX6FTBGhjQPYimS+uiGNOx0g22JkT6mTxSiBd QQ6yArOowpMsammmQB/1rCcf5MY2hythC3HhRJvetWcQFSf5801C0x7Y9XxDOZIefl8I jXTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=HqsbTgaEoIp4klMCgDhBtDrE1obe3eYSODIu+fz+pQY=; b=MpN5HHMRv43/7mFzQkIrU13BjG7JbXlabx7fbDEgGaCkdMM0/9m8/V3yZm7jc7GI5Y 6O9Pugdxqy2ovfyXtKlvWu+HV/iegvLgJklssdduB6q2prnvxW30jPLNurk5VrA8/Ejk o15IQjZfN1KFP29IrUOSGm2WrGfbB3YP+j8VSumYmW9H1vxowCHPkMJrq8Z/2JGiCfzp OVVuMCc+zrV8YisgiLmuRDiFA9p8tuflMJrEs49moYdEcNAVtI+0XEdehUUj6374oTOb 52Pp36k2kDgAfhnZ7/b4n9zyT/Y/DFTjK8tNoGs14+CbkuHQuBlVYajveq0pd2oOiFN3 zuFg== X-Gm-Message-State: AOPr4FXLcwPtfJaAONq5BeN/QmZBsukQ3hbIgeufffh9mhG+GBXIykTHmjtFv8qgoR+Mlw== X-Received: by 10.140.229.69 with SMTP id z66mr20150079qhb.48.1461286330615; Thu, 21 Apr 2016 17:52:10 -0700 (PDT) Received: from tlielax.poochiereds.net ([2606:a000:1125:4074:3a60:77ff:fe93:a95d]) by smtp.googlemail.com with ESMTPSA id 13sm1573335qgt.8.2016.04.21.17.52.09 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 21 Apr 2016 17:52:09 -0700 (PDT) From: Jeff Layton X-Google-Original-From: Jeff Layton To: trond.myklebust@primarydata.com Cc: Anna Schumaker , linux-nfs@vger.kernel.org Subject: [PATCH v2 2/7] sunrpc: add rpc_lookup_generic_cred Date: Thu, 21 Apr 2016 20:51:55 -0400 Message-Id: <1461286320-24601-3-git-send-email-jeff.layton@primarydata.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1461286320-24601-1-git-send-email-jeff.layton@primarydata.com> References: <1461286320-24601-1-git-send-email-jeff.layton@primarydata.com> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,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 From: Weston Andros Adamson Add function rpc_lookup_generic_cred, which allows lookups of a generic credential that's not current_cred(). [jlayton: add gfp_t parm] Signed-off-by: Jeff Layton --- include/linux/sunrpc/auth.h | 1 + net/sunrpc/auth_generic.c | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h index 3b616aa7e4d2..16bd8f8fef8c 100644 --- a/include/linux/sunrpc/auth.h +++ b/include/linux/sunrpc/auth.h @@ -167,6 +167,7 @@ void rpc_destroy_authunix(void); struct rpc_cred * rpc_lookup_cred(void); struct rpc_cred * rpc_lookup_cred_nonblock(void); +struct rpc_cred * rpc_lookup_generic_cred(struct auth_cred *, int, gfp_t); struct rpc_cred * rpc_lookup_machine_cred(const char *service_name); int rpcauth_register(const struct rpc_authops *); int rpcauth_unregister(const struct rpc_authops *); diff --git a/net/sunrpc/auth_generic.c b/net/sunrpc/auth_generic.c index 6ed3e3df43e9..54dd3fdead54 100644 --- a/net/sunrpc/auth_generic.c +++ b/net/sunrpc/auth_generic.c @@ -38,6 +38,13 @@ struct rpc_cred *rpc_lookup_cred(void) } EXPORT_SYMBOL_GPL(rpc_lookup_cred); +struct rpc_cred * +rpc_lookup_generic_cred(struct auth_cred *acred, int flags, gfp_t gfp) +{ + return rpcauth_lookup_credcache(&generic_auth, acred, flags, gfp); +} +EXPORT_SYMBOL_GPL(rpc_lookup_generic_cred); + struct rpc_cred *rpc_lookup_cred_nonblock(void) { return rpcauth_lookupcred(&generic_auth, RPCAUTH_LOOKUP_RCU);