NFS: Introduce a vector of migration recovery ops
[linux-2.6-block.git] / fs / nfs / nfs4_fs.h
index f520a1113b38b53e6eeb4ec589f75bb401d03d95..4f48000b2b97a910ec40900d71f8458d6fb0217d 100644 (file)
@@ -50,6 +50,7 @@ struct nfs4_minor_version_ops {
        const struct nfs4_state_recovery_ops *reboot_recovery_ops;
        const struct nfs4_state_recovery_ops *nograce_recovery_ops;
        const struct nfs4_state_maintenance_ops *state_renewal_ops;
+       const struct nfs4_mig_recovery_ops *mig_recovery_ops;
 };
 
 #define NFS_SEQID_CONFIRMED 1
@@ -203,6 +204,9 @@ struct nfs4_state_maintenance_ops {
        int (*renew_lease)(struct nfs_client *, struct rpc_cred *);
 };
 
+struct nfs4_mig_recovery_ops {
+};
+
 extern const struct dentry_operations nfs4_dentry_operations;
 
 /* dir.c */
@@ -217,6 +221,8 @@ rpc_authflavor_t nfs_find_best_sec(struct nfs4_secinfo_flavors *);
 struct rpc_clnt *nfs4_create_sec_client(struct rpc_clnt *, struct inode *, struct qstr *);
 struct vfsmount *nfs4_submount(struct nfs_server *, struct dentry *,
                               struct nfs_fh *, struct nfs_fattr *);
+int nfs4_replace_transport(struct nfs_server *server,
+                               const struct nfs4_fs_locations *locations);
 
 /* nfs4proc.c */
 extern int nfs4_proc_setclientid(struct nfs_client *, u32, unsigned short, struct rpc_cred *, struct nfs4_setclientid_res *);
@@ -279,15 +285,15 @@ _nfs4_state_protect(struct nfs_client *clp, unsigned long sp4_mode,
        if (test_bit(sp4_mode, &clp->cl_sp4_flags)) {
                spin_lock(&clp->cl_lock);
                if (clp->cl_machine_cred != NULL)
-                       newcred = get_rpccred(clp->cl_machine_cred);
+                       /* don't call get_rpccred on the machine cred -
+                        * a reference will be held for life of clp */
+                       newcred = clp->cl_machine_cred;
                spin_unlock(&clp->cl_lock);
-               if (msg->rpc_cred)
-                       put_rpccred(msg->rpc_cred);
                msg->rpc_cred = newcred;
 
                flavor = clp->cl_rpcclient->cl_auth->au_flavor;
-               WARN_ON(flavor != RPC_AUTH_GSS_KRB5I &&
-                       flavor != RPC_AUTH_GSS_KRB5P);
+               WARN_ON_ONCE(flavor != RPC_AUTH_GSS_KRB5I &&
+                            flavor != RPC_AUTH_GSS_KRB5P);
                *clntp = clp->cl_rpcclient;
 
                return true;