aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/util.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2008-01-30 10:34:04 -0500
committerSteven Whitehouse <swhiteho@redhat.com>2008-03-31 05:40:26 -0400
commitda755fdb414470d6dce3df12ad188de9131cf96c (patch)
tree7081889e6fc13f4ffdf86f5e928a748af7a7adbc /fs/gfs2/util.c
parentab0d756681c9502a2ab9e2e4ab3685bc0567f4ee (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/util.c')
-rw-r--r--fs/gfs2/util.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/fs/gfs2/util.c b/fs/gfs2/util.c
index fe9c28ef77b0..d31e355c61fb 100644
--- a/fs/gfs2/util.c
+++ b/fs/gfs2/util.c
@@ -19,7 +19,6 @@
19#include "gfs2.h" 19#include "gfs2.h"
20#include "incore.h" 20#include "incore.h"
21#include "glock.h" 21#include "glock.h"
22#include "lm.h"
23#include "util.h" 22#include "util.h"
24 23
25struct kmem_cache *gfs2_glock_cachep __read_mostly; 24struct kmem_cache *gfs2_glock_cachep __read_mostly;
@@ -33,6 +32,28 @@ void gfs2_assert_i(struct gfs2_sbd *sdp)
33 sdp->sd_fsname); 32 sdp->sd_fsname);
34} 33}
35 34
35int gfs2_lm_withdraw(struct gfs2_sbd *sdp, char *fmt, ...)
36{
37 va_list args;
38
39 if (test_and_set_bit(SDF_SHUTDOWN, &sdp->sd_flags))
40 return 0;
41
42 va_start(args, fmt);
43 vprintk(fmt, args);
44 va_end(args);
45
46 fs_err(sdp, "about to withdraw this file system\n");
47 BUG_ON(sdp->sd_args.ar_debug);
48
49 fs_err(sdp, "telling LM to withdraw\n");
50 gfs2_withdraw_lockproto(&sdp->sd_lockstruct);
51 fs_err(sdp, "withdrawn\n");
52 dump_stack();
53
54 return -1;
55}
56
36/** 57/**
37 * gfs2_assert_withdraw_i - Cause the machine to withdraw if @assertion is false 58 * gfs2_assert_withdraw_i - Cause the machine to withdraw if @assertion is false
38 * Returns: -1 if this call withdrew the machine, 59 * Returns: -1 if this call withdrew the machine,