diff options
Diffstat (limited to 'fs/gfs2/glock.h')
-rw-r--r-- | fs/gfs2/glock.h | 27 |
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 | ||
107 | int gfs2_glock_be_greedy(struct gfs2_glock *gl, unsigned int time); | 107 | int gfs2_glock_be_greedy(struct gfs2_glock *gl, unsigned int time); |
108 | 108 | ||
109 | int gfs2_glock_nq_init(struct gfs2_glock *gl, unsigned int state, int flags, | ||
110 | struct gfs2_holder *gh); | ||
111 | void gfs2_glock_dq_uninit(struct gfs2_holder *gh); | 109 | void gfs2_glock_dq_uninit(struct gfs2_holder *gh); |
112 | int gfs2_glock_nq_num(struct gfs2_sbd *sdp, | 110 | int 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 | |||
132 | static 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 | ||
126 | int gfs2_lvb_hold(struct gfs2_glock *gl); | 149 | int gfs2_lvb_hold(struct gfs2_glock *gl); |