diff options
author | Anna Schumaker <Anna.Schumaker@Netapp.com> | 2021-10-14 13:55:05 -0400 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@hammerspace.com> | 2021-10-20 18:09:54 -0400 |
commit | e5731131fb6fefaa69064ca511b7c4971d6cf54f (patch) | |
tree | 0bf83f6d8fea2aecab642e75633f9903f6b6756c /fs/nfs/client.c | |
parent | 01dde76e471229e3437a2686c572f4980b2c483e (diff) | |
download | lwn-e5731131fb6fefaa69064ca511b7c4971d6cf54f.tar.gz lwn-e5731131fb6fefaa69064ca511b7c4971d6cf54f.zip |
NFS: Move nfs_probe_destination() into the generic client
And rename it to nfs_probe_server(). I also change it to take the nfs_fh
as an argument so callers can choose what filehandle to probe.
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Diffstat (limited to 'fs/nfs/client.c')
-rw-r--r-- | fs/nfs/client.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/fs/nfs/client.c b/fs/nfs/client.c index 23e165d5ec9c..e867d9090386 100644 --- a/fs/nfs/client.c +++ b/fs/nfs/client.c @@ -865,6 +865,30 @@ int nfs_probe_fsinfo(struct nfs_server *server, struct nfs_fh *mntfh, struct nfs EXPORT_SYMBOL_GPL(nfs_probe_fsinfo); /* + * Grab the destination's particulars, including lease expiry time. + * + * Returns zero if probe succeeded and retrieved FSID matches the FSID + * we have cached. + */ +int nfs_probe_server(struct nfs_server *server, struct nfs_fh *mntfh) +{ + struct nfs_fattr *fattr; + int error; + + fattr = nfs_alloc_fattr(); + if (fattr == NULL) + return -ENOMEM; + + /* Sanity: the probe won't work if the destination server + * does not recognize the migrated FH. */ + error = nfs_probe_fsinfo(server, mntfh, fattr); + + nfs_free_fattr(fattr); + return error; +} +EXPORT_SYMBOL_GPL(nfs_probe_server); + +/* * Copy useful information when duplicating a server record */ void nfs_server_copy_userdata(struct nfs_server *target, struct nfs_server *source) |