]> git.ipfire.org Git - thirdparty/kernel/stable.git/blobdiff - fs/nfs/client.c
NFS: Move nfs_probe_destination() into the generic client
[thirdparty/kernel/stable.git] / fs / nfs / client.c
index 23e165d5ec9cabfe7297f1f5158f73ef6e16f184..e867d9090386433dfaedcb0dda5ff0753d7089d7 100644 (file)
@@ -864,6 +864,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
  */