aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2
diff options
context:
space:
mode:
authorMarc Eshel <eshel@almaden.ibm.com>2007-02-21 00:55:18 -0500
committerJ. Bruce Fields <bfields@citi.umich.edu>2007-05-06 17:39:00 -0400
commit9d6a8c5c213e34c475e72b245a8eb709258e968c (patch)
tree96110535c2bd9485129c0753a9e0f012083b220f /fs/gfs2
parent70cc6487a4e08b8698c0e2ec935fb48d10490162 (diff)
locks: give posix_test_lock same interface as ->lock
posix_test_lock() and ->lock() do the same job but have gratuitously different interfaces. Modify posix_test_lock() so the two agree, simplifying some code in the process. Signed-off-by: Marc Eshel <eshel@almaden.ibm.com> Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
Diffstat (limited to 'fs/gfs2')
-rw-r--r--fs/gfs2/locking/nolock/main.c8
-rw-r--r--fs/gfs2/ops_file.c7
2 files changed, 2 insertions, 13 deletions
diff --git a/fs/gfs2/locking/nolock/main.c b/fs/gfs2/locking/nolock/main.c
index acfbc941f319..5cc1dfa7944a 100644
--- a/fs/gfs2/locking/nolock/main.c
+++ b/fs/gfs2/locking/nolock/main.c
@@ -164,13 +164,7 @@ static void nolock_unhold_lvb(void *lock, char *lvb)
164static int nolock_plock_get(void *lockspace, struct lm_lockname *name, 164static int nolock_plock_get(void *lockspace, struct lm_lockname *name,
165 struct file *file, struct file_lock *fl) 165 struct file *file, struct file_lock *fl)
166{ 166{
167 struct file_lock tmp; 167 posix_test_lock(file, fl);
168 int ret;
169
170 ret = posix_test_lock(file, fl, &tmp);
171 fl->fl_type = F_UNLCK;
172 if (ret)
173 memcpy(fl, &tmp, sizeof(struct file_lock));
174 168
175 return 0; 169 return 0;
176} 170}
diff --git a/fs/gfs2/ops_file.c b/fs/gfs2/ops_file.c
index b50180e22779..48b248d7c823 100644
--- a/fs/gfs2/ops_file.c
+++ b/fs/gfs2/ops_file.c
@@ -513,12 +513,7 @@ static int gfs2_lock(struct file *file, int cmd, struct file_lock *fl)
513 513
514 if (sdp->sd_args.ar_localflocks) { 514 if (sdp->sd_args.ar_localflocks) {
515 if (IS_GETLK(cmd)) { 515 if (IS_GETLK(cmd)) {
516 struct file_lock tmp; 516 posix_test_lock(file, fl);
517 int ret;
518 ret = posix_test_lock(file, fl, &tmp);
519 fl->fl_type = F_UNLCK;
520 if (ret)
521 memcpy(fl, &tmp, sizeof(struct file_lock));
522 return 0; 517 return 0;
523 } else { 518 } else {
524 return posix_lock_file_wait(file, fl); 519 return posix_lock_file_wait(file, fl);