aboutsummaryrefslogtreecommitdiffstats
path: root/fs/locks.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2014-04-22 08:23:58 -0400
committerJeff Layton <jlayton@redhat.com>2014-04-22 08:23:58 -0400
commit0d3f7a2dd2f5cf9642982515e020c1aee2cf7af6 (patch)
treed21410319c5503191a40687a1a774d53674753e3 /fs/locks.c
parentf1c6bb2cb8b81013e8979806f8e15e3d53efb96d (diff)
locks: rename file-private locks to "open file description locks"
File-private locks have been merged into Linux for v3.15, and *now* people are commenting that the name and macro definitions for the new file-private locks suck. ...and I can't even disagree. The names and command macros do suck. We're going to have to live with these for a long time, so it's important that we be happy with the names before we're stuck with them. The consensus on the lists so far is that they should be rechristened as "open file description locks". The name isn't a big deal for the kernel, but the command macros are not visually distinct enough from the traditional POSIX lock macros. The glibc and documentation folks are recommending that we change them to look like F_OFD_{GETLK|SETLK|SETLKW}. That lessens the chance that a programmer will typo one of the commands wrong, and also makes it easier to spot this difference when reading code. This patch makes the following changes that I think are necessary before v3.15 ships: 1) rename the command macros to their new names. These end up in the uapi headers and so are part of the external-facing API. It turns out that glibc doesn't actually use the fcntl.h uapi header, but it's hard to be sure that something else won't. Changing it now is safest. 2) make the the /proc/locks output display these as type "OFDLCK" Cc: Michael Kerrisk <mtk.manpages@gmail.com> Cc: Christoph Hellwig <hch@infradead.org> Cc: Carlos O'Donell <carlos@redhat.com> Cc: Stefan Metzmacher <metze@samba.org> Cc: Andy Lutomirski <luto@amacapital.net> Cc: Frank Filz <ffilzlnx@mindspring.com> Cc: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Jeff Layton <jlayton@redhat.com>
Diffstat (limited to 'fs/locks.c')
-rw-r--r--fs/locks.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/locks.c b/fs/locks.c
index b380f5543614..e1023b504279 100644
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -1941,7 +1941,7 @@ int fcntl_getlk(struct file *filp, unsigned int cmd, struct flock __user *l)
1941 if (error) 1941 if (error)
1942 goto out; 1942 goto out;
1943 1943
1944 if (cmd == F_GETLKP) { 1944 if (cmd == F_OFD_GETLK) {
1945 error = -EINVAL; 1945 error = -EINVAL;
1946 if (flock.l_pid != 0) 1946 if (flock.l_pid != 0)
1947 goto out; 1947 goto out;
@@ -2076,7 +2076,7 @@ again:
2076 * FL_FILE_PVT flag and override the owner. 2076 * FL_FILE_PVT flag and override the owner.
2077 */ 2077 */
2078 switch (cmd) { 2078 switch (cmd) {
2079 case F_SETLKP: 2079 case F_OFD_SETLK:
2080 error = -EINVAL; 2080 error = -EINVAL;
2081 if (flock.l_pid != 0) 2081 if (flock.l_pid != 0)
2082 goto out; 2082 goto out;
@@ -2085,7 +2085,7 @@ again:
2085 file_lock->fl_flags |= FL_FILE_PVT; 2085 file_lock->fl_flags |= FL_FILE_PVT;
2086 file_lock->fl_owner = (fl_owner_t)filp; 2086 file_lock->fl_owner = (fl_owner_t)filp;
2087 break; 2087 break;
2088 case F_SETLKPW: 2088 case F_OFD_SETLKW:
2089 error = -EINVAL; 2089 error = -EINVAL;
2090 if (flock.l_pid != 0) 2090 if (flock.l_pid != 0)
2091 goto out; 2091 goto out;
@@ -2143,7 +2143,7 @@ int fcntl_getlk64(struct file *filp, unsigned int cmd, struct flock64 __user *l)
2143 if (error) 2143 if (error)
2144 goto out; 2144 goto out;
2145 2145
2146 if (cmd == F_GETLKP) { 2146 if (cmd == F_OFD_GETLK) {
2147 error = -EINVAL; 2147 error = -EINVAL;
2148 if (flock.l_pid != 0) 2148 if (flock.l_pid != 0)
2149 goto out; 2149 goto out;
@@ -2211,7 +2211,7 @@ again:
2211 * FL_FILE_PVT flag and override the owner. 2211 * FL_FILE_PVT flag and override the owner.
2212 */ 2212 */
2213 switch (cmd) { 2213 switch (cmd) {
2214 case F_SETLKP: 2214 case F_OFD_SETLK:
2215 error = -EINVAL; 2215 error = -EINVAL;
2216 if (flock.l_pid != 0) 2216 if (flock.l_pid != 0)
2217 goto out; 2217 goto out;
@@ -2220,7 +2220,7 @@ again:
2220 file_lock->fl_flags |= FL_FILE_PVT; 2220 file_lock->fl_flags |= FL_FILE_PVT;
2221 file_lock->fl_owner = (fl_owner_t)filp; 2221 file_lock->fl_owner = (fl_owner_t)filp;
2222 break; 2222 break;
2223 case F_SETLKPW: 2223 case F_OFD_SETLKW:
2224 error = -EINVAL; 2224 error = -EINVAL;
2225 if (flock.l_pid != 0) 2225 if (flock.l_pid != 0)
2226 goto out; 2226 goto out;
@@ -2413,7 +2413,7 @@ static void lock_get_status(struct seq_file *f, struct file_lock *fl,
2413 if (fl->fl_flags & FL_ACCESS) 2413 if (fl->fl_flags & FL_ACCESS)
2414 seq_printf(f, "ACCESS"); 2414 seq_printf(f, "ACCESS");
2415 else if (IS_FILE_PVT(fl)) 2415 else if (IS_FILE_PVT(fl))
2416 seq_printf(f, "FLPVT "); 2416 seq_printf(f, "OFDLCK");
2417 else 2417 else
2418 seq_printf(f, "POSIX "); 2418 seq_printf(f, "POSIX ");
2419 2419