Commit 9df0b297 authored by Neil Brown's avatar Neil Brown Committed by Linus Torvalds

[PATCH] nfsd4: reorganize release_deleg

Just separate part of release_deleg into a separate function.
Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: default avatarNeil Brown <neilb@cse.unsw.edu.au>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 4b9d4d3c
......@@ -80,7 +80,6 @@ u32 free_delegation= 0;
/* forward declarations */
struct nfs4_stateid * find_stateid(stateid_t *stid, int flags);
static struct nfs4_delegation * find_delegation_stateid(struct inode *ino, stateid_t *stid);
static void release_delegation(struct nfs4_delegation *dp);
static void release_stateid_lockowners(struct nfs4_stateid *open_stp);
/* Locking:
......@@ -196,20 +195,27 @@ nfs4_put_delegation(struct nfs4_delegation *dp)
* Called with the recall_lock held.
*/
static void
nfs4_close_delegation(struct nfs4_delegation *dp)
{
struct file *filp = dp->dl_stp->st_vfs_file;
dprintk("NFSD: close_delegation dp %p\n",dp);
release_stateid_lockowners(dp->dl_stp);
kfree(dp->dl_stp);
dp->dl_stp = NULL;
atomic_set(&dp->dl_state, NFS4_RECALL_COMPLETE);
nfsd_close(filp);
vfsclose++;
}
/* Called under the state lock. */
static void
release_delegation(struct nfs4_delegation *dp)
{
/* delayed nfsd_close */
if (dp->dl_stp) {
struct file *filp = dp->dl_stp->st_vfs_file;
dprintk("NFSD: release_delegation CLOSE\n");
release_stateid_lockowners(dp->dl_stp);
kfree(dp->dl_stp);
dp->dl_stp = NULL;
atomic_set(&dp->dl_state, NFS4_RECALL_COMPLETE);
nfsd_close(filp);
vfsclose++;
if (dp->dl_stp)
nfs4_close_delegation(dp);
} else {
dprintk("NFSD: release_delegation remove lease dl_flock %p\n",
dp->dl_flock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment