diff options
-rw-r--r-- | fs/locks.c | 15 | ||||
-rw-r--r-- | fs/nfsd/nfs4state.c | 10 | ||||
-rw-r--r-- | include/linux/fs.h | 2 |
3 files changed, 13 insertions, 14 deletions
diff --git a/fs/locks.c b/fs/locks.c index 0e5873b0be54..a65d85c1fdc2 100644 --- a/fs/locks.c +++ b/fs/locks.c | |||
@@ -1326,7 +1326,7 @@ int fcntl_getlease(struct file *filp) | |||
1326 | } | 1326 | } |
1327 | 1327 | ||
1328 | /** | 1328 | /** |
1329 | * __setlease - sets a lease on an open file | 1329 | * setlease - sets a lease on an open file |
1330 | * @filp: file pointer | 1330 | * @filp: file pointer |
1331 | * @arg: type of lease to obtain | 1331 | * @arg: type of lease to obtain |
1332 | * @flp: input - file_lock to use, output - file_lock inserted | 1332 | * @flp: input - file_lock to use, output - file_lock inserted |
@@ -1336,7 +1336,7 @@ int fcntl_getlease(struct file *filp) | |||
1336 | * | 1336 | * |
1337 | * Called with kernel lock held. | 1337 | * Called with kernel lock held. |
1338 | */ | 1338 | */ |
1339 | static int __setlease(struct file *filp, long arg, struct file_lock **flp) | 1339 | static int setlease(struct file *filp, long arg, struct file_lock **flp) |
1340 | { | 1340 | { |
1341 | struct file_lock *fl, **before, **my_before = NULL, *lease; | 1341 | struct file_lock *fl, **before, **my_before = NULL, *lease; |
1342 | struct dentry *dentry = filp->f_path.dentry; | 1342 | struct dentry *dentry = filp->f_path.dentry; |
@@ -1423,7 +1423,7 @@ out: | |||
1423 | } | 1423 | } |
1424 | 1424 | ||
1425 | /** | 1425 | /** |
1426 | * setlease - sets a lease on an open file | 1426 | * vfs_setlease - sets a lease on an open file |
1427 | * @filp: file pointer | 1427 | * @filp: file pointer |
1428 | * @arg: type of lease to obtain | 1428 | * @arg: type of lease to obtain |
1429 | * @lease: file_lock to use | 1429 | * @lease: file_lock to use |
@@ -1432,18 +1432,17 @@ out: | |||
1432 | * The fl_lmops fl_break function is required by break_lease | 1432 | * The fl_lmops fl_break function is required by break_lease |
1433 | */ | 1433 | */ |
1434 | 1434 | ||
1435 | int setlease(struct file *filp, long arg, struct file_lock **lease) | 1435 | int vfs_setlease(struct file *filp, long arg, struct file_lock **lease) |
1436 | { | 1436 | { |
1437 | int error; | 1437 | int error; |
1438 | 1438 | ||
1439 | lock_kernel(); | 1439 | lock_kernel(); |
1440 | error = __setlease(filp, arg, lease); | 1440 | error = setlease(filp, arg, lease); |
1441 | unlock_kernel(); | 1441 | unlock_kernel(); |
1442 | 1442 | ||
1443 | return error; | 1443 | return error; |
1444 | } | 1444 | } |
1445 | 1445 | EXPORT_SYMBOL_GPL(vfs_setlease); | |
1446 | EXPORT_SYMBOL(setlease); | ||
1447 | 1446 | ||
1448 | /** | 1447 | /** |
1449 | * fcntl_setlease - sets a lease on an open file | 1448 | * fcntl_setlease - sets a lease on an open file |
@@ -1469,7 +1468,7 @@ int fcntl_setlease(unsigned int fd, struct file *filp, long arg) | |||
1469 | 1468 | ||
1470 | lock_kernel(); | 1469 | lock_kernel(); |
1471 | 1470 | ||
1472 | error = __setlease(filp, arg, &flp); | 1471 | error = vfs_setlease(filp, arg, &flp); |
1473 | if (error || arg == F_UNLCK) | 1472 | if (error || arg == F_UNLCK) |
1474 | goto out_unlock; | 1473 | goto out_unlock; |
1475 | 1474 | ||
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index e4a4c87ec8c6..6284807bd37e 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c | |||
@@ -256,7 +256,7 @@ nfs4_close_delegation(struct nfs4_delegation *dp) | |||
256 | /* The following nfsd_close may not actually close the file, | 256 | /* The following nfsd_close may not actually close the file, |
257 | * but we want to remove the lease in any case. */ | 257 | * but we want to remove the lease in any case. */ |
258 | if (dp->dl_flock) | 258 | if (dp->dl_flock) |
259 | setlease(filp, F_UNLCK, &dp->dl_flock); | 259 | vfs_setlease(filp, F_UNLCK, &dp->dl_flock); |
260 | nfsd_close(filp); | 260 | nfsd_close(filp); |
261 | } | 261 | } |
262 | 262 | ||
@@ -1402,7 +1402,7 @@ void nfsd_release_deleg_cb(struct file_lock *fl) | |||
1402 | /* | 1402 | /* |
1403 | * Set the delegation file_lock back pointer. | 1403 | * Set the delegation file_lock back pointer. |
1404 | * | 1404 | * |
1405 | * Called from __setlease() with lock_kernel() held. | 1405 | * Called from setlease() with lock_kernel() held. |
1406 | */ | 1406 | */ |
1407 | static | 1407 | static |
1408 | void nfsd_copy_lock_deleg_cb(struct file_lock *new, struct file_lock *fl) | 1408 | void nfsd_copy_lock_deleg_cb(struct file_lock *new, struct file_lock *fl) |
@@ -1416,7 +1416,7 @@ void nfsd_copy_lock_deleg_cb(struct file_lock *new, struct file_lock *fl) | |||
1416 | } | 1416 | } |
1417 | 1417 | ||
1418 | /* | 1418 | /* |
1419 | * Called from __setlease() with lock_kernel() held | 1419 | * Called from setlease() with lock_kernel() held |
1420 | */ | 1420 | */ |
1421 | static | 1421 | static |
1422 | int nfsd_same_client_deleg_cb(struct file_lock *onlist, struct file_lock *try) | 1422 | int nfsd_same_client_deleg_cb(struct file_lock *onlist, struct file_lock *try) |
@@ -1716,10 +1716,10 @@ nfs4_open_delegation(struct svc_fh *fh, struct nfsd4_open *open, struct nfs4_sta | |||
1716 | fl.fl_file = stp->st_vfs_file; | 1716 | fl.fl_file = stp->st_vfs_file; |
1717 | fl.fl_pid = current->tgid; | 1717 | fl.fl_pid = current->tgid; |
1718 | 1718 | ||
1719 | /* setlease checks to see if delegation should be handed out. | 1719 | /* vfs_setlease checks to see if delegation should be handed out. |
1720 | * the lock_manager callbacks fl_mylease and fl_change are used | 1720 | * the lock_manager callbacks fl_mylease and fl_change are used |
1721 | */ | 1721 | */ |
1722 | if ((status = setlease(stp->st_vfs_file, | 1722 | if ((status = vfs_setlease(stp->st_vfs_file, |
1723 | flag == NFS4_OPEN_DELEGATE_READ? F_RDLCK: F_WRLCK, &flp))) { | 1723 | flag == NFS4_OPEN_DELEGATE_READ? F_RDLCK: F_WRLCK, &flp))) { |
1724 | dprintk("NFSD: setlease failed [%d], no delegation\n", status); | 1724 | dprintk("NFSD: setlease failed [%d], no delegation\n", status); |
1725 | unhash_delegation(dp); | 1725 | unhash_delegation(dp); |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 98205f680476..a24f029accc0 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -872,7 +872,7 @@ extern int vfs_cancel_lock(struct file *filp, struct file_lock *fl); | |||
872 | extern int flock_lock_file_wait(struct file *filp, struct file_lock *fl); | 872 | extern int flock_lock_file_wait(struct file *filp, struct file_lock *fl); |
873 | extern int __break_lease(struct inode *inode, unsigned int flags); | 873 | extern int __break_lease(struct inode *inode, unsigned int flags); |
874 | extern void lease_get_mtime(struct inode *, struct timespec *time); | 874 | extern void lease_get_mtime(struct inode *, struct timespec *time); |
875 | extern int setlease(struct file *, long, struct file_lock **); | 875 | extern int vfs_setlease(struct file *, long, struct file_lock **); |
876 | extern int lease_modify(struct file_lock **, int); | 876 | extern int lease_modify(struct file_lock **, int); |
877 | extern int lock_may_read(struct inode *, loff_t start, unsigned long count); | 877 | extern int lock_may_read(struct inode *, loff_t start, unsigned long count); |
878 | extern int lock_may_write(struct inode *, loff_t start, unsigned long count); | 878 | extern int lock_may_write(struct inode *, loff_t start, unsigned long count); |