diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2008-01-30 10:34:04 -0500 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2008-03-31 05:40:26 -0400 |
commit | da755fdb414470d6dce3df12ad188de9131cf96c (patch) | |
tree | 7081889e6fc13f4ffdf86f5e928a748af7a7adbc /fs/gfs2/ops_file.c | |
parent | ab0d756681c9502a2ab9e2e4ab3685bc0567f4ee (diff) |
[GFS2] Remove lm.[ch] and distribute content
The functions in lm.c were just wrappers which were mostly
only used in one other file. By moving the functions to
the files where they are being used, they can be marked
static and also this will usually result in them being inlined
since they are often only used from one point in the code.
A couple of really trivial functions have been inlined by hand
into the function which called them as it makes the code clearer
to do that.
We also gain from one fewer function call in the glock lock and
unlock paths.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/ops_file.c')
-rw-r--r-- | fs/gfs2/ops_file.c | 31 |
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 | ||
598 | static 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 | |||
608 | static 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 | |||
618 | static 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 |