diff options
| author | Neil Brown <neilb@cse.unsw.edu.au> | 2005-03-09 16:57:36 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-03-09 16:57:36 -0800 |
| commit | bbc42ec016d95f1b4e9240ab98539dc5c864c044 (patch) | |
| tree | bad8150081d600a41c18c7cee5c0f438bffd4769 | |
| parent | 690589732d253ffbfef15bb4262a47616cc027a6 (diff) | |
[PATCH] nfsd4: eliminate unnecessary remove_lease
Get rid of remove_lease, use setlease() with F_UNLCK
Signed-off-by: Andy Adamson <andros@citi.umich.edu>
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/locks.c | 20 | ||||
| -rw-r--r-- | fs/nfsd/nfs4state.c | 3 | ||||
| -rw-r--r-- | include/linux/fs.h | 1 |
3 files changed, 2 insertions, 22 deletions
diff --git a/fs/locks.c b/fs/locks.c index 6c98818efa3a..80c58d97b84c 100644 --- a/fs/locks.c +++ b/fs/locks.c @@ -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 diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index d5e40315c722..945328d7c3a2 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -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. diff --git a/include/linux/fs.h b/include/linux/fs.h index c54298dd3b06..59891f8a049b 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -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); |
