From patchwork Fri Oct 18 19:15:17 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Weston Andros Adamson X-Patchwork-Id: 3069641 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D4D799F288 for ; Fri, 18 Oct 2013 19:15:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DD1A920397 for ; Fri, 18 Oct 2013 19:15:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8A177203E9 for ; Fri, 18 Oct 2013 19:15:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754779Ab3JRTPh (ORCPT ); Fri, 18 Oct 2013 15:15:37 -0400 Received: from mx12.netapp.com ([216.240.18.77]:25111 "EHLO mx12.netapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754467Ab3JRTPg (ORCPT ); Fri, 18 Oct 2013 15:15:36 -0400 X-IronPort-AV: E=Sophos;i="4.93,524,1378882800"; d="scan'208";a="102036384" Received: from vmwexceht02-prd.hq.netapp.com ([10.106.76.240]) by mx12-out.netapp.com with ESMTP; 18 Oct 2013 12:15:36 -0700 Received: from smtp1.corp.netapp.com (10.57.156.124) by VMWEXCEHT02-PRD.hq.netapp.com (10.106.76.240) with Microsoft SMTP Server id 14.3.123.3; Fri, 18 Oct 2013 12:15:34 -0700 Received: from vpn2ntap-64744.vpn.netapp.com (vpn2ntap-64744.vpn.netapp.com [10.55.69.84]) by smtp1.corp.netapp.com (8.13.1/8.13.1/NTAP-1.6) with ESMTP id r9IJFPgE015058; Fri, 18 Oct 2013 12:15:32 -0700 (PDT) From: Weston Andros Adamson To: CC: , Weston Andros Adamson Subject: [PATCH 3/5] NFS: cache parsed auth_info in nfs_server Date: Fri, 18 Oct 2013 15:15:17 -0400 Message-ID: <1382123719-25194-4-git-send-email-dros@netapp.com> X-Mailer: git-send-email 1.7.12.4 (Apple Git-37) In-Reply-To: <1382123719-25194-1-git-send-email-dros@netapp.com> References: <1382123719-25194-1-git-send-email-dros@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-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 Cache the auth_info structure in nfs_server and pass these values to submounts. This lays the groundwork for supporting multiple sec= options. Signed-off-by: Weston Andros Adamson --- fs/nfs/client.c | 2 ++ fs/nfs/nfs4client.c | 1 + fs/nfs/super.c | 3 +-- include/linux/nfs_fs_sb.h | 1 + 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/fs/nfs/client.c b/fs/nfs/client.c index abc535f..006fd52 100644 --- a/fs/nfs/client.c +++ b/fs/nfs/client.c @@ -786,6 +786,7 @@ static int nfs_init_server(struct nfs_server *server, goto error; server->port = data->nfs_server.port; + server->auth_info = data->auth_info; error = nfs_init_server_rpcclient(server, &timeparms, data->selected_flavor); @@ -929,6 +930,7 @@ void nfs_server_copy_userdata(struct nfs_server *target, struct nfs_server *sour target->acdirmax = source->acdirmax; target->caps = source->caps; target->options = source->options; + target->auth_info = source->auth_info; } EXPORT_SYMBOL_GPL(nfs_server_copy_userdata); diff --git a/fs/nfs/nfs4client.c b/fs/nfs/nfs4client.c index 6a0661f..73899c0 100644 --- a/fs/nfs/nfs4client.c +++ b/fs/nfs/nfs4client.c @@ -961,6 +961,7 @@ static int nfs4_init_server(struct nfs_server *server, /* Initialise the client representation from the mount data */ server->flags = data->flags; server->options = data->options; + server->auth_info = data->auth_info; if (data->auth_info.flavor_len >= 1) data->selected_flavor = data->auth_info.flavors[0]; diff --git a/fs/nfs/super.c b/fs/nfs/super.c index 7cd2d57..6c38c2a 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c @@ -2185,8 +2185,7 @@ nfs_remount(struct super_block *sb, int *flags, char *raw_data) data->wsize = nfss->wsize; data->retrans = nfss->client->cl_timeout->to_retries; data->selected_flavor = nfss->client->cl_auth->au_flavor; - data->auth_info.flavors[0] = nfss->client->cl_auth->au_flavor; - data->auth_info.flavor_len = 1; + data->auth_info = nfss->auth_info; data->acregmin = nfss->acregmin / HZ; data->acregmax = nfss->acregmax / HZ; data->acdirmin = nfss->acdirmin / HZ; diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h index f9c0a6c..ee37167 100644 --- a/include/linux/nfs_fs_sb.h +++ b/include/linux/nfs_fs_sb.h @@ -149,6 +149,7 @@ struct nfs_server { struct timespec time_delta; /* smallest time granularity */ unsigned long mount_time; /* when this fs was mounted */ dev_t s_dev; /* superblock dev numbers */ + struct nfs_auth_info auth_info; /* parsed auth flavors */ #ifdef CONFIG_NFS_FSCACHE struct nfs_fscache_key *fscache_key; /* unique key for superblock */