diff options
-rw-r--r-- | fs/nfsd/nfs4state.c | 22 | ||||
-rw-r--r-- | include/linux/nfsd/state.h | 4 |
2 files changed, 13 insertions, 13 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index f03a4180fa11..a84a80e8c0cf 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c | |||
@@ -153,7 +153,7 @@ alloc_init_deleg(struct nfs4_client *clp, struct nfs4_stateid *stp, struct svc_f | |||
153 | current_fh->fh_handle.fh_size); | 153 | current_fh->fh_handle.fh_size); |
154 | dp->dl_time = 0; | 154 | dp->dl_time = 0; |
155 | atomic_set(&dp->dl_count, 1); | 155 | atomic_set(&dp->dl_count, 1); |
156 | list_add(&dp->dl_del_perfile, &fp->fi_del_perfile); | 156 | list_add(&dp->dl_del_perfile, &fp->fi_delegations); |
157 | list_add(&dp->dl_del_perclnt, &clp->cl_del_perclnt); | 157 | list_add(&dp->dl_del_perclnt, &clp->cl_del_perclnt); |
158 | return dp; | 158 | return dp; |
159 | } | 159 | } |
@@ -954,8 +954,8 @@ alloc_init_file(struct inode *ino) | |||
954 | fp = kmem_cache_alloc(file_slab, GFP_KERNEL); | 954 | fp = kmem_cache_alloc(file_slab, GFP_KERNEL); |
955 | if (fp) { | 955 | if (fp) { |
956 | INIT_LIST_HEAD(&fp->fi_hash); | 956 | INIT_LIST_HEAD(&fp->fi_hash); |
957 | INIT_LIST_HEAD(&fp->fi_perfile); | 957 | INIT_LIST_HEAD(&fp->fi_stateids); |
958 | INIT_LIST_HEAD(&fp->fi_del_perfile); | 958 | INIT_LIST_HEAD(&fp->fi_delegations); |
959 | list_add(&fp->fi_hash, &file_hashtbl[hashval]); | 959 | list_add(&fp->fi_hash, &file_hashtbl[hashval]); |
960 | fp->fi_inode = igrab(ino); | 960 | fp->fi_inode = igrab(ino); |
961 | fp->fi_id = current_fileid++; | 961 | fp->fi_id = current_fileid++; |
@@ -974,7 +974,7 @@ release_all_files(void) | |||
974 | while (!list_empty(&file_hashtbl[i])) { | 974 | while (!list_empty(&file_hashtbl[i])) { |
975 | fp = list_entry(file_hashtbl[i].next, struct nfs4_file, fi_hash); | 975 | fp = list_entry(file_hashtbl[i].next, struct nfs4_file, fi_hash); |
976 | /* this should never be more than once... */ | 976 | /* this should never be more than once... */ |
977 | if (!list_empty(&fp->fi_perfile) || !list_empty(&fp->fi_del_perfile)) { | 977 | if (!list_empty(&fp->fi_stateids) || !list_empty(&fp->fi_delegations)) { |
978 | printk("ERROR: release_all_files: file %p is open, creating dangling state !!!\n",fp); | 978 | printk("ERROR: release_all_files: file %p is open, creating dangling state !!!\n",fp); |
979 | } | 979 | } |
980 | release_file(fp); | 980 | release_file(fp); |
@@ -1139,7 +1139,7 @@ init_stateid(struct nfs4_stateid *stp, struct nfs4_file *fp, struct nfsd4_open * | |||
1139 | INIT_LIST_HEAD(&stp->st_perfile); | 1139 | INIT_LIST_HEAD(&stp->st_perfile); |
1140 | list_add(&stp->st_hash, &stateid_hashtbl[hashval]); | 1140 | list_add(&stp->st_hash, &stateid_hashtbl[hashval]); |
1141 | list_add(&stp->st_perfilestate, &sop->so_perfilestate); | 1141 | list_add(&stp->st_perfilestate, &sop->so_perfilestate); |
1142 | list_add(&stp->st_perfile, &fp->fi_perfile); | 1142 | list_add(&stp->st_perfile, &fp->fi_stateids); |
1143 | stp->st_stateowner = sop; | 1143 | stp->st_stateowner = sop; |
1144 | stp->st_file = fp; | 1144 | stp->st_file = fp; |
1145 | stp->st_stateid.si_boot = boot_time; | 1145 | stp->st_stateid.si_boot = boot_time; |
@@ -1204,7 +1204,7 @@ release_state_owner(struct nfs4_stateid *stp, int flag) | |||
1204 | if (sop->so_confirmed && list_empty(&sop->so_perfilestate)) | 1204 | if (sop->so_confirmed && list_empty(&sop->so_perfilestate)) |
1205 | move_to_close_lru(sop); | 1205 | move_to_close_lru(sop); |
1206 | /* unused nfs4_file's are releseed. XXX slab cache? */ | 1206 | /* unused nfs4_file's are releseed. XXX slab cache? */ |
1207 | if (list_empty(&fp->fi_perfile) && list_empty(&fp->fi_del_perfile)) { | 1207 | if (list_empty(&fp->fi_stateids) && list_empty(&fp->fi_delegations)) { |
1208 | release_file(fp); | 1208 | release_file(fp); |
1209 | } | 1209 | } |
1210 | } | 1210 | } |
@@ -1294,7 +1294,7 @@ nfs4_share_conflict(struct svc_fh *current_fh, unsigned int deny_type) | |||
1294 | fp = find_file(ino); | 1294 | fp = find_file(ino); |
1295 | if (fp) { | 1295 | if (fp) { |
1296 | /* Search for conflicting share reservations */ | 1296 | /* Search for conflicting share reservations */ |
1297 | list_for_each_entry(stp, &fp->fi_perfile, st_perfile) { | 1297 | list_for_each_entry(stp, &fp->fi_stateids, st_perfile) { |
1298 | if (test_bit(deny_type, &stp->st_deny_bmap) || | 1298 | if (test_bit(deny_type, &stp->st_deny_bmap) || |
1299 | test_bit(NFS4_SHARE_DENY_BOTH, &stp->st_deny_bmap)) | 1299 | test_bit(NFS4_SHARE_DENY_BOTH, &stp->st_deny_bmap)) |
1300 | return nfserr_share_denied; | 1300 | return nfserr_share_denied; |
@@ -1545,7 +1545,7 @@ find_delegation_file(struct nfs4_file *fp, stateid_t *stid) | |||
1545 | { | 1545 | { |
1546 | struct nfs4_delegation *dp; | 1546 | struct nfs4_delegation *dp; |
1547 | 1547 | ||
1548 | list_for_each_entry(dp, &fp->fi_del_perfile, dl_del_perfile) { | 1548 | list_for_each_entry(dp, &fp->fi_delegations, dl_del_perfile) { |
1549 | if (dp->dl_stateid.si_stateownerid == stid->si_stateownerid) | 1549 | if (dp->dl_stateid.si_stateownerid == stid->si_stateownerid) |
1550 | return dp; | 1550 | return dp; |
1551 | } | 1551 | } |
@@ -1583,7 +1583,7 @@ nfs4_check_open(struct nfs4_file *fp, struct nfsd4_open *open, struct nfs4_state | |||
1583 | int status = nfserr_share_denied; | 1583 | int status = nfserr_share_denied; |
1584 | struct nfs4_stateowner *sop = open->op_stateowner; | 1584 | struct nfs4_stateowner *sop = open->op_stateowner; |
1585 | 1585 | ||
1586 | list_for_each_entry(local, &fp->fi_perfile, st_perfile) { | 1586 | list_for_each_entry(local, &fp->fi_stateids, st_perfile) { |
1587 | /* ignore lock owners */ | 1587 | /* ignore lock owners */ |
1588 | if (local->st_stateowner->so_is_open_owner == 0) | 1588 | if (local->st_stateowner->so_is_open_owner == 0) |
1589 | continue; | 1589 | continue; |
@@ -1830,7 +1830,7 @@ nfsd4_process_open2(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nf | |||
1830 | stp->st_stateid.si_fileid, stp->st_stateid.si_generation); | 1830 | stp->st_stateid.si_fileid, stp->st_stateid.si_generation); |
1831 | out: | 1831 | out: |
1832 | /* take the opportunity to clean up unused state */ | 1832 | /* take the opportunity to clean up unused state */ |
1833 | if (fp && list_empty(&fp->fi_perfile) && list_empty(&fp->fi_del_perfile)) | 1833 | if (fp && list_empty(&fp->fi_stateids) && list_empty(&fp->fi_delegations)) |
1834 | release_file(fp); | 1834 | release_file(fp); |
1835 | 1835 | ||
1836 | /* CLAIM_PREVIOUS has different error returns */ | 1836 | /* CLAIM_PREVIOUS has different error returns */ |
@@ -2633,7 +2633,7 @@ alloc_init_lock_stateid(struct nfs4_stateowner *sop, struct nfs4_file *fp, struc | |||
2633 | INIT_LIST_HEAD(&stp->st_perfilestate); | 2633 | INIT_LIST_HEAD(&stp->st_perfilestate); |
2634 | INIT_LIST_HEAD(&stp->st_perlockowner); /* not used */ | 2634 | INIT_LIST_HEAD(&stp->st_perlockowner); /* not used */ |
2635 | list_add(&stp->st_hash, &lockstateid_hashtbl[hashval]); | 2635 | list_add(&stp->st_hash, &lockstateid_hashtbl[hashval]); |
2636 | list_add(&stp->st_perfile, &fp->fi_perfile); | 2636 | list_add(&stp->st_perfile, &fp->fi_stateids); |
2637 | list_add(&stp->st_perfilestate, &sop->so_perfilestate); | 2637 | list_add(&stp->st_perfilestate, &sop->so_perfilestate); |
2638 | stp->st_stateowner = sop; | 2638 | stp->st_stateowner = sop; |
2639 | stp->st_file = fp; | 2639 | stp->st_file = fp; |
diff --git a/include/linux/nfsd/state.h b/include/linux/nfsd/state.h index b6b2fe1e7c63..2c3b42674a4c 100644 --- a/include/linux/nfsd/state.h +++ b/include/linux/nfsd/state.h | |||
@@ -218,8 +218,8 @@ struct nfs4_stateowner { | |||
218 | */ | 218 | */ |
219 | struct nfs4_file { | 219 | struct nfs4_file { |
220 | struct list_head fi_hash; /* hash by "struct inode *" */ | 220 | struct list_head fi_hash; /* hash by "struct inode *" */ |
221 | struct list_head fi_perfile; /* list: nfs4_stateid */ | 221 | struct list_head fi_stateids; |
222 | struct list_head fi_del_perfile; /* list: nfs4_delegation */ | 222 | struct list_head fi_delegations; |
223 | struct inode *fi_inode; | 223 | struct inode *fi_inode; |
224 | u32 fi_id; /* used with stateowner->so_id | 224 | u32 fi_id; /* used with stateowner->so_id |
225 | * for stateid_hashtbl hash */ | 225 | * for stateid_hashtbl hash */ |