nfs41: add a get_clid_cred function to nfs4_state_recovery_ops
authorAndy Adamson <andros@netapp.com>
Wed, 1 Apr 2009 13:22:48 +0000 (09:22 -0400)
committerBenny Halevy <bhalevy@panasas.com>
Wed, 17 Jun 2009 19:25:12 +0000 (12:25 -0700)
EXCHANGE_ID has different credential requirements than SETCLIENTID.
Prepare for a separate credential function.

Signed-off-by: Andy Adamson <andros@netapp.com>
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/nfs4_fs.h
fs/nfs/nfs4proc.c
fs/nfs/nfs4state.c

index df9e363194995739535b16c67a21a70cfbd18985..1da3e354de2265c3e27751fd76fbb57e1d3c38ef 100644 (file)
@@ -179,6 +179,7 @@ struct nfs4_state_recovery_ops {
        int (*recover_open)(struct nfs4_state_owner *, struct nfs4_state *);
        int (*recover_lock)(struct nfs4_state *, struct file_lock *);
        int (*establish_clid)(struct nfs_client *, struct rpc_cred *);
+       struct rpc_cred * (*get_clid_cred)(struct nfs_client *);
 };
 
 struct nfs4_state_maintenance_ops {
index dd46339095cea9aa16614cf0968227ca5938a220..b4e5442efa6c83ce0a3e293f2928e57665af516a 100644 (file)
@@ -4786,6 +4786,7 @@ struct nfs4_state_recovery_ops nfs40_reboot_recovery_ops = {
        .recover_open   = nfs4_open_reclaim,
        .recover_lock   = nfs4_lock_reclaim,
        .establish_clid = nfs4_init_clientid,
+       .get_clid_cred  = nfs4_get_setclientid_cred,
 };
 
 #if defined(CONFIG_NFS_V4_1)
@@ -4804,6 +4805,7 @@ struct nfs4_state_recovery_ops nfs40_nograce_recovery_ops = {
        .recover_open   = nfs4_open_expired,
        .recover_lock   = nfs4_lock_expired,
        .establish_clid = nfs4_init_clientid,
+       .get_clid_cred  = nfs4_get_setclientid_cred,
 };
 
 #if defined(CONFIG_NFS_V4_1)
index e17bd4412174b0be1822ceb591625bd0da8b53e1..90e56072844b5681e225eae39e8b79793de88fa1 100644 (file)
@@ -1102,7 +1102,7 @@ static int nfs4_reclaim_lease(struct nfs_client *clp)
                nfs4_reboot_recovery_ops[clp->cl_minorversion];
        int status = -ENOENT;
 
-       cred = nfs4_get_setclientid_cred(clp);
+       cred = ops->get_clid_cred(clp);
        if (cred != NULL) {
                status = ops->establish_clid(clp, cred);
                put_rpccred(cred);