forked from rubenslte/android_kernel_samsung_msm8226
locks: rename FL_FILE_PVT and IS_FILE_PVT to use "*_OFDLCK" instead
File-private locks have been re-christened as "open file description" locks. Finish the symbol name cleanup in the internal implementation. Signed-off-by: Jeff Layton <jlayton@redhat.com> Change-Id: Iee48047540a7d8fefb5078cc005ae9ea8994f521 Signed-off-by: Kevin F. Haggerty <haggertk@lineageos.org>
This commit is contained in:
committed by
Francescodario Cuzzocrea
parent
56d52e62b4
commit
71ab50edc5
+12
-12
@@ -132,7 +132,7 @@
|
||||
#define IS_POSIX(fl) (fl->fl_flags & FL_POSIX)
|
||||
#define IS_FLOCK(fl) (fl->fl_flags & FL_FLOCK)
|
||||
#define IS_LEASE(fl) (fl->fl_flags & FL_LEASE)
|
||||
#define IS_FILE_PVT(fl) (fl->fl_flags & FL_FILE_PVT)
|
||||
#define IS_OFDLCK(fl) (fl->fl_flags & FL_OFDLCK)
|
||||
|
||||
static bool lease_breaking(struct file_lock *fl)
|
||||
{
|
||||
@@ -1698,7 +1698,7 @@ EXPORT_SYMBOL_GPL(vfs_test_lock);
|
||||
|
||||
static int posix_lock_to_flock(struct flock *flock, struct file_lock *fl)
|
||||
{
|
||||
flock->l_pid = IS_FILE_PVT(fl) ? -1 : fl->fl_pid;
|
||||
flock->l_pid = IS_OFDLCK(fl) ? -1 : fl->fl_pid;
|
||||
#if BITS_PER_LONG == 32
|
||||
/*
|
||||
* Make sure we can represent the posix lock via
|
||||
@@ -1720,7 +1720,7 @@ static int posix_lock_to_flock(struct flock *flock, struct file_lock *fl)
|
||||
#if BITS_PER_LONG == 32
|
||||
static void posix_lock_to_flock64(struct flock64 *flock, struct file_lock *fl)
|
||||
{
|
||||
flock->l_pid = IS_FILE_PVT(fl) ? -1 : fl->fl_pid;
|
||||
flock->l_pid = IS_OFDLCK(fl) ? -1 : fl->fl_pid;
|
||||
flock->l_start = fl->fl_start;
|
||||
flock->l_len = fl->fl_end == OFFSET_MAX ? 0 :
|
||||
fl->fl_end - fl->fl_start + 1;
|
||||
@@ -1751,7 +1751,7 @@ int fcntl_getlk(struct file *filp, unsigned int cmd, struct flock __user *l)
|
||||
|
||||
if (cmd == F_OFD_GETLK) {
|
||||
cmd = F_GETLK;
|
||||
file_lock.fl_flags |= FL_FILE_PVT;
|
||||
file_lock.fl_flags |= FL_OFDLCK;
|
||||
file_lock.fl_owner = (fl_owner_t)filp;
|
||||
}
|
||||
|
||||
@@ -1877,17 +1877,17 @@ again:
|
||||
|
||||
/*
|
||||
* If the cmd is requesting file-private locks, then set the
|
||||
* FL_FILE_PVT flag and override the owner.
|
||||
* FL_OFDLCK flag and override the owner.
|
||||
*/
|
||||
switch (cmd) {
|
||||
case F_OFD_SETLK:
|
||||
cmd = F_SETLK;
|
||||
file_lock->fl_flags |= FL_FILE_PVT;
|
||||
file_lock->fl_flags |= FL_OFDLCK;
|
||||
file_lock->fl_owner = (fl_owner_t)filp;
|
||||
break;
|
||||
case F_OFD_SETLKW:
|
||||
cmd = F_SETLKW;
|
||||
file_lock->fl_flags |= FL_FILE_PVT;
|
||||
file_lock->fl_flags |= FL_OFDLCK;
|
||||
file_lock->fl_owner = (fl_owner_t)filp;
|
||||
/* Fallthrough */
|
||||
case F_SETLKW:
|
||||
@@ -1958,7 +1958,7 @@ int fcntl_getlk64(struct file *filp, unsigned int cmd, struct flock64 __user *l)
|
||||
|
||||
if (cmd == F_OFD_GETLK) {
|
||||
cmd = F_GETLK64;
|
||||
file_lock.fl_flags |= FL_FILE_PVT;
|
||||
file_lock.fl_flags |= FL_OFDLCK;
|
||||
file_lock.fl_owner = (fl_owner_t)filp;
|
||||
}
|
||||
|
||||
@@ -2017,17 +2017,17 @@ again:
|
||||
|
||||
/*
|
||||
* If the cmd is requesting file-private locks, then set the
|
||||
* FL_FILE_PVT flag and override the owner.
|
||||
* FL_OFDLCK flag and override the owner.
|
||||
*/
|
||||
switch (cmd) {
|
||||
case F_OFD_SETLK:
|
||||
cmd = F_SETLK64;
|
||||
file_lock->fl_flags |= FL_FILE_PVT;
|
||||
file_lock->fl_flags |= FL_OFDLCK;
|
||||
file_lock->fl_owner = (fl_owner_t)filp;
|
||||
break;
|
||||
case F_OFD_SETLKW:
|
||||
cmd = F_SETLKW64;
|
||||
file_lock->fl_flags |= FL_FILE_PVT;
|
||||
file_lock->fl_flags |= FL_OFDLCK;
|
||||
file_lock->fl_owner = (fl_owner_t)filp;
|
||||
/* Fallthrough */
|
||||
case F_SETLKW64:
|
||||
@@ -2215,7 +2215,7 @@ static void lock_get_status(struct seq_file *f, struct file_lock *fl,
|
||||
if (IS_POSIX(fl)) {
|
||||
if (fl->fl_flags & FL_ACCESS)
|
||||
seq_printf(f, "ACCESS");
|
||||
else if (IS_FILE_PVT(fl))
|
||||
else if (IS_OFDLCK(fl))
|
||||
seq_printf(f, "FLPVT ");
|
||||
else
|
||||
seq_printf(f, "POSIX ");
|
||||
|
||||
+1
-1
@@ -1162,7 +1162,7 @@ static inline int file_check_writeable(struct file *filp)
|
||||
#define FL_SLEEP 128 /* A blocking lock */
|
||||
#define FL_DOWNGRADE_PENDING 256 /* Lease is being downgraded */
|
||||
#define FL_UNLOCK_PENDING 512 /* Lease is being broken */
|
||||
#define FL_FILE_PVT 1024 /* lock is private to the file */
|
||||
#define FL_OFDLCK 1024 /* lock is "owned" by struct file */
|
||||
|
||||
/*
|
||||
* Special return value from posix_lock_file() and vfs_lock_file() for
|
||||
|
||||
Reference in New Issue
Block a user