diff options
-rw-r--r-- | fs/locks.c | 26 | ||||
-rw-r--r-- | include/linux/fs.h | 2 |
2 files changed, 14 insertions, 14 deletions
diff --git a/fs/locks.c b/fs/locks.c index 717fbc404e6b..a6f54802d277 100644 --- a/fs/locks.c +++ b/fs/locks.c | |||
@@ -325,7 +325,7 @@ static int flock_make_lock(struct file *filp, struct file_lock **lock, | |||
325 | return -ENOMEM; | 325 | return -ENOMEM; |
326 | 326 | ||
327 | fl->fl_file = filp; | 327 | fl->fl_file = filp; |
328 | fl->fl_owner = (fl_owner_t)filp; | 328 | fl->fl_owner = filp; |
329 | fl->fl_pid = current->tgid; | 329 | fl->fl_pid = current->tgid; |
330 | fl->fl_flags = FL_FLOCK; | 330 | fl->fl_flags = FL_FLOCK; |
331 | fl->fl_type = type; | 331 | fl->fl_type = type; |
@@ -431,7 +431,7 @@ static int lease_init(struct file *filp, long type, struct file_lock *fl) | |||
431 | if (assign_type(fl, type) != 0) | 431 | if (assign_type(fl, type) != 0) |
432 | return -EINVAL; | 432 | return -EINVAL; |
433 | 433 | ||
434 | fl->fl_owner = (fl_owner_t)current->files; | 434 | fl->fl_owner = current->files; |
435 | fl->fl_pid = current->tgid; | 435 | fl->fl_pid = current->tgid; |
436 | 436 | ||
437 | fl->fl_file = filp; | 437 | fl->fl_file = filp; |
@@ -1155,7 +1155,6 @@ EXPORT_SYMBOL(posix_lock_file_wait); | |||
1155 | int locks_mandatory_locked(struct file *file) | 1155 | int locks_mandatory_locked(struct file *file) |
1156 | { | 1156 | { |
1157 | struct inode *inode = file_inode(file); | 1157 | struct inode *inode = file_inode(file); |
1158 | fl_owner_t owner = current->files; | ||
1159 | struct file_lock *fl; | 1158 | struct file_lock *fl; |
1160 | 1159 | ||
1161 | /* | 1160 | /* |
@@ -1165,7 +1164,8 @@ int locks_mandatory_locked(struct file *file) | |||
1165 | for (fl = inode->i_flock; fl != NULL; fl = fl->fl_next) { | 1164 | for (fl = inode->i_flock; fl != NULL; fl = fl->fl_next) { |
1166 | if (!IS_POSIX(fl)) | 1165 | if (!IS_POSIX(fl)) |
1167 | continue; | 1166 | continue; |
1168 | if (fl->fl_owner != owner && fl->fl_owner != (fl_owner_t)file) | 1167 | if (fl->fl_owner != current->files && |
1168 | fl->fl_owner != file) | ||
1169 | break; | 1169 | break; |
1170 | } | 1170 | } |
1171 | spin_unlock(&inode->i_lock); | 1171 | spin_unlock(&inode->i_lock); |
@@ -1205,7 +1205,7 @@ int locks_mandatory_area(int read_write, struct inode *inode, | |||
1205 | 1205 | ||
1206 | for (;;) { | 1206 | for (;;) { |
1207 | if (filp) { | 1207 | if (filp) { |
1208 | fl.fl_owner = (fl_owner_t)filp; | 1208 | fl.fl_owner = filp; |
1209 | fl.fl_flags &= ~FL_SLEEP; | 1209 | fl.fl_flags &= ~FL_SLEEP; |
1210 | error = __posix_lock_file(inode, &fl, NULL); | 1210 | error = __posix_lock_file(inode, &fl, NULL); |
1211 | if (!error) | 1211 | if (!error) |
@@ -1948,7 +1948,7 @@ int fcntl_getlk(struct file *filp, unsigned int cmd, struct flock __user *l) | |||
1948 | 1948 | ||
1949 | cmd = F_GETLK; | 1949 | cmd = F_GETLK; |
1950 | file_lock.fl_flags |= FL_OFDLCK; | 1950 | file_lock.fl_flags |= FL_OFDLCK; |
1951 | file_lock.fl_owner = (fl_owner_t)filp; | 1951 | file_lock.fl_owner = filp; |
1952 | } | 1952 | } |
1953 | 1953 | ||
1954 | error = vfs_test_lock(filp, &file_lock); | 1954 | error = vfs_test_lock(filp, &file_lock); |
@@ -2103,7 +2103,7 @@ again: | |||
2103 | 2103 | ||
2104 | cmd = F_SETLK; | 2104 | cmd = F_SETLK; |
2105 | file_lock->fl_flags |= FL_OFDLCK; | 2105 | file_lock->fl_flags |= FL_OFDLCK; |
2106 | file_lock->fl_owner = (fl_owner_t)filp; | 2106 | file_lock->fl_owner = filp; |
2107 | break; | 2107 | break; |
2108 | case F_OFD_SETLKW: | 2108 | case F_OFD_SETLKW: |
2109 | error = -EINVAL; | 2109 | error = -EINVAL; |
@@ -2112,7 +2112,7 @@ again: | |||
2112 | 2112 | ||
2113 | cmd = F_SETLKW; | 2113 | cmd = F_SETLKW; |
2114 | file_lock->fl_flags |= FL_OFDLCK; | 2114 | file_lock->fl_flags |= FL_OFDLCK; |
2115 | file_lock->fl_owner = (fl_owner_t)filp; | 2115 | file_lock->fl_owner = filp; |
2116 | /* Fallthrough */ | 2116 | /* Fallthrough */ |
2117 | case F_SETLKW: | 2117 | case F_SETLKW: |
2118 | file_lock->fl_flags |= FL_SLEEP; | 2118 | file_lock->fl_flags |= FL_SLEEP; |
@@ -2170,7 +2170,7 @@ int fcntl_getlk64(struct file *filp, unsigned int cmd, struct flock64 __user *l) | |||
2170 | 2170 | ||
2171 | cmd = F_GETLK64; | 2171 | cmd = F_GETLK64; |
2172 | file_lock.fl_flags |= FL_OFDLCK; | 2172 | file_lock.fl_flags |= FL_OFDLCK; |
2173 | file_lock.fl_owner = (fl_owner_t)filp; | 2173 | file_lock.fl_owner = filp; |
2174 | } | 2174 | } |
2175 | 2175 | ||
2176 | error = vfs_test_lock(filp, &file_lock); | 2176 | error = vfs_test_lock(filp, &file_lock); |
@@ -2242,7 +2242,7 @@ again: | |||
2242 | 2242 | ||
2243 | cmd = F_SETLK64; | 2243 | cmd = F_SETLK64; |
2244 | file_lock->fl_flags |= FL_OFDLCK; | 2244 | file_lock->fl_flags |= FL_OFDLCK; |
2245 | file_lock->fl_owner = (fl_owner_t)filp; | 2245 | file_lock->fl_owner = filp; |
2246 | break; | 2246 | break; |
2247 | case F_OFD_SETLKW: | 2247 | case F_OFD_SETLKW: |
2248 | error = -EINVAL; | 2248 | error = -EINVAL; |
@@ -2251,7 +2251,7 @@ again: | |||
2251 | 2251 | ||
2252 | cmd = F_SETLKW64; | 2252 | cmd = F_SETLKW64; |
2253 | file_lock->fl_flags |= FL_OFDLCK; | 2253 | file_lock->fl_flags |= FL_OFDLCK; |
2254 | file_lock->fl_owner = (fl_owner_t)filp; | 2254 | file_lock->fl_owner = filp; |
2255 | /* Fallthrough */ | 2255 | /* Fallthrough */ |
2256 | case F_SETLKW64: | 2256 | case F_SETLKW64: |
2257 | file_lock->fl_flags |= FL_SLEEP; | 2257 | file_lock->fl_flags |= FL_SLEEP; |
@@ -2324,11 +2324,11 @@ void locks_remove_file(struct file *filp) | |||
2324 | if (!inode->i_flock) | 2324 | if (!inode->i_flock) |
2325 | return; | 2325 | return; |
2326 | 2326 | ||
2327 | locks_remove_posix(filp, (fl_owner_t)filp); | 2327 | locks_remove_posix(filp, filp); |
2328 | 2328 | ||
2329 | if (filp->f_op->flock) { | 2329 | if (filp->f_op->flock) { |
2330 | struct file_lock fl = { | 2330 | struct file_lock fl = { |
2331 | .fl_owner = (fl_owner_t)filp, | 2331 | .fl_owner = filp, |
2332 | .fl_pid = current->tgid, | 2332 | .fl_pid = current->tgid, |
2333 | .fl_file = filp, | 2333 | .fl_file = filp, |
2334 | .fl_flags = FL_FLOCK, | 2334 | .fl_flags = FL_FLOCK, |
diff --git a/include/linux/fs.h b/include/linux/fs.h index e11d60cc867b..2daccaf4b547 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -833,7 +833,7 @@ static inline struct file *get_file(struct file *f) | |||
833 | * | 833 | * |
834 | * Lockd stuffs a "host" pointer into this. | 834 | * Lockd stuffs a "host" pointer into this. |
835 | */ | 835 | */ |
836 | typedef struct files_struct *fl_owner_t; | 836 | typedef void *fl_owner_t; |
837 | 837 | ||
838 | struct file_lock_operations { | 838 | struct file_lock_operations { |
839 | void (*fl_copy_lock)(struct file_lock *, struct file_lock *); | 839 | void (*fl_copy_lock)(struct file_lock *, struct file_lock *); |