Commit 4d4cf8d2 authored by Anna Schumaker's avatar Anna Schumaker Committed by Trond Myklebust

NFS: Replace calls to nfs_probe_fsinfo() with nfs_probe_server()

Clean up. There are a few places where we want to probe the server, but
don't actually care about the fsinfo result. Change these to use
nfs_probe_server(), which handles the fattr allocation for us.
Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
parent e5731131
...@@ -1082,7 +1082,6 @@ struct nfs_server *nfs_clone_server(struct nfs_server *source, ...@@ -1082,7 +1082,6 @@ struct nfs_server *nfs_clone_server(struct nfs_server *source,
rpc_authflavor_t flavor) rpc_authflavor_t flavor)
{ {
struct nfs_server *server; struct nfs_server *server;
struct nfs_fattr *fattr_fsinfo;
int error; int error;
server = nfs_alloc_server(); server = nfs_alloc_server();
...@@ -1091,11 +1090,6 @@ struct nfs_server *nfs_clone_server(struct nfs_server *source, ...@@ -1091,11 +1090,6 @@ struct nfs_server *nfs_clone_server(struct nfs_server *source,
server->cred = get_cred(source->cred); server->cred = get_cred(source->cred);
error = -ENOMEM;
fattr_fsinfo = nfs_alloc_fattr();
if (fattr_fsinfo == NULL)
goto out_free_server;
/* Copy data from the source */ /* Copy data from the source */
server->nfs_client = source->nfs_client; server->nfs_client = source->nfs_client;
server->destroy = source->destroy; server->destroy = source->destroy;
...@@ -1111,7 +1105,7 @@ struct nfs_server *nfs_clone_server(struct nfs_server *source, ...@@ -1111,7 +1105,7 @@ struct nfs_server *nfs_clone_server(struct nfs_server *source,
goto out_free_server; goto out_free_server;
/* probe the filesystem info for this server filesystem */ /* probe the filesystem info for this server filesystem */
error = nfs_probe_fsinfo(server, fh, fattr_fsinfo); error = nfs_probe_server(server, fh);
if (error < 0) if (error < 0)
goto out_free_server; goto out_free_server;
...@@ -1125,11 +1119,9 @@ struct nfs_server *nfs_clone_server(struct nfs_server *source, ...@@ -1125,11 +1119,9 @@ struct nfs_server *nfs_clone_server(struct nfs_server *source,
nfs_server_insert_lists(server); nfs_server_insert_lists(server);
server->mount_time = jiffies; server->mount_time = jiffies;
nfs_free_fattr(fattr_fsinfo);
return server; return server;
out_free_server: out_free_server:
nfs_free_fattr(fattr_fsinfo);
nfs_free_server(server); nfs_free_server(server);
return ERR_PTR(error); return ERR_PTR(error);
} }
......
...@@ -1080,17 +1080,12 @@ void nfs4_server_set_init_caps(struct nfs_server *server) ...@@ -1080,17 +1080,12 @@ void nfs4_server_set_init_caps(struct nfs_server *server)
static int nfs4_server_common_setup(struct nfs_server *server, static int nfs4_server_common_setup(struct nfs_server *server,
struct nfs_fh *mntfh, bool auth_probe) struct nfs_fh *mntfh, bool auth_probe)
{ {
struct nfs_fattr *fattr;
int error; int error;
/* data servers support only a subset of NFSv4.1 */ /* data servers support only a subset of NFSv4.1 */
if (is_ds_only_client(server->nfs_client)) if (is_ds_only_client(server->nfs_client))
return -EPROTONOSUPPORT; return -EPROTONOSUPPORT;
fattr = nfs_alloc_fattr();
if (fattr == NULL)
return -ENOMEM;
/* We must ensure the session is initialised first */ /* We must ensure the session is initialised first */
error = nfs4_init_session(server->nfs_client); error = nfs4_init_session(server->nfs_client);
if (error < 0) if (error < 0)
...@@ -1108,7 +1103,7 @@ static int nfs4_server_common_setup(struct nfs_server *server, ...@@ -1108,7 +1103,7 @@ static int nfs4_server_common_setup(struct nfs_server *server,
(unsigned long long) server->fsid.minor); (unsigned long long) server->fsid.minor);
nfs_display_fhandle(mntfh, "Pseudo-fs root FH"); nfs_display_fhandle(mntfh, "Pseudo-fs root FH");
error = nfs_probe_fsinfo(server, mntfh, fattr); error = nfs_probe_server(server, mntfh);
if (error < 0) if (error < 0)
goto out; goto out;
...@@ -1122,7 +1117,6 @@ static int nfs4_server_common_setup(struct nfs_server *server, ...@@ -1122,7 +1117,6 @@ static int nfs4_server_common_setup(struct nfs_server *server,
server->mount_time = jiffies; server->mount_time = jiffies;
server->destroy = nfs4_destroy_server; server->destroy = nfs4_destroy_server;
out: out:
nfs_free_fattr(fattr);
return error; return error;
} }
......
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