summaryrefslogtreecommitdiff
path: root/fs/nfs/client.c
diff options
context:
space:
mode:
authorScott Mayhew <smayhew@redhat.com>2019-12-10 07:31:14 -0500
committerAnna Schumaker <Anna.Schumaker@Netapp.com>2020-01-15 10:15:17 -0500
commit62a55d088cd87d480a6fd67b0d63b14ccae80838 (patch)
tree0ddc759236070f35409b58c8a30a01610978c6a1 /fs/nfs/client.c
parentf2aedb713c284429987dc66c7aaf38decfc8da2a (diff)
downloadlwn-62a55d088cd87d480a6fd67b0d63b14ccae80838.tar.gz
lwn-62a55d088cd87d480a6fd67b0d63b14ccae80838.zip
NFS: Additional refactoring for fs_context conversion
Split out from commit "NFS: Add fs_context support." This patch adds additional refactoring for the conversion of NFS to use fs_context, namely: (*) Merge nfs_mount_info and nfs_clone_mount into nfs_fs_context. nfs_clone_mount has had several fields removed, and nfs_mount_info has been removed altogether. (*) Various functions now take an fs_context as an argument instead of nfs_mount_info, nfs_fs_context, etc. Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to 'fs/nfs/client.c')
-rw-r--r--fs/nfs/client.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index 69c0708b2acc..8f760f23748c 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -658,17 +658,17 @@ 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_fs_context *ctx,
- struct nfs_subversion *nfs_mod)
+ const struct fs_context *fc)
{
+ const struct nfs_fs_context *ctx = nfs_fc2context(fc);
struct rpc_timeout timeparms;
struct nfs_client_initdata cl_init = {
.hostname = ctx->nfs_server.hostname,
.addr = (const struct sockaddr *)&ctx->nfs_server.address,
.addrlen = ctx->nfs_server.addrlen,
- .nfs_mod = nfs_mod,
+ .nfs_mod = ctx->nfs_mod,
.proto = ctx->nfs_server.protocol,
- .net = ctx->net,
+ .net = fc->net_ns,
.timeparms = &timeparms,
.cred = server->cred,
.nconnect = ctx->nfs_server.nconnect,
@@ -951,10 +951,10 @@ EXPORT_SYMBOL_GPL(nfs_free_server);
* Create a version 2 or 3 volume record
* - keyed on server and FSID
*/
-struct nfs_server *nfs_create_server(struct nfs_mount_info *mount_info)
+struct nfs_server *nfs_create_server(struct fs_context *fc)
{
+ struct nfs_fs_context *ctx = nfs_fc2context(fc);
struct nfs_server *server;
- struct nfs_subversion *nfs_mod = mount_info->nfs_mod;
struct nfs_fattr *fattr;
int error;
@@ -970,18 +970,18 @@ 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->ctx, nfs_mod);
+ error = nfs_init_server(server, fc);
if (error < 0)
goto error;
/* Probe the root fh to retrieve its FSID */
- error = nfs_probe_fsinfo(server, mount_info->mntfh, fattr);
+ error = nfs_probe_fsinfo(server, ctx->mntfh, fattr);
if (error < 0)
goto error;
if (server->nfs_client->rpc_ops->version == 3) {
if (server->namelen == 0 || server->namelen > NFS3_MAXNAMLEN)
server->namelen = NFS3_MAXNAMLEN;
- if (!(mount_info->ctx->flags & NFS_MOUNT_NORDIRPLUS))
+ if (!(ctx->flags & NFS_MOUNT_NORDIRPLUS))
server->caps |= NFS_CAP_READDIRPLUS;
} else {
if (server->namelen == 0 || server->namelen > NFS2_MAXNAMLEN)
@@ -989,8 +989,8 @@ struct nfs_server *nfs_create_server(struct nfs_mount_info *mount_info)
}
if (!(fattr->valid & NFS_ATTR_FATTR)) {
- error = nfs_mod->rpc_ops->getattr(server, mount_info->mntfh,
- fattr, NULL, NULL);
+ error = ctx->nfs_mod->rpc_ops->getattr(server, ctx->mntfh,
+ fattr, NULL, NULL);
if (error < 0) {
dprintk("nfs_create_server: getattr error = %d\n", -error);
goto error;