aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfs4state.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@cse.unsw.edu.au>2005-06-24 01:04:30 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-24 03:06:36 -0400
commitc7b9a45927e74c81d6562153f7fde9d32da00159 (patch)
treed21fb5d43052bce7469c168d1ad485c821a42079 /fs/nfsd/nfs4state.c
parent190e4fbf96037e5e526ba3210f2bcc2a3b6fe964 (diff)
[PATCH] knfsd: nfsd4: reboot recovery
This patch adds the code to create and remove client subdirectories from the recovery directory, as described in the previous patch comment. Signed-off-by: Andy Adamson <andros@citi.umich.edu> Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/nfsd/nfs4state.c')
-rw-r--r--fs/nfsd/nfs4state.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 6b9d23c39afe..6cca358cd650 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -905,6 +905,7 @@ nfsd4_setclientid_confirm(struct svc_rqst *rqstp, struct nfsd4_setclientid_confi
905 conf = find_confirmed_client_by_str(unconf->cl_recdir, 905 conf = find_confirmed_client_by_str(unconf->cl_recdir,
906 hash); 906 hash);
907 if (conf) { 907 if (conf) {
908 nfsd4_remove_clid_dir(conf);
908 expire_client(conf); 909 expire_client(conf);
909 } 910 }
910 move_to_confirmed(unconf); 911 move_to_confirmed(unconf);
@@ -1691,6 +1692,7 @@ nfs4_set_claim_prev(struct nfsd4_open *open, int *status)
1691 *status = nfserr_reclaim_bad; 1692 *status = nfserr_reclaim_bad;
1692 else { 1693 else {
1693 open->op_stateowner->so_confirmed = 1; 1694 open->op_stateowner->so_confirmed = 1;
1695 open->op_stateowner->so_client->cl_firststate = 1;
1694 open->op_stateowner->so_seqid--; 1696 open->op_stateowner->so_seqid--;
1695 } 1697 }
1696 } 1698 }
@@ -1903,6 +1905,7 @@ static void
1903end_grace(void) 1905end_grace(void)
1904{ 1906{
1905 dprintk("NFSD: end of grace period\n"); 1907 dprintk("NFSD: end of grace period\n");
1908 nfsd4_recdir_purge_old();
1906 in_grace = 0; 1909 in_grace = 0;
1907} 1910}
1908 1911
@@ -1932,6 +1935,7 @@ nfs4_laundromat(void)
1932 } 1935 }
1933 dprintk("NFSD: purging unused client (clientid %08x)\n", 1936 dprintk("NFSD: purging unused client (clientid %08x)\n",
1934 clp->cl_clientid.cl_id); 1937 clp->cl_clientid.cl_id);
1938 nfsd4_remove_clid_dir(clp);
1935 expire_client(clp); 1939 expire_client(clp);
1936 } 1940 }
1937 INIT_LIST_HEAD(&reaplist); 1941 INIT_LIST_HEAD(&reaplist);
@@ -2320,6 +2324,8 @@ nfsd4_open_confirm(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfs
2320 stp->st_stateid.si_stateownerid, 2324 stp->st_stateid.si_stateownerid,
2321 stp->st_stateid.si_fileid, 2325 stp->st_stateid.si_fileid,
2322 stp->st_stateid.si_generation); 2326 stp->st_stateid.si_generation);
2327
2328 nfsd4_create_clid_dir(sop->so_client);
2323out: 2329out:
2324 if (oc->oc_stateowner) 2330 if (oc->oc_stateowner)
2325 nfs4_get_stateowner(oc->oc_stateowner); 2331 nfs4_get_stateowner(oc->oc_stateowner);
@@ -3089,6 +3095,16 @@ alloc_reclaim(void)
3089 return kmalloc(sizeof(struct nfs4_client_reclaim), GFP_KERNEL); 3095 return kmalloc(sizeof(struct nfs4_client_reclaim), GFP_KERNEL);
3090} 3096}
3091 3097
3098int
3099nfs4_has_reclaimed_state(const char *name)
3100{
3101 unsigned int strhashval = clientstr_hashval(name);
3102 struct nfs4_client *clp;
3103
3104 clp = find_confirmed_client_by_str(name, strhashval);
3105 return clp ? 1 : 0;
3106}
3107
3092/* 3108/*
3093 * failure => all reset bets are off, nfserr_no_grace... 3109 * failure => all reset bets are off, nfserr_no_grace...
3094 */ 3110 */