Lines Matching refs:gl
34 static void gfs2_ail_error(struct gfs2_glock *gl, const struct buffer_head *bh) in gfs2_ail_error() argument
36 fs_err(gl->gl_name.ln_sbd, in gfs2_ail_error()
41 fs_err(gl->gl_name.ln_sbd, "AIL glock %u:%llu mapping %p\n", in gfs2_ail_error()
42 gl->gl_name.ln_type, gl->gl_name.ln_number, in gfs2_ail_error()
43 gfs2_glock2aspace(gl)); in gfs2_ail_error()
44 gfs2_lm(gl->gl_name.ln_sbd, "AIL error\n"); in gfs2_ail_error()
45 gfs2_withdraw(gl->gl_name.ln_sbd); in gfs2_ail_error()
56 static void __gfs2_ail_flush(struct gfs2_glock *gl, bool fsync, in __gfs2_ail_flush() argument
59 struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; in __gfs2_ail_flush()
60 struct list_head *head = &gl->gl_ail_list; in __gfs2_ail_flush()
74 gfs2_ail_error(gl, bh); in __gfs2_ail_flush()
79 GLOCK_BUG_ON(gl, !fsync && atomic_read(&gl->gl_ail_count)); in __gfs2_ail_flush()
85 static int gfs2_ail_empty_gl(struct gfs2_glock *gl) in gfs2_ail_empty_gl() argument
87 struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; in gfs2_ail_empty_gl()
96 tr.tr_revokes = atomic_read(&gl->gl_ail_count); in gfs2_ail_empty_gl()
136 __gfs2_ail_flush(gl, 0, tr.tr_revokes); in gfs2_ail_empty_gl()
145 void gfs2_ail_flush(struct gfs2_glock *gl, bool fsync) in gfs2_ail_flush() argument
147 struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; in gfs2_ail_flush()
148 unsigned int revokes = atomic_read(&gl->gl_ail_count); in gfs2_ail_flush()
161 __gfs2_ail_flush(gl, fsync, max_revokes); in gfs2_ail_flush()
173 static int gfs2_rgrp_metasync(struct gfs2_glock *gl) in gfs2_rgrp_metasync() argument
175 struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; in gfs2_rgrp_metasync()
177 struct gfs2_rgrpd *rgd = gfs2_glock2rgrp(gl); in gfs2_rgrp_metasync()
201 static int rgrp_go_sync(struct gfs2_glock *gl) in rgrp_go_sync() argument
203 struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; in rgrp_go_sync()
204 struct gfs2_rgrpd *rgd = gfs2_glock2rgrp(gl); in rgrp_go_sync()
207 if (!test_and_clear_bit(GLF_DIRTY, &gl->gl_flags)) in rgrp_go_sync()
209 GLOCK_BUG_ON(gl, gl->gl_state != LM_ST_EXCLUSIVE); in rgrp_go_sync()
211 gfs2_log_flush(sdp, gl, GFS2_LOG_HEAD_FLUSH_NORMAL | in rgrp_go_sync()
213 error = gfs2_rgrp_metasync(gl); in rgrp_go_sync()
215 error = gfs2_ail_empty_gl(gl); in rgrp_go_sync()
230 static void rgrp_go_inval(struct gfs2_glock *gl, int flags) in rgrp_go_inval() argument
232 struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; in rgrp_go_inval()
234 struct gfs2_rgrpd *rgd = gfs2_glock2rgrp(gl); in rgrp_go_inval()
245 static void gfs2_rgrp_go_dump(struct seq_file *seq, struct gfs2_glock *gl, in gfs2_rgrp_go_dump() argument
248 struct gfs2_rgrpd *rgd = gl->gl_object; in gfs2_rgrp_go_dump()
254 static struct gfs2_inode *gfs2_glock2inode(struct gfs2_glock *gl) in gfs2_glock2inode() argument
258 spin_lock(&gl->gl_lockref.lock); in gfs2_glock2inode()
259 ip = gl->gl_object; in gfs2_glock2inode()
262 spin_unlock(&gl->gl_lockref.lock); in gfs2_glock2inode()
266 struct gfs2_rgrpd *gfs2_glock2rgrp(struct gfs2_glock *gl) in gfs2_glock2rgrp() argument
270 spin_lock(&gl->gl_lockref.lock); in gfs2_glock2rgrp()
271 rgd = gl->gl_object; in gfs2_glock2rgrp()
272 spin_unlock(&gl->gl_lockref.lock); in gfs2_glock2rgrp()
291 int gfs2_inode_metasync(struct gfs2_glock *gl) in gfs2_inode_metasync() argument
293 struct address_space *metamapping = gfs2_glock2aspace(gl); in gfs2_inode_metasync()
299 gfs2_io_error(gl->gl_name.ln_sbd); in gfs2_inode_metasync()
309 static int inode_go_sync(struct gfs2_glock *gl) in inode_go_sync() argument
311 struct gfs2_inode *ip = gfs2_glock2inode(gl); in inode_go_sync()
313 struct address_space *metamapping = gfs2_glock2aspace(gl); in inode_go_sync()
321 if (!test_and_clear_bit(GLF_DIRTY, &gl->gl_flags)) in inode_go_sync()
324 GLOCK_BUG_ON(gl, gl->gl_state != LM_ST_EXCLUSIVE); in inode_go_sync()
326 gfs2_log_flush(gl->gl_name.ln_sbd, gl, GFS2_LOG_HEAD_FLUSH_NORMAL | in inode_go_sync()
335 ret = gfs2_inode_metasync(gl); in inode_go_sync()
338 gfs2_ail_empty_gl(gl); in inode_go_sync()
344 clear_bit(GLF_DIRTY, &gl->gl_flags); in inode_go_sync()
362 static void inode_go_inval(struct gfs2_glock *gl, int flags) in inode_go_inval() argument
364 struct gfs2_inode *ip = gfs2_glock2inode(gl); in inode_go_inval()
367 struct address_space *mapping = gfs2_glock2aspace(gl); in inode_go_inval()
377 if (ip == GFS2_I(gl->gl_name.ln_sbd->sd_rindex)) { in inode_go_inval()
378 gfs2_log_flush(gl->gl_name.ln_sbd, NULL, in inode_go_inval()
381 gl->gl_name.ln_sbd->sd_rindex_uptodate = 0; in inode_go_inval()
396 static int inode_go_demote_ok(const struct gfs2_glock *gl) in inode_go_demote_ok() argument
398 struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; in inode_go_demote_ok()
400 if (sdp->sd_jindex == gl->gl_object || sdp->sd_rindex == gl->gl_object) in inode_go_demote_ok()
499 struct gfs2_glock *gl = gh->gh_gl; in inode_go_lock() local
500 struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; in inode_go_lock()
501 struct gfs2_inode *ip = gl->gl_object; in inode_go_lock()
517 (gl->gl_state == LM_ST_EXCLUSIVE) && in inode_go_lock()
538 static void inode_go_dump(struct seq_file *seq, struct gfs2_glock *gl, in inode_go_dump() argument
541 struct gfs2_inode *ip = gl->gl_object; in inode_go_dump()
569 static int freeze_go_sync(struct gfs2_glock *gl) in freeze_go_sync() argument
572 struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; in freeze_go_sync()
585 if (gl->gl_state == LM_ST_SHARED && !gfs2_withdrawn(sdp) && in freeze_go_sync()
614 static int freeze_go_xmote_bh(struct gfs2_glock *gl, struct gfs2_holder *gh) in freeze_go_xmote_bh() argument
616 struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; in freeze_go_xmote_bh()
644 static int freeze_go_demote_ok(const struct gfs2_glock *gl) in freeze_go_demote_ok() argument
655 static void iopen_go_callback(struct gfs2_glock *gl, bool remote) in iopen_go_callback() argument
657 struct gfs2_inode *ip = gl->gl_object; in iopen_go_callback()
658 struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; in iopen_go_callback()
663 if (gl->gl_demote_state == LM_ST_UNLOCKED && in iopen_go_callback()
664 gl->gl_state == LM_ST_SHARED && ip) { in iopen_go_callback()
665 gl->gl_lockref.count++; in iopen_go_callback()
667 &gl->gl_delete, 0)) in iopen_go_callback()
668 gl->gl_lockref.count--; in iopen_go_callback()
672 static int iopen_go_demote_ok(const struct gfs2_glock *gl) in iopen_go_demote_ok() argument
674 return !gfs2_delete_work_queued(gl); in iopen_go_demote_ok()
685 static void inode_go_free(struct gfs2_glock *gl) in inode_go_free() argument
689 if (!test_bit(GLF_FREEING, &gl->gl_flags)) in inode_go_free()
691 clear_bit_unlock(GLF_FREEING, &gl->gl_flags); in inode_go_free()
692 wake_up_bit(&gl->gl_flags, GLF_FREEING); in inode_go_free()
701 static void nondisk_go_callback(struct gfs2_glock *gl, bool remote) in nondisk_go_callback() argument
703 struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; in nondisk_go_callback()
707 if (!remote || gl->gl_name.ln_number != GFS2_LIVE_LOCK) in nondisk_go_callback()
713 clear_bit(GLF_DEMOTE, &gl->gl_flags); in nondisk_go_callback()
714 clear_bit(GLF_PENDING_DEMOTE, &gl->gl_flags); in nondisk_go_callback()
724 if (gl->gl_demote_state != LM_ST_UNLOCKED) in nondisk_go_callback()