summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Brown <neilb@cse.unsw.edu.au>2005-03-09 16:55:11 -0800
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-03-09 16:55:11 -0800
commit68ffd8bac84eef541a1b400e06d61fc0b3371ef3 (patch)
tree1a76f6c395f15ebb31f09055124c154023819b17
parent9df0b29705dd7afa4758cace561f7024e9d7c8da (diff)
[PATCH] nfsd4: store-file-with-deleg
The only reason we're keeping a pointer to the stateid in the delegation is so we can get at st_vfs_file. So we should just keep a pointer to the struct file instead. 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>
-rw-r--r--fs/nfsd/nfs4state.c15
-rw-r--r--include/linux/nfsd/state.h2
2 files changed, 8 insertions, 9 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index e08b82a5e9b3..a672601dc6b4 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -145,7 +145,7 @@ alloc_init_deleg(struct nfs4_client *clp, struct nfs4_stateid *stp, struct svc_f
dp->dl_client = clp;
dp->dl_file = fp;
dp->dl_flock = NULL;
- dp->dl_stp = NULL;
+ dp->dl_vfs_file = NULL;
dp->dl_type = type;
dp->dl_recall.cbr_dp = NULL;
dp->dl_recall.cbr_ident = cb->cb_ident;
@@ -198,12 +198,10 @@ nfs4_put_delegation(struct nfs4_delegation *dp)
static void
nfs4_close_delegation(struct nfs4_delegation *dp)
{
- struct file *filp = dp->dl_stp->st_vfs_file;
+ struct file *filp = dp->dl_vfs_file;
dprintk("NFSD: close_delegation dp %p\n",dp);
- release_stateid_lockowners(dp->dl_stp);
- kfree(dp->dl_stp);
- dp->dl_stp = NULL;
+ dp->dl_vfs_file = NULL;
atomic_set(&dp->dl_state, NFS4_RECALL_COMPLETE);
nfsd_close(filp);
vfsclose++;
@@ -214,9 +212,9 @@ static void
release_delegation(struct nfs4_delegation *dp)
{
/* delayed nfsd_close */
- if (dp->dl_stp)
+ if (dp->dl_vfs_file)
nfs4_close_delegation(dp);
- } else {
+ else {
dprintk("NFSD: release_delegation remove lease dl_flock %p\n",
dp->dl_flock);
remove_lease(dp->dl_flock);
@@ -1174,7 +1172,8 @@ release_stateid(struct nfs4_stateid *stp, int flags)
list_for_each_entry(dp, &fp->fi_del_perfile, dl_del_perfile) {
if(cmp_clid(&dp->dl_client->cl_clientid,
&stp->st_stateowner->so_client->cl_clientid)) {
- dp->dl_stp = stp;
+ dp->dl_vfs_file = stp->st_vfs_file;
+ release_stateid_lockowners(stp);
return;
}
}
diff --git a/include/linux/nfsd/state.h b/include/linux/nfsd/state.h
index c7eb2bf2bc81..0b079c435194 100644
--- a/include/linux/nfsd/state.h
+++ b/include/linux/nfsd/state.h
@@ -91,7 +91,7 @@ struct nfs4_delegation {
struct nfs4_client *dl_client;
struct nfs4_file *dl_file;
struct file_lock *dl_flock;
- struct nfs4_stateid *dl_stp;
+ struct file *dl_vfs_file;
u32 dl_type;
time_t dl_time;
struct nfs4_cb_recall dl_recall;