aboutsummaryrefslogtreecommitdiffstats
path: root/fs/locks.c
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@citi.umich.edu>2007-06-07 17:09:49 -0400
committerJ. Bruce Fields <bfields@citi.umich.edu>2007-07-18 19:14:12 -0400
commita9933cea7a1d80dd9efae9f1acd857f5dce742b9 (patch)
treed931351589579ce141110350de9ff11154328399 /fs/locks.c
parent6d5e8b05caf074ae5676ad9aaf92e381226a14a7 (diff)
locks: rename lease functions to reflect locks.c conventions
We've been using the convention that vfs_foo is the function that calls a filesystem-specific foo method if it exists, or falls back on a generic method if it doesn't; thus vfs_foo is what is called when some other part of the kernel (normally lockd or nfsd) wants to get a lock, whereas foo is what filesystems call to use the underlying local functionality as part of their lock implementation. So rename setlease to vfs_setlease (which will call a filesystem-specific setlease after a later patch) and __setlease to setlease. Also, vfs_setlease need only be GPL-exported as long as it's only needed by lockd and nfsd. Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
Diffstat (limited to 'fs/locks.c')
-rw-r--r--fs/locks.c15
1 files changed, 7 insertions, 8 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 */
1339static int __setlease(struct file *filp, long arg, struct file_lock **flp) 1339static 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
1435int setlease(struct file *filp, long arg, struct file_lock **lease) 1435int 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 1445EXPORT_SYMBOL_GPL(vfs_setlease);
1446EXPORT_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