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);
* Create a version 2 or 3 client
*/
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 rpc_timeout timeparms;
struct nfs_client_initdata cl_init = {
.hostname = data->nfs_server.hostname,
.addr = (const struct sockaddr *)&data->nfs_server.address,
.addrlen = data->nfs_server.addrlen,
.hostname = cfg->nfs_server.hostname,
.addr = (const struct sockaddr *)&cfg->nfs_server.address,
.addrlen = cfg->nfs_server.addrlen,
.nfs_mod = nfs_mod,
.proto = data->nfs_server.protocol,
.net = data->net,
.proto = cfg->nfs_server.protocol,
.net = cfg->net,
.timeparms = &timeparms,
.cred = server->cred,
.nconnect = data->nfs_server.nconnect,
.nconnect = cfg->nfs_server.nconnect,
.init_flags = (1UL << NFS_CS_REUSEPORT),
};
struct nfs_client *clp;
int error;
nfs_init_timeout_values(&timeparms, data->nfs_server.protocol,
data->timeo, data->retrans);
if (data->flags & NFS_MOUNT_NORESVPORT)
nfs_init_timeout_values(&timeparms, cfg->nfs_server.protocol,
cfg->timeo, cfg->retrans);
if (cfg->flags & NFS_MOUNT_NORESVPORT)
set_bit(NFS_CS_NORESVPORT, &cl_init.init_flags);
/* Allocate or find a client reference we can use */
......@@ -690,46 +690,46 @@ static int nfs_init_server(struct nfs_server *server,
server->nfs_client = clp;
/* Initialise the client representation from the mount data */
server->flags = data->flags;
server->options = data->options;
server->flags = cfg->flags;
server->options = cfg->options;
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_ATIME|NFS_CAP_CTIME|NFS_CAP_MTIME;
if (data->rsize)
server->rsize = nfs_block_size(data->rsize, NULL);
if (data->wsize)
server->wsize = nfs_block_size(data->wsize, NULL);
if (cfg->rsize)
server->rsize = nfs_block_size(cfg->rsize, NULL);
if (cfg->wsize)
server->wsize = nfs_block_size(cfg->wsize, NULL);
server->acregmin = data->acregmin * HZ;
server->acregmax = data->acregmax * HZ;
server->acdirmin = data->acdirmin * HZ;
server->acdirmax = data->acdirmax * HZ;
server->acregmin = cfg->acregmin * HZ;
server->acregmax = cfg->acregmax * HZ;
server->acdirmin = cfg->acdirmin * HZ;
server->acdirmax = cfg->acdirmax * HZ;
/* Start lockd here, before we might error out */
error = nfs_start_lockd(server);
if (error < 0)
goto error;
server->port = data->nfs_server.port;
server->auth_info = data->auth_info;
server->port = cfg->nfs_server.port;
server->auth_info = cfg->auth_info;
error = nfs_init_server_rpcclient(server, &timeparms,
data->selected_flavor);
cfg->selected_flavor);
if (error < 0)
goto error;
/* Preserve the values of mount_server-related mount options */
if (data->mount_server.addrlen) {
memcpy(&server->mountd_address, &data->mount_server.address,
data->mount_server.addrlen);
server->mountd_addrlen = data->mount_server.addrlen;
if (cfg->mount_server.addrlen) {
memcpy(&server->mountd_address, &cfg->mount_server.address,
cfg->mount_server.addrlen);
server->mountd_addrlen = cfg->mount_server.addrlen;
}
server->mountd_version = data->mount_server.version;
server->mountd_port = data->mount_server.port;
server->mountd_protocol = data->mount_server.protocol;
server->mountd_version = cfg->mount_server.version;
server->mountd_port = cfg->mount_server.port;
server->mountd_protocol = cfg->mount_server.protocol;
server->namelen = data->namlen;
server->namelen = cfg->namlen;
return 0;
error:
......@@ -970,7 +970,7 @@ struct nfs_server *nfs_create_server(struct nfs_mount_info *mount_info)
goto error;
/* 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)
goto error;
......@@ -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->namelen == 0 || 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;
} else {
if (server->namelen == 0 || server->namelen > NFS2_MAXNAMLEN)
......
This diff is collapsed.
......@@ -81,7 +81,7 @@ struct nfs_client_initdata {
/*
* In-kernel mount arguments
*/
struct nfs_parsed_mount_data {
struct nfs_fs_context {
int flags;
unsigned int rsize, wsize;
unsigned int timeo, retrans;
......@@ -138,7 +138,7 @@ struct nfs_mount_request {
struct nfs_mount_info {
unsigned int inherited_bsize;
struct nfs_parsed_mount_data *parsed;
struct nfs_fs_context *ctx;
struct nfs_clone_mount *cloned;
struct nfs_server *server;
struct nfs_fh *mntfh;
......@@ -229,16 +229,16 @@ struct nfs_pageio_descriptor;
/* mount.c */
#define NFS_TEXT_DATA 1
extern struct nfs_parsed_mount_data *nfs_alloc_parsed_mount_data(void);
extern void nfs_free_parsed_mount_data(struct nfs_parsed_mount_data *data);
extern int nfs_parse_mount_options(char *raw, struct nfs_parsed_mount_data *mnt);
extern struct nfs_fs_context *nfs_alloc_parsed_mount_data(void);
extern void nfs_free_parsed_mount_data(struct nfs_fs_context *ctx);
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,
void *options,
struct nfs_parsed_mount_data *args,
struct nfs_fs_context *ctx,
struct nfs_fh *mntfh,
const char *dev_name);
extern int nfs_validate_text_mount_data(void *options,
struct nfs_parsed_mount_data *args,
struct nfs_fs_context *ctx,
const char *dev_name);
/* pagelist.c */
......
......@@ -1056,61 +1056,61 @@ static int nfs4_server_common_setup(struct nfs_server *server,
* Create a version 4 volume record
*/
static int nfs4_init_server(struct nfs_server *server,
struct nfs_parsed_mount_data *data)
struct nfs_fs_context *ctx)
{
struct rpc_timeout timeparms;
int error;
nfs_init_timeout_values(&timeparms, data->nfs_server.protocol,
data->timeo, data->retrans);
nfs_init_timeout_values(&timeparms, ctx->nfs_server.protocol,
ctx->timeo, ctx->retrans);
/* Initialise the client representation from the mount data */
server->flags = data->flags;
server->options = data->options;
server->auth_info = data->auth_info;
server->flags = ctx->flags;
server->options = ctx->options;
server->auth_info = ctx->auth_info;
/* Use the first specified auth flavor. If this flavor isn't
* allowed by the server, use the SECINFO path to try the
* other specified flavors */
if (data->auth_info.flavor_len >= 1)
data->selected_flavor = data->auth_info.flavors[0];
if (ctx->auth_info.flavor_len >= 1)
ctx->selected_flavor = ctx->auth_info.flavors[0];
else
data->selected_flavor = RPC_AUTH_UNIX;
ctx->selected_flavor = RPC_AUTH_UNIX;
/* Get a client record */
error = nfs4_set_client(server,
data->nfs_server.hostname,
(const struct sockaddr *)&data->nfs_server.address,
data->nfs_server.addrlen,
data->client_address,
data->nfs_server.protocol,
ctx->nfs_server.hostname,
(const struct sockaddr *)&ctx->nfs_server.address,
ctx->nfs_server.addrlen,
ctx->client_address,
ctx->nfs_server.protocol,
&timeparms,
data->minorversion,
data->nfs_server.nconnect,
data->net);
ctx->minorversion,
ctx->nfs_server.nconnect,
ctx->net);
if (error < 0)
return error;
if (data->rsize)
server->rsize = nfs_block_size(data->rsize, NULL);
if (data->wsize)
server->wsize = nfs_block_size(data->wsize, NULL);
if (ctx->rsize)
server->rsize = nfs_block_size(ctx->rsize, NULL);
if (ctx->wsize)
server->wsize = nfs_block_size(ctx->wsize, NULL);
server->acregmin = data->acregmin * HZ;
server->acregmax = data->acregmax * HZ;
server->acdirmin = data->acdirmin * HZ;
server->acdirmax = data->acdirmax * HZ;
server->port = data->nfs_server.port;
server->acregmin = ctx->acregmin * HZ;
server->acregmax = ctx->acregmax * HZ;
server->acdirmin = ctx->acdirmin * HZ;
server->acdirmax = ctx->acdirmax * HZ;
server->port = ctx->nfs_server.port;
return nfs_init_server_rpcclient(server, &timeparms,
data->selected_flavor);
ctx->selected_flavor);
}
/*
* Create a version 4 volume record
* - 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_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());
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 */
error = nfs4_init_server(server, mount_info->parsed);
error = nfs4_init_server(server, mount_info->ctx);
if (error < 0)
goto error;
......
......@@ -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 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;
dfprintk(MOUNT, "--> nfs4_try_mount()\n");
res = do_nfs4_mount(nfs4_create_server(mount_info),
flags, mount_info,
data->nfs_server.hostname,
data->nfs_server.export_path);
ctx->nfs_server.hostname,
ctx->nfs_server.export_path);
dfprintk(MOUNT, "<-- nfs4_try_mount() = %d%s\n",
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