Lines Matching refs:gl
135 void (*lm_put_lock) (struct gfs2_glock *gl);
136 int (*lm_lock) (struct gfs2_glock *gl, unsigned int req_state,
138 void (*lm_cancel) (struct gfs2_glock *gl);
148 static inline struct gfs2_holder *gfs2_glock_is_locked_by_me(struct gfs2_glock *gl) in gfs2_glock_is_locked_by_me() argument
154 spin_lock(&gl->gl_lockref.lock); in gfs2_glock_is_locked_by_me()
156 list_for_each_entry(gh, &gl->gl_holders, gh_list) { in gfs2_glock_is_locked_by_me()
166 spin_unlock(&gl->gl_lockref.lock); in gfs2_glock_is_locked_by_me()
171 static inline int gfs2_glock_is_held_excl(struct gfs2_glock *gl) in gfs2_glock_is_held_excl() argument
173 return gl->gl_state == LM_ST_EXCLUSIVE; in gfs2_glock_is_held_excl()
176 static inline int gfs2_glock_is_held_dfrd(struct gfs2_glock *gl) in gfs2_glock_is_held_dfrd() argument
178 return gl->gl_state == LM_ST_DEFERRED; in gfs2_glock_is_held_dfrd()
181 static inline int gfs2_glock_is_held_shrd(struct gfs2_glock *gl) in gfs2_glock_is_held_shrd() argument
183 return gl->gl_state == LM_ST_SHARED; in gfs2_glock_is_held_shrd()
186 static inline struct address_space *gfs2_glock2aspace(struct gfs2_glock *gl) in gfs2_glock2aspace() argument
188 if (gl->gl_ops->go_flags & GLOF_ASPACE) { in gfs2_glock2aspace()
190 container_of(gl, struct gfs2_glock_aspace, glock); in gfs2_glock2aspace()
199 extern void gfs2_glock_hold(struct gfs2_glock *gl);
200 extern void gfs2_glock_put(struct gfs2_glock *gl);
201 extern void gfs2_glock_queue_put(struct gfs2_glock *gl);
203 extern void __gfs2_holder_init(struct gfs2_glock *gl, unsigned int state,
206 static inline void gfs2_holder_init(struct gfs2_glock *gl, unsigned int state, in gfs2_holder_init() argument
208 __gfs2_holder_init(gl, state, flags, gh, _RET_IP_); in gfs2_holder_init()
229 extern void gfs2_dump_glock(struct seq_file *seq, struct gfs2_glock *gl,
231 #define GLOCK_BUG_ON(gl,x) do { if (unlikely(x)) { \ argument
232 gfs2_dump_glock(NULL, gl, true); \
234 #define gfs2_glock_assert_warn(gl, x) do { if (unlikely(!(x))) { \ argument
235 gfs2_dump_glock(NULL, gl, true); \
236 gfs2_assert_warn((gl)->gl_name.ln_sbd, (x)); } } \
238 #define gfs2_glock_assert_withdraw(gl, x) do { if (unlikely(!(x))) { \ argument
239 gfs2_dump_glock(NULL, gl, true); \
240 gfs2_assert_withdraw((gl)->gl_name.ln_sbd, (x)); } } \
256 static inline int gfs2_glock_nq_init(struct gfs2_glock *gl, in gfs2_glock_nq_init() argument
262 __gfs2_holder_init(gl, state, flags, gh, _RET_IP_); in gfs2_glock_nq_init()
271 extern void gfs2_glock_cb(struct gfs2_glock *gl, unsigned int state);
272 extern void gfs2_glock_complete(struct gfs2_glock *gl, int ret);
273 extern bool gfs2_queue_delete_work(struct gfs2_glock *gl, unsigned long delay);
274 extern void gfs2_cancel_delete_work(struct gfs2_glock *gl);
275 extern bool gfs2_delete_work_queued(const struct gfs2_glock *gl);
280 extern void gfs2_glock_add_to_lru(struct gfs2_glock *gl);
281 extern void gfs2_glock_free(struct gfs2_glock *gl);
313 static inline void glock_set_object(struct gfs2_glock *gl, void *object) in glock_set_object() argument
315 spin_lock(&gl->gl_lockref.lock); in glock_set_object()
316 if (gfs2_assert_warn(gl->gl_name.ln_sbd, gl->gl_object == NULL)) in glock_set_object()
317 gfs2_dump_glock(NULL, gl, true); in glock_set_object()
318 gl->gl_object = object; in glock_set_object()
319 spin_unlock(&gl->gl_lockref.lock); in glock_set_object()
340 static inline void glock_clear_object(struct gfs2_glock *gl, void *object) in glock_clear_object() argument
342 spin_lock(&gl->gl_lockref.lock); in glock_clear_object()
343 if (gl->gl_object == object) in glock_clear_object()
344 gl->gl_object = NULL; in glock_clear_object()
345 spin_unlock(&gl->gl_lockref.lock); in glock_clear_object()
350 struct gfs2_glock *gl = gh->gh_gl; in gfs2_holder_allow_demote() local
352 spin_lock(&gl->gl_lockref.lock); in gfs2_holder_allow_demote()
354 spin_unlock(&gl->gl_lockref.lock); in gfs2_holder_allow_demote()
359 struct gfs2_glock *gl = gh->gh_gl; in gfs2_holder_disallow_demote() local
361 spin_lock(&gl->gl_lockref.lock); in gfs2_holder_disallow_demote()
363 spin_unlock(&gl->gl_lockref.lock); in gfs2_holder_disallow_demote()
366 extern void gfs2_inode_remember_delete(struct gfs2_glock *gl, u64 generation);
367 extern bool gfs2_inode_already_deleted(struct gfs2_glock *gl, u64 generation);