Commit 5eb005ca authored by David Howells's avatar David Howells Committed by Anna Schumaker

NFS: Rename struct nfs_parsed_mount_data to struct nfs_fs_context

Rename struct nfs_parsed_mount_data to struct nfs_fs_context and rename
pointers to it to "ctx".  At some point this will be pointed to by an
fs_context struct's fs_private pointer.
Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
parent e0a626b1
...@@ -658,28 +658,28 @@ EXPORT_SYMBOL_GPL(nfs_init_client); ...@@ -658,28 +658,28 @@ EXPORT_SYMBOL_GPL(nfs_init_client);
* Create a version 2 or 3 client * Create a version 2 or 3 client
*/ */
static int nfs_init_server(struct nfs_server *server, static int nfs_init_server(struct nfs_server *server,
const struct nfs_parsed_mount_data *data, const struct nfs_fs_context *cfg,
struct nfs_subversion *nfs_mod) struct nfs_subversion *nfs_mod)
{ {
struct rpc_timeout timeparms; struct rpc_timeout timeparms;
struct nfs_client_initdata cl_init = { struct nfs_client_initdata cl_init = {
.hostname = data->nfs_server.hostname, .hostname = cfg->nfs_server.hostname,
.addr = (const struct sockaddr *)&data->nfs_server.address, .addr = (const struct sockaddr *)&cfg->nfs_server.address,
.addrlen = data->nfs_server.addrlen, .addrlen = cfg->nfs_server.addrlen,
.nfs_mod = nfs_mod, .nfs_mod = nfs_mod,
.proto = data->nfs_server.protocol, .proto = cfg->nfs_server.protocol,
.net = data->net, .net = cfg->net,
.timeparms = &timeparms, .timeparms = &timeparms,
.cred = server->cred, .cred = server->cred,
.nconnect = data->nfs_server.nconnect, .nconnect = cfg->nfs_server.nconnect,
.init_flags = (1UL << NFS_CS_REUSEPORT), .init_flags = (1UL << NFS_CS_REUSEPORT),
}; };
struct nfs_client *clp; struct nfs_client *clp;
int error; int error;
nfs_init_timeout_values(&timeparms, data->nfs_server.protocol, nfs_init_timeout_values(&timeparms, cfg->nfs_server.protocol,
data->timeo, data->retrans); cfg->timeo, cfg->retrans);
if (data->flags & NFS_MOUNT_NORESVPORT) if (cfg->flags & NFS_MOUNT_NORESVPORT)
set_bit(NFS_CS_NORESVPORT, &cl_init.init_flags); set_bit(NFS_CS_NORESVPORT, &cl_init.init_flags);
/* Allocate or find a client reference we can use */ /* Allocate or find a client reference we can use */
...@@ -690,46 +690,46 @@ static int nfs_init_server(struct nfs_server *server, ...@@ -690,46 +690,46 @@ static int nfs_init_server(struct nfs_server *server,
server->nfs_client = clp; server->nfs_client = clp;
/* Initialise the client representation from the mount data */ /* Initialise the client representation from the mount data */
server->flags = data->flags; server->flags = cfg->flags;
server->options = data->options; server->options = cfg->options;
server->caps |= NFS_CAP_HARDLINKS|NFS_CAP_SYMLINKS|NFS_CAP_FILEID| server->caps |= NFS_CAP_HARDLINKS|NFS_CAP_SYMLINKS|NFS_CAP_FILEID|
NFS_CAP_MODE|NFS_CAP_NLINK|NFS_CAP_OWNER|NFS_CAP_OWNER_GROUP| NFS_CAP_MODE|NFS_CAP_NLINK|NFS_CAP_OWNER|NFS_CAP_OWNER_GROUP|
NFS_CAP_ATIME|NFS_CAP_CTIME|NFS_CAP_MTIME; NFS_CAP_ATIME|NFS_CAP_CTIME|NFS_CAP_MTIME;
if (data->rsize) if (cfg->rsize)
server->rsize = nfs_block_size(data->rsize, NULL); server->rsize = nfs_block_size(cfg->rsize, NULL);
if (data->wsize) if (cfg->wsize)
server->wsize = nfs_block_size(data->wsize, NULL); server->wsize = nfs_block_size(cfg->wsize, NULL);
server->acregmin = data->acregmin * HZ; server->acregmin = cfg->acregmin * HZ;
server->acregmax = data->acregmax * HZ; server->acregmax = cfg->acregmax * HZ;
server->acdirmin = data->acdirmin * HZ; server->acdirmin = cfg->acdirmin * HZ;
server->acdirmax = data->acdirmax * HZ; server->acdirmax = cfg->acdirmax * HZ;
/* Start lockd here, before we might error out */ /* Start lockd here, before we might error out */
error = nfs_start_lockd(server); error = nfs_start_lockd(server);
if (error < 0) if (error < 0)
goto error; goto error;
server->port = data->nfs_server.port; server->port = cfg->nfs_server.port;
server->auth_info = data->auth_info; server->auth_info = cfg->auth_info;
error = nfs_init_server_rpcclient(server, &timeparms, error = nfs_init_server_rpcclient(server, &timeparms,
data->selected_flavor); cfg->selected_flavor);
if (error < 0) if (error < 0)
goto error; goto error;
/* Preserve the values of mount_server-related mount options */ /* Preserve the values of mount_server-related mount options */
if (data->mount_server.addrlen) { if (cfg->mount_server.addrlen) {
memcpy(&server->mountd_address, &data->mount_server.address, memcpy(&server->mountd_address, &cfg->mount_server.address,
data->mount_server.addrlen); cfg->mount_server.addrlen);
server->mountd_addrlen = data->mount_server.addrlen; server->mountd_addrlen = cfg->mount_server.addrlen;
} }
server->mountd_version = data->mount_server.version; server->mountd_version = cfg->mount_server.version;
server->mountd_port = data->mount_server.port; server->mountd_port = cfg->mount_server.port;
server->mountd_protocol = data->mount_server.protocol; server->mountd_protocol = cfg->mount_server.protocol;
server->namelen = data->namlen; server->namelen = cfg->namlen;
return 0; return 0;
error: error:
...@@ -970,7 +970,7 @@ struct nfs_server *nfs_create_server(struct nfs_mount_info *mount_info) ...@@ -970,7 +970,7 @@ struct nfs_server *nfs_create_server(struct nfs_mount_info *mount_info)
goto error; goto error;
/* Get a client representation */ /* Get a client representation */
error = nfs_init_server(server, mount_info->parsed, nfs_mod); error = nfs_init_server(server, mount_info->ctx, nfs_mod);
if (error < 0) if (error < 0)
goto error; goto error;
...@@ -981,7 +981,7 @@ struct nfs_server *nfs_create_server(struct nfs_mount_info *mount_info) ...@@ -981,7 +981,7 @@ struct nfs_server *nfs_create_server(struct nfs_mount_info *mount_info)
if (server->nfs_client->rpc_ops->version == 3) { if (server->nfs_client->rpc_ops->version == 3) {
if (server->namelen == 0 || server->namelen > NFS3_MAXNAMLEN) if (server->namelen == 0 || server->namelen > NFS3_MAXNAMLEN)
server->namelen = NFS3_MAXNAMLEN; server->namelen = NFS3_MAXNAMLEN;
if (!(mount_info->parsed->flags & NFS_MOUNT_NORDIRPLUS)) if (!(mount_info->ctx->flags & NFS_MOUNT_NORDIRPLUS))
server->caps |= NFS_CAP_READDIRPLUS; server->caps |= NFS_CAP_READDIRPLUS;
} else { } else {
if (server->namelen == 0 || server->namelen > NFS2_MAXNAMLEN) if (server->namelen == 0 || server->namelen > NFS2_MAXNAMLEN)
......
This diff is collapsed.
...@@ -81,7 +81,7 @@ struct nfs_client_initdata { ...@@ -81,7 +81,7 @@ struct nfs_client_initdata {
/* /*
* In-kernel mount arguments * In-kernel mount arguments
*/ */
struct nfs_parsed_mount_data { struct nfs_fs_context {
int flags; int flags;
unsigned int rsize, wsize; unsigned int rsize, wsize;
unsigned int timeo, retrans; unsigned int timeo, retrans;
...@@ -138,7 +138,7 @@ struct nfs_mount_request { ...@@ -138,7 +138,7 @@ struct nfs_mount_request {
struct nfs_mount_info { struct nfs_mount_info {
unsigned int inherited_bsize; unsigned int inherited_bsize;
struct nfs_parsed_mount_data *parsed; struct nfs_fs_context *ctx;
struct nfs_clone_mount *cloned; struct nfs_clone_mount *cloned;
struct nfs_server *server; struct nfs_server *server;
struct nfs_fh *mntfh; struct nfs_fh *mntfh;
...@@ -229,16 +229,16 @@ struct nfs_pageio_descriptor; ...@@ -229,16 +229,16 @@ struct nfs_pageio_descriptor;
/* mount.c */ /* mount.c */
#define NFS_TEXT_DATA 1 #define NFS_TEXT_DATA 1
extern struct nfs_parsed_mount_data *nfs_alloc_parsed_mount_data(void); extern struct nfs_fs_context *nfs_alloc_parsed_mount_data(void);
extern void nfs_free_parsed_mount_data(struct nfs_parsed_mount_data *data); extern void nfs_free_parsed_mount_data(struct nfs_fs_context *ctx);
extern int nfs_parse_mount_options(char *raw, struct nfs_parsed_mount_data *mnt); extern int nfs_parse_mount_options(char *raw, struct nfs_fs_context *ctx);
extern int nfs_validate_mount_data(struct file_system_type *fs_type, extern int nfs_validate_mount_data(struct file_system_type *fs_type,
void *options, void *options,
struct nfs_parsed_mount_data *args, struct nfs_fs_context *ctx,
struct nfs_fh *mntfh, struct nfs_fh *mntfh,
const char *dev_name); const char *dev_name);
extern int nfs_validate_text_mount_data(void *options, extern int nfs_validate_text_mount_data(void *options,
struct nfs_parsed_mount_data *args, struct nfs_fs_context *ctx,
const char *dev_name); const char *dev_name);
/* pagelist.c */ /* pagelist.c */
......
...@@ -1056,61 +1056,61 @@ static int nfs4_server_common_setup(struct nfs_server *server, ...@@ -1056,61 +1056,61 @@ static int nfs4_server_common_setup(struct nfs_server *server,
* Create a version 4 volume record * Create a version 4 volume record
*/ */
static int nfs4_init_server(struct nfs_server *server, static int nfs4_init_server(struct nfs_server *server,
struct nfs_parsed_mount_data *data) struct nfs_fs_context *ctx)
{ {
struct rpc_timeout timeparms; struct rpc_timeout timeparms;
int error; int error;
nfs_init_timeout_values(&timeparms, data->nfs_server.protocol, nfs_init_timeout_values(&timeparms, ctx->nfs_server.protocol,
data->timeo, data->retrans); ctx->timeo, ctx->retrans);
/* Initialise the client representation from the mount data */ /* Initialise the client representation from the mount data */
server->flags = data->flags; server->flags = ctx->flags;
server->options = data->options; server->options = ctx->options;
server->auth_info = data->auth_info; server->auth_info = ctx->auth_info;
/* Use the first specified auth flavor. If this flavor isn't /* Use the first specified auth flavor. If this flavor isn't
* allowed by the server, use the SECINFO path to try the * allowed by the server, use the SECINFO path to try the
* other specified flavors */ * other specified flavors */
if (data->auth_info.flavor_len >= 1) if (ctx->auth_info.flavor_len >= 1)
data->selected_flavor = data->auth_info.flavors[0]; ctx->selected_flavor = ctx->auth_info.flavors[0];
else else
data->selected_flavor = RPC_AUTH_UNIX; ctx->selected_flavor = RPC_AUTH_UNIX;
/* Get a client record */ /* Get a client record */
error = nfs4_set_client(server, error = nfs4_set_client(server,
data->nfs_server.hostname, ctx->nfs_server.hostname,
(const struct sockaddr *)&data->nfs_server.address, (const struct sockaddr *)&ctx->nfs_server.address,
data->nfs_server.addrlen, ctx->nfs_server.addrlen,
data->client_address, ctx->client_address,
data->nfs_server.protocol, ctx->nfs_server.protocol,
&timeparms, &timeparms,
data->minorversion, ctx->minorversion,
data->nfs_server.nconnect, ctx->nfs_server.nconnect,
data->net); ctx->net);
if (error < 0) if (error < 0)
return error; return error;
if (data->rsize) if (ctx->rsize)
server->rsize = nfs_block_size(data->rsize, NULL); server->rsize = nfs_block_size(ctx->rsize, NULL);
if (data->wsize) if (ctx->wsize)
server->wsize = nfs_block_size(data->wsize, NULL); server->wsize = nfs_block_size(ctx->wsize, NULL);
server->acregmin = data->acregmin * HZ; server->acregmin = ctx->acregmin * HZ;
server->acregmax = data->acregmax * HZ; server->acregmax = ctx->acregmax * HZ;
server->acdirmin = data->acdirmin * HZ; server->acdirmin = ctx->acdirmin * HZ;
server->acdirmax = data->acdirmax * HZ; server->acdirmax = ctx->acdirmax * HZ;
server->port = data->nfs_server.port; server->port = ctx->nfs_server.port;
return nfs_init_server_rpcclient(server, &timeparms, return nfs_init_server_rpcclient(server, &timeparms,
data->selected_flavor); ctx->selected_flavor);
} }
/* /*
* Create a version 4 volume record * Create a version 4 volume record
* - keyed on server and FSID * - keyed on server and FSID
*/ */
/*struct nfs_server *nfs4_create_server(const struct nfs_parsed_mount_data *data, /*struct nfs_server *nfs4_create_server(const struct nfs_fs_context *data,
struct nfs_fh *mntfh)*/ struct nfs_fh *mntfh)*/
struct nfs_server *nfs4_create_server(struct nfs_mount_info *mount_info) struct nfs_server *nfs4_create_server(struct nfs_mount_info *mount_info)
{ {
...@@ -1124,10 +1124,10 @@ struct nfs_server *nfs4_create_server(struct nfs_mount_info *mount_info) ...@@ -1124,10 +1124,10 @@ struct nfs_server *nfs4_create_server(struct nfs_mount_info *mount_info)
server->cred = get_cred(current_cred()); server->cred = get_cred(current_cred());
auth_probe = mount_info->parsed->auth_info.flavor_len < 1; auth_probe = mount_info->ctx->auth_info.flavor_len < 1;
/* set up the general RPC client */ /* set up the general RPC client */
error = nfs4_init_server(server, mount_info->parsed); error = nfs4_init_server(server, mount_info->ctx);
if (error < 0) if (error < 0)
goto error; goto error;
......
...@@ -198,15 +198,15 @@ static struct dentry *do_nfs4_mount(struct nfs_server *server, int flags, ...@@ -198,15 +198,15 @@ static struct dentry *do_nfs4_mount(struct nfs_server *server, int flags,
struct dentry *nfs4_try_mount(int flags, const char *dev_name, struct dentry *nfs4_try_mount(int flags, const char *dev_name,
struct nfs_mount_info *mount_info) struct nfs_mount_info *mount_info)
{ {
struct nfs_parsed_mount_data *data = mount_info->parsed; struct nfs_fs_context *ctx = mount_info->ctx;
struct dentry *res; struct dentry *res;
dfprintk(MOUNT, "--> nfs4_try_mount()\n"); dfprintk(MOUNT, "--> nfs4_try_mount()\n");
res = do_nfs4_mount(nfs4_create_server(mount_info), res = do_nfs4_mount(nfs4_create_server(mount_info),
flags, mount_info, flags, mount_info,
data->nfs_server.hostname, ctx->nfs_server.hostname,
data->nfs_server.export_path); ctx->nfs_server.export_path);
dfprintk(MOUNT, "<-- nfs4_try_mount() = %d%s\n", dfprintk(MOUNT, "<-- nfs4_try_mount() = %d%s\n",
PTR_ERR_OR_ZERO(res), PTR_ERR_OR_ZERO(res),
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment