Skip to content

Commit

Permalink
nfs: move server_authlist into nfs_try_mount_request
Browse files Browse the repository at this point in the history
In a later patch we're going to want to cycle over this list and attempt
to call ->create_server for each different flavor until one succeeds.
Move the list allocation to the stack of nfs_try_mount_request() and
pass a pointer to it and its length to nfs_request_mount().

Cc: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
  • Loading branch information
Jeff Layton authored and Trond Myklebust committed Jun 28, 2013
1 parent d17540c commit 294ae81
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions fs/nfs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -1701,18 +1701,18 @@ static int nfs_select_flavor(struct nfs_parsed_mount_data *args,
* corresponding to the provided path.
*/
static int nfs_request_mount(struct nfs_parsed_mount_data *args,
struct nfs_fh *root_fh)
struct nfs_fh *root_fh,
rpc_authflavor_t *server_authlist,
unsigned int *server_authlist_len)
{
rpc_authflavor_t server_authlist[NFS_MAX_SECFLAVORS];
unsigned int server_authlist_len = ARRAY_SIZE(server_authlist);
struct nfs_mount_request request = {
.sap = (struct sockaddr *)
&args->mount_server.address,
.dirpath = args->nfs_server.export_path,
.protocol = args->mount_server.protocol,
.fh = root_fh,
.noresvport = args->flags & NFS_MOUNT_NORESVPORT,
.auth_flav_len = &server_authlist_len,
.auth_flav_len = server_authlist_len,
.auth_flavs = server_authlist,
.net = args->net,
};
Expand Down Expand Up @@ -1763,8 +1763,12 @@ static struct nfs_server *nfs_try_mount_request(struct nfs_mount_info *mount_inf
struct nfs_subversion *nfs_mod)
{
int status;
struct nfs_parsed_mount_data *args = mount_info->parsed;
rpc_authflavor_t authlist[NFS_MAX_SECFLAVORS];
unsigned int authlist_len = ARRAY_SIZE(authlist);

status = nfs_request_mount(mount_info->parsed, mount_info->mntfh);
status = nfs_request_mount(args, mount_info->mntfh, authlist,
&authlist_len);
if (status)
return ERR_PTR(status);

Expand Down

0 comments on commit 294ae81

Please sign in to comment.