
From: NeilBrown <neilb@cse.unsw.edu.au>

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>
---

 25-akpm/fs/locks.c          |   20 +-------------------
 25-akpm/fs/nfsd/nfs4state.c |    3 +--
 25-akpm/include/linux/fs.h  |    1 -
 3 files changed, 2 insertions(+), 22 deletions(-)

diff -puN fs/locks.c~nfsd4-eliminate-unnecessary-remove_lease fs/locks.c
--- 25/fs/locks.c~nfsd4-eliminate-unnecessary-remove_lease	2005-03-07 23:56:06.000000000 -0800
+++ 25-akpm/fs/locks.c	2005-03-07 23:56:06.000000000 -0800
@@ -406,7 +406,7 @@ static void lease_release_private_callba
 	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
 	}
 }
 
- /**
-*	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 -puN fs/nfsd/nfs4state.c~nfsd4-eliminate-unnecessary-remove_lease fs/nfsd/nfs4state.c
--- 25/fs/nfsd/nfs4state.c~nfsd4-eliminate-unnecessary-remove_lease	2005-03-07 23:56:06.000000000 -0800
+++ 25-akpm/fs/nfsd/nfs4state.c	2005-03-07 23:56:06.000000000 -0800
@@ -194,7 +194,7 @@ nfs4_close_delegation(struct nfs4_delega
 	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_leas
 };
 
 
-
 /*
  * nfsd4_process_open1()
  * 	lookup stateowner.
diff -puN include/linux/fs.h~nfsd4-eliminate-unnecessary-remove_lease include/linux/fs.h
--- 25/include/linux/fs.h~nfsd4-eliminate-unnecessary-remove_lease	2005-03-07 23:56:06.000000000 -0800
+++ 25-akpm/include/linux/fs.h	2005-03-07 23:56:06.000000000 -0800
@@ -723,7 +723,6 @@ extern int __break_lease(struct inode *i
 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);
_
