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
parent484adff8a06cb5d952832f5487ae863f54c0fb69 (diff)
[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);
106 106
107int gfs2_glock_be_greedy(struct gfs2_glock *gl, unsigned int time); 107int gfs2_glock_be_greedy(struct gfs2_glock *gl, unsigned int time);
108 108
109int gfs2_glock_nq_init(struct gfs2_glock *gl, unsigned int state, int flags,
110 struct gfs2_holder *gh);
111void gfs2_glock_dq_uninit(struct gfs2_holder *gh); 109void gfs2_glock_dq_uninit(struct gfs2_holder *gh);
112int gfs2_glock_nq_num(struct gfs2_sbd *sdp, 110int gfs2_glock_nq_num(struct gfs2_sbd *sdp,
113 uint64_t number, struct gfs2_glock_operations *glops, 111 uint64_t number, struct gfs2_glock_operations *glops,
@@ -121,6 +119,31 @@ void gfs2_glock_prefetch_num(struct gfs2_sbd *sdp, uint64_t number,
121 struct gfs2_glock_operations *glops, 119 struct gfs2_glock_operations *glops,
122 unsigned int state, int flags); 120 unsigned int state, int flags);
123 121
122/**
123 * gfs2_glock_nq_init - intialize a holder and enqueue it on a glock
124 * @gl: the glock
125 * @state: the state we're requesting
126 * @flags: the modifier flags
127 * @gh: the holder structure
128 *
129 * Returns: 0, GLR_*, or errno
130 */
131
132static inline int gfs2_glock_nq_init(struct gfs2_glock *gl,
133 unsigned int state, int flags,
134 struct gfs2_holder *gh)
135{
136 int error;
137
138 gfs2_holder_init(gl, state, flags, gh);
139
140 error = gfs2_glock_nq(gh);
141 if (error)
142 gfs2_holder_uninit(gh);
143
144 return error;
145}
146
124/* Lock Value Block functions */ 147/* Lock Value Block functions */
125 148
126int gfs2_lvb_hold(struct gfs2_glock *gl); 149int gfs2_lvb_hold(struct gfs2_glock *gl);