aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/glock.h
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2006-03-29 14:36:49 -0500
committerSteven Whitehouse <swhiteho@redhat.com>2006-03-29 14:36:49 -0500
commitd0dc80dbafb5c10ad2084831a61bbf945484a139 (patch)
treef7434367a66e4e4be0885daefe5e59ab43502a7f /fs/gfs2/glock.h
parent[GFS2] Update locking in log.c (diff)
downloadlinux-dev-d0dc80dbafb5c10ad2084831a61bbf945484a139.tar.xz
linux-dev-d0dc80dbafb5c10ad2084831a61bbf945484a139.zip
[GFS2] Update debugging code
Update the debugging code in trans.c and at the same time improve the debugging code for gfs2_holders. The new code should be pretty fast during the normal case and provide just as much information in case of errors (or more). One small function from glock.c has moved to glock.h as a static inline so that its return address won't get in the way of the debugging. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/glock.h')
-rw-r--r--fs/gfs2/glock.h27
1 files changed, 25 insertions, 2 deletions
diff --git a/fs/gfs2/glock.h b/fs/gfs2/glock.h
index 06847ebebdee..560029de8d07 100644
--- a/fs/gfs2/glock.h
+++ b/fs/gfs2/glock.h
@@ -106,8 +106,6 @@ void gfs2_glock_force_drop(struct gfs2_glock *gl);
int gfs2_glock_be_greedy(struct gfs2_glock *gl, unsigned int time);
-int gfs2_glock_nq_init(struct gfs2_glock *gl, unsigned int state, int flags,
- struct gfs2_holder *gh);
void gfs2_glock_dq_uninit(struct gfs2_holder *gh);
int gfs2_glock_nq_num(struct gfs2_sbd *sdp,
uint64_t number, struct gfs2_glock_operations *glops,
@@ -121,6 +119,31 @@ void gfs2_glock_prefetch_num(struct gfs2_sbd *sdp, uint64_t number,
struct gfs2_glock_operations *glops,
unsigned int state, int flags);
+/**
+ * gfs2_glock_nq_init - intialize a holder and enqueue it on a glock
+ * @gl: the glock
+ * @state: the state we're requesting
+ * @flags: the modifier flags
+ * @gh: the holder structure
+ *
+ * Returns: 0, GLR_*, or errno
+ */
+
+static inline int gfs2_glock_nq_init(struct gfs2_glock *gl,
+ unsigned int state, int flags,
+ struct gfs2_holder *gh)
+{
+ int error;
+
+ gfs2_holder_init(gl, state, flags, gh);
+
+ error = gfs2_glock_nq(gh);
+ if (error)
+ gfs2_holder_uninit(gh);
+
+ return error;
+}
+
/* Lock Value Block functions */
int gfs2_lvb_hold(struct gfs2_glock *gl);