Commit bbc42ec0 authored by Neil Brown's avatar Neil Brown Committed by Linus Torvalds

[PATCH] nfsd4: eliminate unnecessary remove_lease

Get rid of remove_lease, use setlease() with F_UNLCK
Signed-off-by: default avatarAndy Adamson <andros@citi.umich.edu>
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 69058973
......@@ -406,7 +406,7 @@ static void lease_release_private_callback(struct file_lock *fl)
fl->fl_file->f_owner.signum = 0;
}
static int lease_mylease_callback(struct file_lock *fl, struct file_lock *try)
int lease_mylease_callback(struct file_lock *fl, struct file_lock *try)
{
return fl->fl_file == try->fl_file;
}
......@@ -1099,24 +1099,6 @@ static void time_out_leases(struct inode *inode)
}
}
/**
* remove_lease - let time_out_leases remove the lease.
* @@file_lock: the lease to remove
*/
void remove_lease(struct file_lock *fl)
{
lock_kernel();
if (!fl || !IS_LEASE(fl))
goto out;
fl->fl_type = F_UNLCK | F_INPROGRESS;
fl->fl_break_time = jiffies - 10;
time_out_leases(fl->fl_file->f_dentry->d_inode);
out:
unlock_kernel();
}
EXPORT_SYMBOL(remove_lease);
/**
* __break_lease - revoke all outstanding leases on file
* @inode: the inode of the file to return
......
......@@ -194,7 +194,7 @@ nfs4_close_delegation(struct nfs4_delegation *dp)
dp->dl_vfs_file = NULL;
/* The following nfsd_close may not actually close the file,
* but we want to remove the lease in any case. */
remove_lease(dp->dl_flock);
setlease(filp, F_UNLCK, &dp->dl_flock);
nfsd_close(filp);
vfsclose++;
}
......@@ -1438,7 +1438,6 @@ struct lock_manager_operations nfsd_lease_mng_ops = {
};
/*
* nfsd4_process_open1()
* lookup stateowner.
......
......@@ -718,7 +718,6 @@ extern int __break_lease(struct inode *inode, unsigned int flags);
extern void lease_get_mtime(struct inode *, struct timespec *time);
extern int setlease(struct file *, long, struct file_lock **);
extern int lease_modify(struct file_lock **, int);
extern void remove_lease(struct file_lock *);
extern int lock_may_read(struct inode *, loff_t start, unsigned long count);
extern int lock_may_write(struct inode *, loff_t start, unsigned long count);
extern void steal_locks(fl_owner_t from);
......
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