aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/ops_file.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/gfs2/ops_file.c')
-rw-r--r--fs/gfs2/ops_file.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/fs/gfs2/ops_file.c b/fs/gfs2/ops_file.c
index f4842f2548cd..f97a8b86c485 100644
--- a/fs/gfs2/ops_file.c
+++ b/fs/gfs2/ops_file.c
@@ -30,7 +30,6 @@
30#include "glock.h" 30#include "glock.h"
31#include "glops.h" 31#include "glops.h"
32#include "inode.h" 32#include "inode.h"
33#include "lm.h"
34#include "log.h" 33#include "log.h"
35#include "meta_io.h" 34#include "meta_io.h"
36#include "quota.h" 35#include "quota.h"
@@ -596,6 +595,36 @@ static int gfs2_setlease(struct file *file, long arg, struct file_lock **fl)
596 return generic_setlease(file, arg, fl); 595 return generic_setlease(file, arg, fl);
597} 596}
598 597
598static int gfs2_lm_plock_get(struct gfs2_sbd *sdp, struct lm_lockname *name,
599 struct file *file, struct file_lock *fl)
600{
601 int error = -EIO;
602 if (likely(!test_bit(SDF_SHUTDOWN, &sdp->sd_flags)))
603 error = sdp->sd_lockstruct.ls_ops->lm_plock_get(
604 sdp->sd_lockstruct.ls_lockspace, name, file, fl);
605 return error;
606}
607
608static int gfs2_lm_plock(struct gfs2_sbd *sdp, struct lm_lockname *name,
609 struct file *file, int cmd, struct file_lock *fl)
610{
611 int error = -EIO;
612 if (likely(!test_bit(SDF_SHUTDOWN, &sdp->sd_flags)))
613 error = sdp->sd_lockstruct.ls_ops->lm_plock(
614 sdp->sd_lockstruct.ls_lockspace, name, file, cmd, fl);
615 return error;
616}
617
618static int gfs2_lm_punlock(struct gfs2_sbd *sdp, struct lm_lockname *name,
619 struct file *file, struct file_lock *fl)
620{
621 int error = -EIO;
622 if (likely(!test_bit(SDF_SHUTDOWN, &sdp->sd_flags)))
623 error = sdp->sd_lockstruct.ls_ops->lm_punlock(
624 sdp->sd_lockstruct.ls_lockspace, name, file, fl);
625 return error;
626}
627
599/** 628/**
600 * gfs2_lock - acquire/release a posix lock on a file 629 * gfs2_lock - acquire/release a posix lock on a file
601 * @file: the file pointer 630 * @file: the file pointer