aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@citi.umich.edu>2009-01-11 14:37:31 -0500
committerJ. Bruce Fields <bfields@citi.umich.edu>2009-03-18 17:30:47 -0400
commitf1d110caf7d759eae2c02c84343f63d83db9b9be (patch)
treefa1b99d4f37f8b0bbce56d220ad3dcba56af262a /fs
parent2283963f27fdd56b185e49a964c290130c7c95ab (diff)
nfsd4: remove a forward declaration
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfsd/nfs4state.c85
1 files changed, 42 insertions, 43 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index e83b3c865aa3..6ab30772496e 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -75,7 +75,6 @@ static stateid_t onestateid; /* bits all 1 */
75/* forward declarations */ 75/* forward declarations */
76static struct nfs4_stateid * find_stateid(stateid_t *stid, int flags); 76static struct nfs4_stateid * find_stateid(stateid_t *stid, int flags);
77static struct nfs4_delegation * find_delegation_stateid(struct inode *ino, stateid_t *stid); 77static struct nfs4_delegation * find_delegation_stateid(struct inode *ino, stateid_t *stid);
78static void release_stateid_lockowners(struct nfs4_stateid *open_stp);
79static char user_recovery_dirname[PATH_MAX] = "/var/lib/nfs/v4recovery"; 78static char user_recovery_dirname[PATH_MAX] = "/var/lib/nfs/v4recovery";
80static void nfs4_set_recdir(char *recdir); 79static void nfs4_set_recdir(char *recdir);
81 80
@@ -330,6 +329,20 @@ static void release_lock_stateid(struct nfs4_stateid *stp)
330 free_generic_stateid(stp); 329 free_generic_stateid(stp);
331} 330}
332 331
332static void
333release_stateid_lockowners(struct nfs4_stateid *open_stp)
334{
335 struct nfs4_stateowner *lock_sop;
336
337 while (!list_empty(&open_stp->st_lockowners)) {
338 lock_sop = list_entry(open_stp->st_lockowners.next,
339 struct nfs4_stateowner, so_perstateid);
340 /* list_del(&open_stp->st_lockowners); */
341 BUG_ON(lock_sop->so_is_open_owner);
342 release_stateowner(lock_sop);
343 }
344}
345
333static void release_open_stateid(struct nfs4_stateid *stp) 346static void release_open_stateid(struct nfs4_stateid *stp)
334{ 347{
335 unhash_generic_stateid(stp); 348 unhash_generic_stateid(stp);
@@ -338,6 +351,34 @@ static void release_open_stateid(struct nfs4_stateid *stp)
338 free_generic_stateid(stp); 351 free_generic_stateid(stp);
339} 352}
340 353
354static void
355unhash_stateowner(struct nfs4_stateowner *sop)
356{
357 struct nfs4_stateid *stp;
358
359 list_del(&sop->so_idhash);
360 list_del(&sop->so_strhash);
361 if (sop->so_is_open_owner)
362 list_del(&sop->so_perclient);
363 list_del(&sop->so_perstateid);
364 while (!list_empty(&sop->so_stateids)) {
365 stp = list_entry(sop->so_stateids.next,
366 struct nfs4_stateid, st_perstateowner);
367 if (sop->so_is_open_owner)
368 release_open_stateid(stp);
369 else
370 release_lock_stateid(stp);
371 }
372}
373
374static void
375release_stateowner(struct nfs4_stateowner *sop)
376{
377 unhash_stateowner(sop);
378 list_del(&sop->so_close_lru);
379 nfs4_put_stateowner(sop);
380}
381
341static inline void 382static inline void
342renew_client(struct nfs4_client *clp) 383renew_client(struct nfs4_client *clp)
343{ 384{
@@ -1064,48 +1105,6 @@ alloc_init_open_stateowner(unsigned int strhashval, struct nfs4_client *clp, str
1064 return sop; 1105 return sop;
1065} 1106}
1066 1107
1067static void
1068release_stateid_lockowners(struct nfs4_stateid *open_stp)
1069{
1070 struct nfs4_stateowner *lock_sop;
1071
1072 while (!list_empty(&open_stp->st_lockowners)) {
1073 lock_sop = list_entry(open_stp->st_lockowners.next,
1074 struct nfs4_stateowner, so_perstateid);
1075 /* list_del(&open_stp->st_lockowners); */
1076 BUG_ON(lock_sop->so_is_open_owner);
1077 release_stateowner(lock_sop);
1078 }
1079}
1080
1081static void
1082unhash_stateowner(struct nfs4_stateowner *sop)
1083{
1084 struct nfs4_stateid *stp;
1085
1086 list_del(&sop->so_idhash);
1087 list_del(&sop->so_strhash);
1088 if (sop->so_is_open_owner)
1089 list_del(&sop->so_perclient);
1090 list_del(&sop->so_perstateid);
1091 while (!list_empty(&sop->so_stateids)) {
1092 stp = list_entry(sop->so_stateids.next,
1093 struct nfs4_stateid, st_perstateowner);
1094 if (sop->so_is_open_owner)
1095 release_open_stateid(stp);
1096 else
1097 release_lock_stateid(stp);
1098 }
1099}
1100
1101static void
1102release_stateowner(struct nfs4_stateowner *sop)
1103{
1104 unhash_stateowner(sop);
1105 list_del(&sop->so_close_lru);
1106 nfs4_put_stateowner(sop);
1107}
1108
1109static inline void 1108static inline void
1110init_stateid(struct nfs4_stateid *stp, struct nfs4_file *fp, struct nfsd4_open *open) { 1109init_stateid(struct nfs4_stateid *stp, struct nfs4_file *fp, struct nfsd4_open *open) {
1111 struct nfs4_stateowner *sop = open->op_stateowner; 1110 struct nfs4_stateowner *sop = open->op_stateowner;