mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-18 20:54:20 +00:00
File locking related changes for v3.17 (pile #1)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAABAgAGBQJT34bvAAoJEAAOaEEZVoIVAPIQAINMD2fqeF3g9ZHxyzsKWoUp f14ZKeF/6nbG4Bn+iIihzxz/Bs9qS+03oVeI4oAg1c9crT+qZ6+nLM4C1n5gfck0 Z0DvF1ITFcr+Nv0D/GSIiI4NY8ZJLP5gZWCPYaO4xamwVs2Bh4/B4uxi7ETIkfXh uL6dN739D2fBDNZBbeRh4VJTGXbT6ipzkTIBFXkMfmqGtUxzeTfepN+IdhE5gVnx xXc8ZZOVNmWI7g/YAYKSMlLbufHHgX47U2sNTljtHII4GXf98DmiYulcJvhfQ1JP 7xSmbIrvn9Gm2iGobzbfED/OjXA0rsdw1vSzTO/uHUYPRriMOwuDRGE+S3oP0dRD ZdxQa8iOZjWEsWbDTRekBBAIXWcTUN8g8EbPj74EN0GWi3HYFj/ORkowj5Ym6zWh Sv4w9SafNMOKy9tt4RVh4iwendU/pNLrRgvR407aM+UWkhwCpinlO6vSLHppUwlC dgxFZtkdeBf5tMkm8Tja+XAV2SjU8DwP4nFU1kHu25L0W7m7hmmIeu6Crq5qlL3J 0NCPTO1LeGNP1WiOQf99nXoJVeL3//CfD+H4LjIMcGCc4P7gJc346rH91Zd6rXY/ kGomnkBMw+5WLvfOJ1NhuaEy3g8Wfk84QzlsmWgTEzl5qT+SEjPLcDHWqWJ2GTvB gFUPWHenVMcrFN/n0CWg =hvV8 -----END PGP SIGNATURE----- Merge tag 'locks-v3.17-1' of git://git.samba.org/jlayton/linux Pull file locking related changes from Jeff Layton: "Just a couple of changes from Christoph to start us down the road toward getting rid of the fl_owner_t typedef" * tag 'locks-v3.17-1' of git://git.samba.org/jlayton/linux: locks: purge fl_owner_t from fs/locks.c locks: typedef fl_owner_t to void *
This commit is contained in:
commit
1bff598860
2 changed files with 14 additions and 14 deletions
26
fs/locks.c
26
fs/locks.c
|
@ -325,7 +325,7 @@ static int flock_make_lock(struct file *filp, struct file_lock **lock,
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
fl->fl_file = filp;
|
fl->fl_file = filp;
|
||||||
fl->fl_owner = (fl_owner_t)filp;
|
fl->fl_owner = filp;
|
||||||
fl->fl_pid = current->tgid;
|
fl->fl_pid = current->tgid;
|
||||||
fl->fl_flags = FL_FLOCK;
|
fl->fl_flags = FL_FLOCK;
|
||||||
fl->fl_type = type;
|
fl->fl_type = type;
|
||||||
|
@ -431,7 +431,7 @@ static int lease_init(struct file *filp, long type, struct file_lock *fl)
|
||||||
if (assign_type(fl, type) != 0)
|
if (assign_type(fl, type) != 0)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
fl->fl_owner = (fl_owner_t)current->files;
|
fl->fl_owner = current->files;
|
||||||
fl->fl_pid = current->tgid;
|
fl->fl_pid = current->tgid;
|
||||||
|
|
||||||
fl->fl_file = filp;
|
fl->fl_file = filp;
|
||||||
|
@ -1155,7 +1155,6 @@ EXPORT_SYMBOL(posix_lock_file_wait);
|
||||||
int locks_mandatory_locked(struct file *file)
|
int locks_mandatory_locked(struct file *file)
|
||||||
{
|
{
|
||||||
struct inode *inode = file_inode(file);
|
struct inode *inode = file_inode(file);
|
||||||
fl_owner_t owner = current->files;
|
|
||||||
struct file_lock *fl;
|
struct file_lock *fl;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1165,7 +1164,8 @@ int locks_mandatory_locked(struct file *file)
|
||||||
for (fl = inode->i_flock; fl != NULL; fl = fl->fl_next) {
|
for (fl = inode->i_flock; fl != NULL; fl = fl->fl_next) {
|
||||||
if (!IS_POSIX(fl))
|
if (!IS_POSIX(fl))
|
||||||
continue;
|
continue;
|
||||||
if (fl->fl_owner != owner && fl->fl_owner != (fl_owner_t)file)
|
if (fl->fl_owner != current->files &&
|
||||||
|
fl->fl_owner != file)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
spin_unlock(&inode->i_lock);
|
spin_unlock(&inode->i_lock);
|
||||||
|
@ -1205,7 +1205,7 @@ int locks_mandatory_area(int read_write, struct inode *inode,
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
if (filp) {
|
if (filp) {
|
||||||
fl.fl_owner = (fl_owner_t)filp;
|
fl.fl_owner = filp;
|
||||||
fl.fl_flags &= ~FL_SLEEP;
|
fl.fl_flags &= ~FL_SLEEP;
|
||||||
error = __posix_lock_file(inode, &fl, NULL);
|
error = __posix_lock_file(inode, &fl, NULL);
|
||||||
if (!error)
|
if (!error)
|
||||||
|
@ -1948,7 +1948,7 @@ int fcntl_getlk(struct file *filp, unsigned int cmd, struct flock __user *l)
|
||||||
|
|
||||||
cmd = F_GETLK;
|
cmd = F_GETLK;
|
||||||
file_lock.fl_flags |= FL_OFDLCK;
|
file_lock.fl_flags |= FL_OFDLCK;
|
||||||
file_lock.fl_owner = (fl_owner_t)filp;
|
file_lock.fl_owner = filp;
|
||||||
}
|
}
|
||||||
|
|
||||||
error = vfs_test_lock(filp, &file_lock);
|
error = vfs_test_lock(filp, &file_lock);
|
||||||
|
@ -2103,7 +2103,7 @@ again:
|
||||||
|
|
||||||
cmd = F_SETLK;
|
cmd = F_SETLK;
|
||||||
file_lock->fl_flags |= FL_OFDLCK;
|
file_lock->fl_flags |= FL_OFDLCK;
|
||||||
file_lock->fl_owner = (fl_owner_t)filp;
|
file_lock->fl_owner = filp;
|
||||||
break;
|
break;
|
||||||
case F_OFD_SETLKW:
|
case F_OFD_SETLKW:
|
||||||
error = -EINVAL;
|
error = -EINVAL;
|
||||||
|
@ -2112,7 +2112,7 @@ again:
|
||||||
|
|
||||||
cmd = F_SETLKW;
|
cmd = F_SETLKW;
|
||||||
file_lock->fl_flags |= FL_OFDLCK;
|
file_lock->fl_flags |= FL_OFDLCK;
|
||||||
file_lock->fl_owner = (fl_owner_t)filp;
|
file_lock->fl_owner = filp;
|
||||||
/* Fallthrough */
|
/* Fallthrough */
|
||||||
case F_SETLKW:
|
case F_SETLKW:
|
||||||
file_lock->fl_flags |= FL_SLEEP;
|
file_lock->fl_flags |= FL_SLEEP;
|
||||||
|
@ -2170,7 +2170,7 @@ int fcntl_getlk64(struct file *filp, unsigned int cmd, struct flock64 __user *l)
|
||||||
|
|
||||||
cmd = F_GETLK64;
|
cmd = F_GETLK64;
|
||||||
file_lock.fl_flags |= FL_OFDLCK;
|
file_lock.fl_flags |= FL_OFDLCK;
|
||||||
file_lock.fl_owner = (fl_owner_t)filp;
|
file_lock.fl_owner = filp;
|
||||||
}
|
}
|
||||||
|
|
||||||
error = vfs_test_lock(filp, &file_lock);
|
error = vfs_test_lock(filp, &file_lock);
|
||||||
|
@ -2242,7 +2242,7 @@ again:
|
||||||
|
|
||||||
cmd = F_SETLK64;
|
cmd = F_SETLK64;
|
||||||
file_lock->fl_flags |= FL_OFDLCK;
|
file_lock->fl_flags |= FL_OFDLCK;
|
||||||
file_lock->fl_owner = (fl_owner_t)filp;
|
file_lock->fl_owner = filp;
|
||||||
break;
|
break;
|
||||||
case F_OFD_SETLKW:
|
case F_OFD_SETLKW:
|
||||||
error = -EINVAL;
|
error = -EINVAL;
|
||||||
|
@ -2251,7 +2251,7 @@ again:
|
||||||
|
|
||||||
cmd = F_SETLKW64;
|
cmd = F_SETLKW64;
|
||||||
file_lock->fl_flags |= FL_OFDLCK;
|
file_lock->fl_flags |= FL_OFDLCK;
|
||||||
file_lock->fl_owner = (fl_owner_t)filp;
|
file_lock->fl_owner = filp;
|
||||||
/* Fallthrough */
|
/* Fallthrough */
|
||||||
case F_SETLKW64:
|
case F_SETLKW64:
|
||||||
file_lock->fl_flags |= FL_SLEEP;
|
file_lock->fl_flags |= FL_SLEEP;
|
||||||
|
@ -2324,11 +2324,11 @@ void locks_remove_file(struct file *filp)
|
||||||
if (!inode->i_flock)
|
if (!inode->i_flock)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
locks_remove_posix(filp, (fl_owner_t)filp);
|
locks_remove_posix(filp, filp);
|
||||||
|
|
||||||
if (filp->f_op->flock) {
|
if (filp->f_op->flock) {
|
||||||
struct file_lock fl = {
|
struct file_lock fl = {
|
||||||
.fl_owner = (fl_owner_t)filp,
|
.fl_owner = filp,
|
||||||
.fl_pid = current->tgid,
|
.fl_pid = current->tgid,
|
||||||
.fl_file = filp,
|
.fl_file = filp,
|
||||||
.fl_flags = FL_FLOCK,
|
.fl_flags = FL_FLOCK,
|
||||||
|
|
|
@ -833,7 +833,7 @@ static inline struct file *get_file(struct file *f)
|
||||||
*
|
*
|
||||||
* Lockd stuffs a "host" pointer into this.
|
* Lockd stuffs a "host" pointer into this.
|
||||||
*/
|
*/
|
||||||
typedef struct files_struct *fl_owner_t;
|
typedef void *fl_owner_t;
|
||||||
|
|
||||||
struct file_lock_operations {
|
struct file_lock_operations {
|
||||||
void (*fl_copy_lock)(struct file_lock *, struct file_lock *);
|
void (*fl_copy_lock)(struct file_lock *, struct file_lock *);
|
||||||
|
|
Loading…
Add table
Reference in a new issue