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()
231 set_bit(GLF_INSTANTIATE_NEEDED, &gl->gl_flags); in rgrp_go_inval()
234 static void gfs2_rgrp_go_dump(struct seq_file *seq, struct gfs2_glock *gl, in gfs2_rgrp_go_dump() argument
237 struct gfs2_rgrpd *rgd = gl->gl_object; in gfs2_rgrp_go_dump()
243 static struct gfs2_inode *gfs2_glock2inode(struct gfs2_glock *gl) in gfs2_glock2inode() argument
247 spin_lock(&gl->gl_lockref.lock); in gfs2_glock2inode()
248 ip = gl->gl_object; in gfs2_glock2inode()
251 spin_unlock(&gl->gl_lockref.lock); in gfs2_glock2inode()
255 struct gfs2_rgrpd *gfs2_glock2rgrp(struct gfs2_glock *gl) in gfs2_glock2rgrp() argument
259 spin_lock(&gl->gl_lockref.lock); in gfs2_glock2rgrp()
260 rgd = gl->gl_object; in gfs2_glock2rgrp()
261 spin_unlock(&gl->gl_lockref.lock); in gfs2_glock2rgrp()
280 int gfs2_inode_metasync(struct gfs2_glock *gl) in gfs2_inode_metasync() argument
282 struct address_space *metamapping = gfs2_glock2aspace(gl); in gfs2_inode_metasync()
288 gfs2_io_error(gl->gl_name.ln_sbd); in gfs2_inode_metasync()
298 static int inode_go_sync(struct gfs2_glock *gl) in inode_go_sync() argument
300 struct gfs2_inode *ip = gfs2_glock2inode(gl); in inode_go_sync()
302 struct address_space *metamapping = gfs2_glock2aspace(gl); in inode_go_sync()
310 if (!test_and_clear_bit(GLF_DIRTY, &gl->gl_flags)) in inode_go_sync()
313 GLOCK_BUG_ON(gl, gl->gl_state != LM_ST_EXCLUSIVE); in inode_go_sync()
315 gfs2_log_flush(gl->gl_name.ln_sbd, gl, GFS2_LOG_HEAD_FLUSH_NORMAL | in inode_go_sync()
324 ret = gfs2_inode_metasync(gl); in inode_go_sync()
327 gfs2_ail_empty_gl(gl); in inode_go_sync()
333 clear_bit(GLF_DIRTY, &gl->gl_flags); in inode_go_sync()
351 static void inode_go_inval(struct gfs2_glock *gl, int flags) in inode_go_inval() argument
353 struct gfs2_inode *ip = gfs2_glock2inode(gl); in inode_go_inval()
356 struct address_space *mapping = gfs2_glock2aspace(gl); in inode_go_inval()
359 set_bit(GLF_INSTANTIATE_NEEDED, &gl->gl_flags); in inode_go_inval()
366 if (ip == GFS2_I(gl->gl_name.ln_sbd->sd_rindex)) { in inode_go_inval()
367 gfs2_log_flush(gl->gl_name.ln_sbd, NULL, in inode_go_inval()
370 gl->gl_name.ln_sbd->sd_rindex_uptodate = 0; in inode_go_inval()
385 static int inode_go_demote_ok(const struct gfs2_glock *gl) in inode_go_demote_ok() argument
387 struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; in inode_go_demote_ok()
389 if (sdp->sd_jindex == gl->gl_object || sdp->sd_rindex == gl->gl_object) in inode_go_demote_ok()
491 struct gfs2_glock *gl = gh->gh_gl; in inode_go_instantiate() local
492 struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; in inode_go_instantiate()
493 struct gfs2_inode *ip = gl->gl_object; in inode_go_instantiate()
507 (gl->gl_state == LM_ST_EXCLUSIVE) && in inode_go_instantiate()
529 static void inode_go_dump(struct seq_file *seq, struct gfs2_glock *gl, in inode_go_dump() argument
532 struct gfs2_inode *ip = gl->gl_object; in inode_go_dump()
557 static int freeze_go_sync(struct gfs2_glock *gl) in freeze_go_sync() argument
560 struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; in freeze_go_sync()
573 if (gl->gl_state == LM_ST_SHARED && !gfs2_withdrawn(sdp) && in freeze_go_sync()
600 static int freeze_go_xmote_bh(struct gfs2_glock *gl) in freeze_go_xmote_bh() argument
602 struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; in freeze_go_xmote_bh()
630 static int freeze_go_demote_ok(const struct gfs2_glock *gl) in freeze_go_demote_ok() argument
642 static void iopen_go_callback(struct gfs2_glock *gl, bool remote) in iopen_go_callback() argument
644 struct gfs2_inode *ip = gl->gl_object; in iopen_go_callback()
645 struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; in iopen_go_callback()
650 if (gl->gl_demote_state == LM_ST_UNLOCKED && in iopen_go_callback()
651 gl->gl_state == LM_ST_SHARED && ip) { in iopen_go_callback()
652 gl->gl_lockref.count++; in iopen_go_callback()
654 &gl->gl_delete, 0)) in iopen_go_callback()
655 gl->gl_lockref.count--; in iopen_go_callback()
659 static int iopen_go_demote_ok(const struct gfs2_glock *gl) in iopen_go_demote_ok() argument
661 return !gfs2_delete_work_queued(gl); in iopen_go_demote_ok()
672 static void inode_go_free(struct gfs2_glock *gl) in inode_go_free() argument
676 if (!test_bit(GLF_FREEING, &gl->gl_flags)) in inode_go_free()
678 clear_bit_unlock(GLF_FREEING, &gl->gl_flags); in inode_go_free()
679 wake_up_bit(&gl->gl_flags, GLF_FREEING); in inode_go_free()
688 static void nondisk_go_callback(struct gfs2_glock *gl, bool remote) in nondisk_go_callback() argument
690 struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; in nondisk_go_callback()
694 if (!remote || gl->gl_name.ln_number != GFS2_LIVE_LOCK) in nondisk_go_callback()
700 clear_bit(GLF_DEMOTE, &gl->gl_flags); in nondisk_go_callback()
701 clear_bit(GLF_PENDING_DEMOTE, &gl->gl_flags); in nondisk_go_callback()
711 if (gl->gl_demote_state != LM_ST_UNLOCKED) in nondisk_go_callback()