From patchwork Thu Apr 14 12:37:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 8835841 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 73251C0553 for ; Thu, 14 Apr 2016 12:37:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8A47820125 for ; Thu, 14 Apr 2016 12:37:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9FBF720256 for ; Thu, 14 Apr 2016 12:37:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932100AbcDNMhQ (ORCPT ); Thu, 14 Apr 2016 08:37:16 -0400 Received: from mail-qg0-f49.google.com ([209.85.192.49]:35523 "EHLO mail-qg0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755193AbcDNMhP (ORCPT ); Thu, 14 Apr 2016 08:37:15 -0400 Received: by mail-qg0-f49.google.com with SMTP id f105so61699927qge.2 for ; Thu, 14 Apr 2016 05:37:14 -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=YDhHqrwCo86a67So+JQDRLvLE6YYLSujhoH7byN5HpI=; b=wL4tressxTKY7/lhQ7dCGtdikphc+1qvieEwMQEwkq6OGI1SJrJB6Kec6eGaT5/tHI oy37vSnPI39x/FHjlAxoRxY9+f7h+nWL80g2vbqiWRMuX5ACxFKeOD70G8iGZtujJLPU C2oDgMW3KkJ8n3wK0JZbt7U8LTb6+FdP5Xr+6xd85f7HcTYEyp9kvKaNYdcf4HfBuH/V w/4lIPmaSaBx5G38v4VCRGiz46JVGaW6dXQwQAQ6u8L2PjG7d+nFfhqVaz3Ty8DWEVI/ RCsyUUOTLNnu8VV1ojhDljIcYZkE6bb2r+PpyMWxeKd8JCBL1RPEVfQlDDnKMbK8cKnF ODWQ== 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=YDhHqrwCo86a67So+JQDRLvLE6YYLSujhoH7byN5HpI=; b=R+jZnCpyi72TEyvjU1vAu+uy5o0UFNsaWRWBkgbp8YSaEXe9T9fmMuvyRQcU5NAeuq Ae6BYFXdhkXFzaikYIKpvhZCYfc96AEoOiU/J3+vgdqs1Jiew/83L+YEFgeRyeb3LcRt 5z4CuJ+U1ULgSogqarmm1fGxuGPc5A7D/XqbUNnf+jpQAoxqTrgUf+k8guVifzyHy2Hi POT9c6bNeEi99rSEIHzupq21UBg9+M7Co7DeTUtKYR2fLUawOtLB2YPcdx5hQcnqvcQ2 8EEeu0mAEpEv50WgYD5VaYyjn8PL/5UYX1bZxNG3RTdzECguVSSKIVjDJy7dAyG6pwwN bBkg== X-Gm-Message-State: AOPr4FXJDgfIphNBfVn3HKK4xNPUFXRok9TOY7RwHtS+AOmIBqYdwqq0wCPgy5mNrWGI+Q== X-Received: by 10.140.204.214 with SMTP id z205mr8563913qha.99.1460637434050; Thu, 14 Apr 2016 05:37:14 -0700 (PDT) Received: from tlielax.poochiereds.net ([2606:a000:1125:4074:3a60:77ff:fe93:a95d]) by smtp.googlemail.com with ESMTPSA id e11sm18022238qkb.39.2016.04.14.05.37.13 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 14 Apr 2016 05:37:13 -0700 (PDT) From: Jeff Layton X-Google-Original-From: Jeff Layton To: trond.myklebust@primarydata.com Cc: linux-nfs@vger.kernel.org Subject: [PATCH 3/8] sunrpc: add rpc_lookup_generic_cred Date: Thu, 14 Apr 2016 08:37:00 -0400 Message-Id: <1460637425-1580-4-git-send-email-jeff.layton@primarydata.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1460637425-1580-1-git-send-email-jeff.layton@primarydata.com> References: <1460637425-1580-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 774ea8a8f917..7a7da1f85f83 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);