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 struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; in gfs2_ail_error()
44 gl->gl_name.ln_type, gl->gl_name.ln_number, in gfs2_ail_error()
45 gfs2_glock2aspace(gl)); in gfs2_ail_error()
59 static void __gfs2_ail_flush(struct gfs2_glock *gl, bool fsync, in __gfs2_ail_flush() argument
62 struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; in __gfs2_ail_flush()
63 struct list_head *head = &gl->gl_ail_list; in __gfs2_ail_flush()
77 gfs2_ail_error(gl, bh); in __gfs2_ail_flush()
82 GLOCK_BUG_ON(gl, !fsync && atomic_read(&gl->gl_ail_count)); in __gfs2_ail_flush()
88 static int gfs2_ail_empty_gl(struct gfs2_glock *gl) in gfs2_ail_empty_gl() argument
90 struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; in gfs2_ail_empty_gl()
95 revokes = atomic_read(&gl->gl_ail_count); in gfs2_ail_empty_gl()
129 __gfs2_ail_flush(gl, 0, revokes); in gfs2_ail_empty_gl()
138 void gfs2_ail_flush(struct gfs2_glock *gl, bool fsync) in gfs2_ail_flush() argument
140 struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; in gfs2_ail_flush()
141 unsigned int revokes = atomic_read(&gl->gl_ail_count); in gfs2_ail_flush()
150 __gfs2_ail_flush(gl, fsync, revokes); in gfs2_ail_flush()
162 static int gfs2_rgrp_metasync(struct gfs2_glock *gl) in gfs2_rgrp_metasync() argument
164 struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; in gfs2_rgrp_metasync()
166 struct gfs2_rgrpd *rgd = gfs2_glock2rgrp(gl); in gfs2_rgrp_metasync()
190 static int rgrp_go_sync(struct gfs2_glock *gl) in rgrp_go_sync() argument
192 struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; in rgrp_go_sync()
193 struct gfs2_rgrpd *rgd = gfs2_glock2rgrp(gl); in rgrp_go_sync()
196 if (!test_and_clear_bit(GLF_DIRTY, &gl->gl_flags)) in rgrp_go_sync()
198 GLOCK_BUG_ON(gl, gl->gl_state != LM_ST_EXCLUSIVE); in rgrp_go_sync()
200 gfs2_log_flush(sdp, gl, GFS2_LOG_HEAD_FLUSH_NORMAL | in rgrp_go_sync()
202 error = gfs2_rgrp_metasync(gl); in rgrp_go_sync()
204 error = gfs2_ail_empty_gl(gl); in rgrp_go_sync()
219 static void rgrp_go_inval(struct gfs2_glock *gl, int flags) in rgrp_go_inval() argument
221 struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; in rgrp_go_inval()
223 struct gfs2_rgrpd *rgd = gfs2_glock2rgrp(gl); in rgrp_go_inval()
233 static void gfs2_rgrp_go_dump(struct seq_file *seq, struct gfs2_glock *gl, in gfs2_rgrp_go_dump() argument
236 struct gfs2_rgrpd *rgd = gl->gl_object; in gfs2_rgrp_go_dump()
242 static struct gfs2_inode *gfs2_glock2inode(struct gfs2_glock *gl) in gfs2_glock2inode() argument
246 spin_lock(&gl->gl_lockref.lock); in gfs2_glock2inode()
247 ip = gl->gl_object; in gfs2_glock2inode()
250 spin_unlock(&gl->gl_lockref.lock); in gfs2_glock2inode()
254 struct gfs2_rgrpd *gfs2_glock2rgrp(struct gfs2_glock *gl) in gfs2_glock2rgrp() argument
258 spin_lock(&gl->gl_lockref.lock); in gfs2_glock2rgrp()
259 rgd = gl->gl_object; in gfs2_glock2rgrp()
260 spin_unlock(&gl->gl_lockref.lock); in gfs2_glock2rgrp()
279 int gfs2_inode_metasync(struct gfs2_glock *gl) in gfs2_inode_metasync() argument
281 struct address_space *metamapping = gfs2_glock2aspace(gl); in gfs2_inode_metasync()
287 gfs2_io_error(gl->gl_name.ln_sbd); in gfs2_inode_metasync()
297 static int inode_go_sync(struct gfs2_glock *gl) in inode_go_sync() argument
299 struct gfs2_inode *ip = gfs2_glock2inode(gl); in inode_go_sync()
301 struct address_space *metamapping = gfs2_glock2aspace(gl); in inode_go_sync()
309 if (!test_and_clear_bit(GLF_DIRTY, &gl->gl_flags)) in inode_go_sync()
312 GLOCK_BUG_ON(gl, gl->gl_state != LM_ST_EXCLUSIVE); in inode_go_sync()
314 gfs2_log_flush(gl->gl_name.ln_sbd, gl, GFS2_LOG_HEAD_FLUSH_NORMAL | in inode_go_sync()
323 ret = gfs2_inode_metasync(gl); in inode_go_sync()
326 gfs2_ail_empty_gl(gl); in inode_go_sync()
332 clear_bit(GLF_DIRTY, &gl->gl_flags); in inode_go_sync()
350 static void inode_go_inval(struct gfs2_glock *gl, int flags) in inode_go_inval() argument
352 struct gfs2_inode *ip = gfs2_glock2inode(gl); in inode_go_inval()
355 struct address_space *mapping = gfs2_glock2aspace(gl); in inode_go_inval()
358 set_bit(GLF_INSTANTIATE_NEEDED, &gl->gl_flags); in inode_go_inval()
365 if (ip == GFS2_I(gl->gl_name.ln_sbd->sd_rindex)) { in inode_go_inval()
366 gfs2_log_flush(gl->gl_name.ln_sbd, NULL, in inode_go_inval()
369 gl->gl_name.ln_sbd->sd_rindex_uptodate = 0; in inode_go_inval()
384 static int inode_go_demote_ok(const struct gfs2_glock *gl) in inode_go_demote_ok() argument
386 struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; in inode_go_demote_ok()
388 if (sdp->sd_jindex == gl->gl_object || sdp->sd_rindex == gl->gl_object) in inode_go_demote_ok()
488 static int inode_go_instantiate(struct gfs2_glock *gl) in inode_go_instantiate() argument
490 struct gfs2_inode *ip = gl->gl_object; in inode_go_instantiate()
500 struct gfs2_glock *gl = gh->gh_gl; in inode_go_held() local
501 struct gfs2_inode *ip = gl->gl_object; in inode_go_held()
511 (gl->gl_state == LM_ST_EXCLUSIVE) && in inode_go_held()
526 static void inode_go_dump(struct seq_file *seq, struct gfs2_glock *gl, in inode_go_dump() argument
529 struct gfs2_inode *ip = gl->gl_object; in inode_go_dump()
554 static int freeze_go_sync(struct gfs2_glock *gl) in freeze_go_sync() argument
557 struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; in freeze_go_sync()
570 if (gl->gl_state == LM_ST_SHARED && !gfs2_withdrawn(sdp) && in freeze_go_sync()
597 static int freeze_go_xmote_bh(struct gfs2_glock *gl) in freeze_go_xmote_bh() argument
599 struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; in freeze_go_xmote_bh()
627 static int freeze_go_demote_ok(const struct gfs2_glock *gl) in freeze_go_demote_ok() argument
639 static void iopen_go_callback(struct gfs2_glock *gl, bool remote) in iopen_go_callback() argument
641 struct gfs2_inode *ip = gl->gl_object; in iopen_go_callback()
642 struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; in iopen_go_callback()
647 if (gl->gl_demote_state == LM_ST_UNLOCKED && in iopen_go_callback()
648 gl->gl_state == LM_ST_SHARED && ip) { in iopen_go_callback()
649 gl->gl_lockref.count++; in iopen_go_callback()
651 &gl->gl_delete, 0)) in iopen_go_callback()
652 gl->gl_lockref.count--; in iopen_go_callback()
656 static int iopen_go_demote_ok(const struct gfs2_glock *gl) in iopen_go_demote_ok() argument
658 return !gfs2_delete_work_queued(gl); in iopen_go_demote_ok()
669 static void inode_go_free(struct gfs2_glock *gl) in inode_go_free() argument
673 if (!test_bit(GLF_FREEING, &gl->gl_flags)) in inode_go_free()
675 clear_bit_unlock(GLF_FREEING, &gl->gl_flags); in inode_go_free()
676 wake_up_bit(&gl->gl_flags, GLF_FREEING); in inode_go_free()
685 static void nondisk_go_callback(struct gfs2_glock *gl, bool remote) in nondisk_go_callback() argument
687 struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; in nondisk_go_callback()
691 if (!remote || gl->gl_name.ln_number != GFS2_LIVE_LOCK) in nondisk_go_callback()
697 clear_bit(GLF_DEMOTE, &gl->gl_flags); in nondisk_go_callback()
698 clear_bit(GLF_PENDING_DEMOTE, &gl->gl_flags); in nondisk_go_callback()
708 if (gl->gl_demote_state != LM_ST_UNLOCKED) in nondisk_go_callback()