diff options
-rw-r--r-- | drivers/staging/lustre/lustre/llite/file.c | 8 | ||||
-rw-r--r-- | fs/9p/vfs_file.c | 4 | ||||
-rw-r--r-- | fs/ceph/locks.c | 4 | ||||
-rw-r--r-- | fs/cifs/file.c | 2 | ||||
-rw-r--r-- | fs/dlm/plock.c | 4 | ||||
-rw-r--r-- | fs/fuse/file.c | 2 | ||||
-rw-r--r-- | fs/gfs2/file.c | 8 | ||||
-rw-r--r-- | fs/lockd/clntproc.c | 13 | ||||
-rw-r--r-- | fs/locks.c | 2 | ||||
-rw-r--r-- | fs/nfs/file.c | 13 | ||||
-rw-r--r-- | fs/nfs/nfs4proc.c | 13 | ||||
-rw-r--r-- | fs/ocfs2/locks.c | 8 |
12 files changed, 22 insertions, 59 deletions
diff --git a/drivers/staging/lustre/lustre/llite/file.c b/drivers/staging/lustre/lustre/llite/file.c index dcd0c6d65efb..4edbf46869d4 100644 --- a/drivers/staging/lustre/lustre/llite/file.c +++ b/drivers/staging/lustre/lustre/llite/file.c | |||
@@ -2763,13 +2763,9 @@ ll_file_flock(struct file *file, int cmd, struct file_lock *file_lock) | |||
2763 | rc = md_enqueue(sbi->ll_md_exp, &einfo, NULL, | 2763 | rc = md_enqueue(sbi->ll_md_exp, &einfo, NULL, |
2764 | op_data, &lockh, &flock, 0, NULL /* req */, flags); | 2764 | op_data, &lockh, &flock, 0, NULL /* req */, flags); |
2765 | 2765 | ||
2766 | if ((file_lock->fl_flags & FL_FLOCK) && | 2766 | if ((rc == 0 || file_lock->fl_type == F_UNLCK) && |
2767 | (rc == 0 || file_lock->fl_type == F_UNLCK)) | ||
2768 | rc2 = flock_lock_file_wait(file, file_lock); | ||
2769 | if ((file_lock->fl_flags & FL_POSIX) && | ||
2770 | (rc == 0 || file_lock->fl_type == F_UNLCK) && | ||
2771 | !(flags & LDLM_FL_TEST_LOCK)) | 2767 | !(flags & LDLM_FL_TEST_LOCK)) |
2772 | rc2 = posix_lock_file_wait(file, file_lock); | 2768 | rc2 = locks_lock_file_wait(file, file_lock); |
2773 | 2769 | ||
2774 | if (rc2 && file_lock->fl_type != F_UNLCK) { | 2770 | if (rc2 && file_lock->fl_type != F_UNLCK) { |
2775 | einfo.ei_mode = LCK_NL; | 2771 | einfo.ei_mode = LCK_NL; |
diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c index 3abc447783aa..f23fd86697ea 100644 --- a/fs/9p/vfs_file.c +++ b/fs/9p/vfs_file.c | |||
@@ -161,7 +161,7 @@ static int v9fs_file_do_lock(struct file *filp, int cmd, struct file_lock *fl) | |||
161 | if ((fl->fl_flags & FL_POSIX) != FL_POSIX) | 161 | if ((fl->fl_flags & FL_POSIX) != FL_POSIX) |
162 | BUG(); | 162 | BUG(); |
163 | 163 | ||
164 | res = posix_lock_file_wait(filp, fl); | 164 | res = locks_lock_file_wait(filp, fl); |
165 | if (res < 0) | 165 | if (res < 0) |
166 | goto out; | 166 | goto out; |
167 | 167 | ||
@@ -231,7 +231,7 @@ out_unlock: | |||
231 | if (res < 0 && fl->fl_type != F_UNLCK) { | 231 | if (res < 0 && fl->fl_type != F_UNLCK) { |
232 | fl_type = fl->fl_type; | 232 | fl_type = fl->fl_type; |
233 | fl->fl_type = F_UNLCK; | 233 | fl->fl_type = F_UNLCK; |
234 | res = posix_lock_file_wait(filp, fl); | 234 | res = locks_lock_file_wait(filp, fl); |
235 | fl->fl_type = fl_type; | 235 | fl->fl_type = fl_type; |
236 | } | 236 | } |
237 | out: | 237 | out: |
diff --git a/fs/ceph/locks.c b/fs/ceph/locks.c index 6706bde9ad1b..a2cb0c254060 100644 --- a/fs/ceph/locks.c +++ b/fs/ceph/locks.c | |||
@@ -228,12 +228,12 @@ int ceph_flock(struct file *file, int cmd, struct file_lock *fl) | |||
228 | err = ceph_lock_message(CEPH_LOCK_FLOCK, CEPH_MDS_OP_SETFILELOCK, | 228 | err = ceph_lock_message(CEPH_LOCK_FLOCK, CEPH_MDS_OP_SETFILELOCK, |
229 | file, lock_cmd, wait, fl); | 229 | file, lock_cmd, wait, fl); |
230 | if (!err) { | 230 | if (!err) { |
231 | err = flock_lock_file_wait(file, fl); | 231 | err = locks_lock_file_wait(file, fl); |
232 | if (err) { | 232 | if (err) { |
233 | ceph_lock_message(CEPH_LOCK_FLOCK, | 233 | ceph_lock_message(CEPH_LOCK_FLOCK, |
234 | CEPH_MDS_OP_SETFILELOCK, | 234 | CEPH_MDS_OP_SETFILELOCK, |
235 | file, CEPH_LOCK_UNLOCK, 0, fl); | 235 | file, CEPH_LOCK_UNLOCK, 0, fl); |
236 | dout("got %d on flock_lock_file_wait, undid lock", err); | 236 | dout("got %d on locks_lock_file_wait, undid lock", err); |
237 | } | 237 | } |
238 | } | 238 | } |
239 | return err; | 239 | return err; |
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index e2a6af1508af..6afdad716561 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c | |||
@@ -1553,7 +1553,7 @@ cifs_setlk(struct file *file, struct file_lock *flock, __u32 type, | |||
1553 | 1553 | ||
1554 | out: | 1554 | out: |
1555 | if (flock->fl_flags & FL_POSIX && !rc) | 1555 | if (flock->fl_flags & FL_POSIX && !rc) |
1556 | rc = posix_lock_file_wait(file, flock); | 1556 | rc = locks_lock_file_wait(file, flock); |
1557 | return rc; | 1557 | return rc; |
1558 | } | 1558 | } |
1559 | 1559 | ||
diff --git a/fs/dlm/plock.c b/fs/dlm/plock.c index 5532f097f6da..3585cc056fd1 100644 --- a/fs/dlm/plock.c +++ b/fs/dlm/plock.c | |||
@@ -172,7 +172,7 @@ int dlm_posix_lock(dlm_lockspace_t *lockspace, u64 number, struct file *file, | |||
172 | rv = op->info.rv; | 172 | rv = op->info.rv; |
173 | 173 | ||
174 | if (!rv) { | 174 | if (!rv) { |
175 | if (posix_lock_file_wait(file, fl) < 0) | 175 | if (locks_lock_file_wait(file, fl) < 0) |
176 | log_error(ls, "dlm_posix_lock: vfs lock error %llx", | 176 | log_error(ls, "dlm_posix_lock: vfs lock error %llx", |
177 | (unsigned long long)number); | 177 | (unsigned long long)number); |
178 | } | 178 | } |
@@ -262,7 +262,7 @@ int dlm_posix_unlock(dlm_lockspace_t *lockspace, u64 number, struct file *file, | |||
262 | /* cause the vfs unlock to return ENOENT if lock is not found */ | 262 | /* cause the vfs unlock to return ENOENT if lock is not found */ |
263 | fl->fl_flags |= FL_EXISTS; | 263 | fl->fl_flags |= FL_EXISTS; |
264 | 264 | ||
265 | rv = posix_lock_file_wait(file, fl); | 265 | rv = locks_lock_file_wait(file, fl); |
266 | if (rv == -ENOENT) { | 266 | if (rv == -ENOENT) { |
267 | rv = 0; | 267 | rv = 0; |
268 | goto out_free; | 268 | goto out_free; |
diff --git a/fs/fuse/file.c b/fs/fuse/file.c index f523f2f04c19..e0faf8f2c868 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c | |||
@@ -2189,7 +2189,7 @@ static int fuse_file_flock(struct file *file, int cmd, struct file_lock *fl) | |||
2189 | int err; | 2189 | int err; |
2190 | 2190 | ||
2191 | if (fc->no_flock) { | 2191 | if (fc->no_flock) { |
2192 | err = flock_lock_file_wait(file, fl); | 2192 | err = locks_lock_file_wait(file, fl); |
2193 | } else { | 2193 | } else { |
2194 | struct fuse_file *ff = file->private_data; | 2194 | struct fuse_file *ff = file->private_data; |
2195 | 2195 | ||
diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c index cf4ab89159f4..9287a2d17b8c 100644 --- a/fs/gfs2/file.c +++ b/fs/gfs2/file.c | |||
@@ -1000,7 +1000,7 @@ static int gfs2_lock(struct file *file, int cmd, struct file_lock *fl) | |||
1000 | } | 1000 | } |
1001 | if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags))) { | 1001 | if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags))) { |
1002 | if (fl->fl_type == F_UNLCK) | 1002 | if (fl->fl_type == F_UNLCK) |
1003 | posix_lock_file_wait(file, fl); | 1003 | locks_lock_file_wait(file, fl); |
1004 | return -EIO; | 1004 | return -EIO; |
1005 | } | 1005 | } |
1006 | if (IS_GETLK(cmd)) | 1006 | if (IS_GETLK(cmd)) |
@@ -1031,7 +1031,7 @@ static int do_flock(struct file *file, int cmd, struct file_lock *fl) | |||
1031 | if (gl) { | 1031 | if (gl) { |
1032 | if (fl_gh->gh_state == state) | 1032 | if (fl_gh->gh_state == state) |
1033 | goto out; | 1033 | goto out; |
1034 | flock_lock_file_wait(file, | 1034 | locks_lock_file_wait(file, |
1035 | &(struct file_lock){.fl_type = F_UNLCK}); | 1035 | &(struct file_lock){.fl_type = F_UNLCK}); |
1036 | gfs2_glock_dq(fl_gh); | 1036 | gfs2_glock_dq(fl_gh); |
1037 | gfs2_holder_reinit(state, flags, fl_gh); | 1037 | gfs2_holder_reinit(state, flags, fl_gh); |
@@ -1056,7 +1056,7 @@ static int do_flock(struct file *file, int cmd, struct file_lock *fl) | |||
1056 | if (error == GLR_TRYFAILED) | 1056 | if (error == GLR_TRYFAILED) |
1057 | error = -EAGAIN; | 1057 | error = -EAGAIN; |
1058 | } else { | 1058 | } else { |
1059 | error = flock_lock_file_wait(file, fl); | 1059 | error = locks_lock_file_wait(file, fl); |
1060 | gfs2_assert_warn(GFS2_SB(&ip->i_inode), !error); | 1060 | gfs2_assert_warn(GFS2_SB(&ip->i_inode), !error); |
1061 | } | 1061 | } |
1062 | 1062 | ||
@@ -1071,7 +1071,7 @@ static void do_unflock(struct file *file, struct file_lock *fl) | |||
1071 | struct gfs2_holder *fl_gh = &fp->f_fl_gh; | 1071 | struct gfs2_holder *fl_gh = &fp->f_fl_gh; |
1072 | 1072 | ||
1073 | mutex_lock(&fp->f_fl_mutex); | 1073 | mutex_lock(&fp->f_fl_mutex); |
1074 | flock_lock_file_wait(file, fl); | 1074 | locks_lock_file_wait(file, fl); |
1075 | if (fl_gh->gh_gl) { | 1075 | if (fl_gh->gh_gl) { |
1076 | gfs2_glock_dq(fl_gh); | 1076 | gfs2_glock_dq(fl_gh); |
1077 | gfs2_holder_uninit(fl_gh); | 1077 | gfs2_holder_uninit(fl_gh); |
diff --git a/fs/lockd/clntproc.c b/fs/lockd/clntproc.c index acd394716349..112952037933 100644 --- a/fs/lockd/clntproc.c +++ b/fs/lockd/clntproc.c | |||
@@ -474,18 +474,7 @@ static void nlmclnt_locks_init_private(struct file_lock *fl, struct nlm_host *ho | |||
474 | 474 | ||
475 | static int do_vfs_lock(struct file_lock *fl) | 475 | static int do_vfs_lock(struct file_lock *fl) |
476 | { | 476 | { |
477 | int res = 0; | 477 | return locks_lock_file_wait(fl->fl_file, fl); |
478 | switch (fl->fl_flags & (FL_POSIX|FL_FLOCK)) { | ||
479 | case FL_POSIX: | ||
480 | res = posix_lock_file_wait(fl->fl_file, fl); | ||
481 | break; | ||
482 | case FL_FLOCK: | ||
483 | res = flock_lock_file_wait(fl->fl_file, fl); | ||
484 | break; | ||
485 | default: | ||
486 | BUG(); | ||
487 | } | ||
488 | return res; | ||
489 | } | 478 | } |
490 | 479 | ||
491 | /* | 480 | /* |
diff --git a/fs/locks.c b/fs/locks.c index c1745119fc5b..4667f8226747 100644 --- a/fs/locks.c +++ b/fs/locks.c | |||
@@ -1961,7 +1961,7 @@ SYSCALL_DEFINE2(flock, unsigned int, fd, unsigned int, cmd) | |||
1961 | (can_sleep) ? F_SETLKW : F_SETLK, | 1961 | (can_sleep) ? F_SETLKW : F_SETLK, |
1962 | lock); | 1962 | lock); |
1963 | else | 1963 | else |
1964 | error = flock_lock_file_wait(f.file, lock); | 1964 | error = locks_lock_file_wait(f.file, lock); |
1965 | 1965 | ||
1966 | out_free: | 1966 | out_free: |
1967 | locks_free_lock(lock); | 1967 | locks_free_lock(lock); |
diff --git a/fs/nfs/file.c b/fs/nfs/file.c index c0f9b1ed12b9..37f639d50af5 100644 --- a/fs/nfs/file.c +++ b/fs/nfs/file.c | |||
@@ -738,18 +738,7 @@ out_noconflict: | |||
738 | 738 | ||
739 | static int do_vfs_lock(struct file *file, struct file_lock *fl) | 739 | static int do_vfs_lock(struct file *file, struct file_lock *fl) |
740 | { | 740 | { |
741 | int res = 0; | 741 | return locks_lock_file_wait(file, fl); |
742 | switch (fl->fl_flags & (FL_POSIX|FL_FLOCK)) { | ||
743 | case FL_POSIX: | ||
744 | res = posix_lock_file_wait(file, fl); | ||
745 | break; | ||
746 | case FL_FLOCK: | ||
747 | res = flock_lock_file_wait(file, fl); | ||
748 | break; | ||
749 | default: | ||
750 | BUG(); | ||
751 | } | ||
752 | return res; | ||
753 | } | 742 | } |
754 | 743 | ||
755 | static int | 744 | static int |
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 693b903b48bd..ce64a45ab648 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -5472,18 +5472,7 @@ static int nfs4_proc_getlk(struct nfs4_state *state, int cmd, struct file_lock * | |||
5472 | 5472 | ||
5473 | static int do_vfs_lock(struct inode *inode, struct file_lock *fl) | 5473 | static int do_vfs_lock(struct inode *inode, struct file_lock *fl) |
5474 | { | 5474 | { |
5475 | int res = 0; | 5475 | return locks_lock_inode_wait(inode, fl); |
5476 | switch (fl->fl_flags & (FL_POSIX|FL_FLOCK)) { | ||
5477 | case FL_POSIX: | ||
5478 | res = posix_lock_inode_wait(inode, fl); | ||
5479 | break; | ||
5480 | case FL_FLOCK: | ||
5481 | res = flock_lock_inode_wait(inode, fl); | ||
5482 | break; | ||
5483 | default: | ||
5484 | BUG(); | ||
5485 | } | ||
5486 | return res; | ||
5487 | } | 5476 | } |
5488 | 5477 | ||
5489 | struct nfs4_unlockdata { | 5478 | struct nfs4_unlockdata { |
diff --git a/fs/ocfs2/locks.c b/fs/ocfs2/locks.c index 6b6d092b0998..652ece4a9d9e 100644 --- a/fs/ocfs2/locks.c +++ b/fs/ocfs2/locks.c | |||
@@ -66,7 +66,7 @@ static int ocfs2_do_flock(struct file *file, struct inode *inode, | |||
66 | * level. | 66 | * level. |
67 | */ | 67 | */ |
68 | 68 | ||
69 | flock_lock_file_wait(file, | 69 | locks_lock_file_wait(file, |
70 | &(struct file_lock){.fl_type = F_UNLCK}); | 70 | &(struct file_lock){.fl_type = F_UNLCK}); |
71 | 71 | ||
72 | ocfs2_file_unlock(file); | 72 | ocfs2_file_unlock(file); |
@@ -81,7 +81,7 @@ static int ocfs2_do_flock(struct file *file, struct inode *inode, | |||
81 | goto out; | 81 | goto out; |
82 | } | 82 | } |
83 | 83 | ||
84 | ret = flock_lock_file_wait(file, fl); | 84 | ret = locks_lock_file_wait(file, fl); |
85 | if (ret) | 85 | if (ret) |
86 | ocfs2_file_unlock(file); | 86 | ocfs2_file_unlock(file); |
87 | 87 | ||
@@ -98,7 +98,7 @@ static int ocfs2_do_funlock(struct file *file, int cmd, struct file_lock *fl) | |||
98 | 98 | ||
99 | mutex_lock(&fp->fp_mutex); | 99 | mutex_lock(&fp->fp_mutex); |
100 | ocfs2_file_unlock(file); | 100 | ocfs2_file_unlock(file); |
101 | ret = flock_lock_file_wait(file, fl); | 101 | ret = locks_lock_file_wait(file, fl); |
102 | mutex_unlock(&fp->fp_mutex); | 102 | mutex_unlock(&fp->fp_mutex); |
103 | 103 | ||
104 | return ret; | 104 | return ret; |
@@ -119,7 +119,7 @@ int ocfs2_flock(struct file *file, int cmd, struct file_lock *fl) | |||
119 | 119 | ||
120 | if ((osb->s_mount_opt & OCFS2_MOUNT_LOCALFLOCKS) || | 120 | if ((osb->s_mount_opt & OCFS2_MOUNT_LOCALFLOCKS) || |
121 | ocfs2_mount_local(osb)) | 121 | ocfs2_mount_local(osb)) |
122 | return flock_lock_file_wait(file, fl); | 122 | return locks_lock_file_wait(file, fl); |
123 | 123 | ||
124 | if (fl->fl_type == F_UNLCK) | 124 | if (fl->fl_type == F_UNLCK) |
125 | return ocfs2_do_funlock(file, cmd, fl); | 125 | return ocfs2_do_funlock(file, cmd, fl); |