Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 231158
b: refs/heads/master
c: c84d500
h: refs/heads/master
v: v3
  • Loading branch information
J. Bruce Fields committed Jan 4, 2011
1 parent 8e9efaa commit b93fe7b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e63eb9375089f9d2041305d04c3f33a194e0e014
refs/heads/master: c84d500bc41658165ceb0dd04dc6a75249940fba
10 changes: 5 additions & 5 deletions trunk/fs/nfsd/nfs4state.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,8 @@ alloc_init_deleg(struct nfs4_client *clp, struct nfs4_stateid *stp, struct svc_f
dp->dl_client = clp;
get_nfs4_file(fp);
dp->dl_file = fp;
nfs4_file_get_access(fp, O_RDONLY);
dp->dl_vfs_file = find_readable_file(fp);
get_file(dp->dl_vfs_file);
dp->dl_flock = NULL;
dp->dl_type = type;
dp->dl_stateid.si_boot = boot_time;
Expand All @@ -252,6 +253,7 @@ nfs4_put_delegation(struct nfs4_delegation *dp)
if (atomic_dec_and_test(&dp->dl_count)) {
dprintk("NFSD: freeing dp %p\n",dp);
put_nfs4_file(dp->dl_file);
fput(dp->dl_vfs_file);
kmem_cache_free(deleg_slab, dp);
num_delegations--;
}
Expand All @@ -265,12 +267,10 @@ nfs4_put_delegation(struct nfs4_delegation *dp)
static void
nfs4_close_delegation(struct nfs4_delegation *dp)
{
struct file *filp = find_readable_file(dp->dl_file);

dprintk("NFSD: close_delegation dp %p\n",dp);
/* XXX: do we even need this check?: */
if (dp->dl_flock)
vfs_setlease(filp, F_UNLCK, &dp->dl_flock);
nfs4_file_put_access(dp->dl_file, O_RDONLY);
vfs_setlease(dp->dl_vfs_file, F_UNLCK, &dp->dl_flock);
}

/* Called under the state lock. */
Expand Down
1 change: 1 addition & 0 deletions trunk/fs/nfsd/state.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ struct nfs4_delegation {
atomic_t dl_count; /* ref count */
struct nfs4_client *dl_client;
struct nfs4_file *dl_file;
struct file *dl_vfs_file;
struct file_lock *dl_flock;
u32 dl_type;
time_t dl_time;
Expand Down

0 comments on commit b93fe7b

Please sign in to comment.