X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=fs%2Fgfs2%2Fops_file.c;h=064df8804582b1f99b9003a78fb2ff39b2a2c254;hb=b196fc69f7be7b4454781add9c2d5173f44d509b;hp=c996aa739a0515f5c11229591a83805a4abb6f99;hpb=905adce4094d64a6691df994e424fbf486301adc;p=powerpc.git diff --git a/fs/gfs2/ops_file.c b/fs/gfs2/ops_file.c index c996aa739a..064df88045 100644 --- a/fs/gfs2/ops_file.c +++ b/fs/gfs2/ops_file.c @@ -7,7 +7,6 @@ * of the GNU General Public License version 2. */ -#include #include #include #include @@ -16,7 +15,6 @@ #include #include #include -#include #include #include #include @@ -514,18 +512,18 @@ static int gfs2_lock(struct file *file, int cmd, struct file_lock *fl) if (sdp->sd_args.ar_localflocks) { if (IS_GETLK(cmd)) { - struct file_lock tmp; - int ret; - ret = posix_test_lock(file, fl, &tmp); - fl->fl_type = F_UNLCK; - if (ret) - memcpy(fl, &tmp, sizeof(struct file_lock)); + posix_test_lock(file, fl); return 0; } else { return posix_lock_file_wait(file, fl); } } + if (cmd == F_CANCELLK) { + /* Hack: */ + cmd = F_SETLK; + fl->fl_type = F_UNLCK; + } if (IS_GETLK(cmd)) return gfs2_lm_plock_get(sdp, &name, file, fl); else if (fl->fl_type == F_UNLCK)