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()
91 static int gfs2_ail_empty_gl(struct gfs2_glock *gl) in gfs2_ail_empty_gl() argument
93 struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; in gfs2_ail_empty_gl()
98 revokes = atomic_read(&gl->gl_ail_count); in gfs2_ail_empty_gl()
134 __gfs2_ail_flush(gl, 0, revokes); in gfs2_ail_empty_gl()
144 void gfs2_ail_flush(struct gfs2_glock *gl, bool fsync) in gfs2_ail_flush() argument
146 struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; in gfs2_ail_flush()
147 unsigned int revokes = atomic_read(&gl->gl_ail_count); in gfs2_ail_flush()
156 __gfs2_ail_flush(gl, fsync, revokes); in gfs2_ail_flush()
168 static int gfs2_rgrp_metasync(struct gfs2_glock *gl) in gfs2_rgrp_metasync() argument
170 struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; in gfs2_rgrp_metasync()
172 struct gfs2_rgrpd *rgd = gfs2_glock2rgrp(gl); in gfs2_rgrp_metasync()
196 static int rgrp_go_sync(struct gfs2_glock *gl) in rgrp_go_sync() argument
198 struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; in rgrp_go_sync()
199 struct gfs2_rgrpd *rgd = gfs2_glock2rgrp(gl); in rgrp_go_sync()
202 if (!rgd || !test_and_clear_bit(GLF_DIRTY, &gl->gl_flags)) in rgrp_go_sync()
204 GLOCK_BUG_ON(gl, gl->gl_state != LM_ST_EXCLUSIVE); in rgrp_go_sync()
206 gfs2_log_flush(sdp, gl, GFS2_LOG_HEAD_FLUSH_NORMAL | in rgrp_go_sync()
208 error = gfs2_rgrp_metasync(gl); in rgrp_go_sync()
210 error = gfs2_ail_empty_gl(gl); in rgrp_go_sync()
225 static void rgrp_go_inval(struct gfs2_glock *gl, int flags) in rgrp_go_inval() argument
227 struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; in rgrp_go_inval()
229 struct gfs2_rgrpd *rgd = gfs2_glock2rgrp(gl); in rgrp_go_inval()
242 static void gfs2_rgrp_go_dump(struct seq_file *seq, const struct gfs2_glock *gl, in gfs2_rgrp_go_dump() argument
245 struct gfs2_rgrpd *rgd = gl->gl_object; in gfs2_rgrp_go_dump()
251 static struct gfs2_inode *gfs2_glock2inode(struct gfs2_glock *gl) in gfs2_glock2inode() argument
255 spin_lock(&gl->gl_lockref.lock); in gfs2_glock2inode()
256 ip = gl->gl_object; in gfs2_glock2inode()
259 spin_unlock(&gl->gl_lockref.lock); in gfs2_glock2inode()
263 struct gfs2_rgrpd *gfs2_glock2rgrp(struct gfs2_glock *gl) in gfs2_glock2rgrp() argument
267 spin_lock(&gl->gl_lockref.lock); in gfs2_glock2rgrp()
268 rgd = gl->gl_object; in gfs2_glock2rgrp()
269 spin_unlock(&gl->gl_lockref.lock); in gfs2_glock2rgrp()
288 int gfs2_inode_metasync(struct gfs2_glock *gl) in gfs2_inode_metasync() argument
290 struct address_space *metamapping = gfs2_glock2aspace(gl); in gfs2_inode_metasync()
296 gfs2_io_error(gl->gl_name.ln_sbd); in gfs2_inode_metasync()
306 static int inode_go_sync(struct gfs2_glock *gl) in inode_go_sync() argument
308 struct gfs2_inode *ip = gfs2_glock2inode(gl); in inode_go_sync()
310 struct address_space *metamapping = gfs2_glock2aspace(gl); in inode_go_sync()
318 if (!test_and_clear_bit(GLF_DIRTY, &gl->gl_flags)) in inode_go_sync()
321 GLOCK_BUG_ON(gl, gl->gl_state != LM_ST_EXCLUSIVE); in inode_go_sync()
323 gfs2_log_flush(gl->gl_name.ln_sbd, gl, GFS2_LOG_HEAD_FLUSH_NORMAL | in inode_go_sync()
332 ret = gfs2_inode_metasync(gl); in inode_go_sync()
335 ret = gfs2_ail_empty_gl(gl); in inode_go_sync()
343 clear_bit(GLF_DIRTY, &gl->gl_flags); in inode_go_sync()
361 static void inode_go_inval(struct gfs2_glock *gl, int flags) in inode_go_inval() argument
363 struct gfs2_inode *ip = gfs2_glock2inode(gl); in inode_go_inval()
366 struct address_space *mapping = gfs2_glock2aspace(gl); in inode_go_inval()
369 set_bit(GLF_INSTANTIATE_NEEDED, &gl->gl_flags); in inode_go_inval()
376 if (ip == GFS2_I(gl->gl_name.ln_sbd->sd_rindex)) { in inode_go_inval()
377 gfs2_log_flush(gl->gl_name.ln_sbd, NULL, in inode_go_inval()
380 gl->gl_name.ln_sbd->sd_rindex_uptodate = 0; in inode_go_inval()
395 static int inode_go_demote_ok(const struct gfs2_glock *gl) in inode_go_demote_ok() argument
397 struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; in inode_go_demote_ok()
399 if (sdp->sd_jindex == gl->gl_object || sdp->sd_rindex == gl->gl_object) in inode_go_demote_ok()
504 static int inode_go_instantiate(struct gfs2_glock *gl) in inode_go_instantiate() argument
506 struct gfs2_inode *ip = gl->gl_object; in inode_go_instantiate()
516 struct gfs2_glock *gl = gh->gh_gl; in inode_go_held() local
517 struct gfs2_inode *ip = gl->gl_object; in inode_go_held()
527 (gl->gl_state == LM_ST_EXCLUSIVE) && in inode_go_held()
542 static void inode_go_dump(struct seq_file *seq, const struct gfs2_glock *gl, in inode_go_dump() argument
545 struct gfs2_inode *ip = gl->gl_object; in inode_go_dump()
567 static void freeze_go_callback(struct gfs2_glock *gl, bool remote) in freeze_go_callback() argument
569 struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; in freeze_go_callback()
573 (gl->gl_state != LM_ST_SHARED && in freeze_go_callback()
574 gl->gl_state != LM_ST_UNLOCKED) || in freeze_go_callback()
575 gl->gl_demote_state != LM_ST_UNLOCKED) in freeze_go_callback()
596 static int freeze_go_xmote_bh(struct gfs2_glock *gl) in freeze_go_xmote_bh() argument
598 struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; in freeze_go_xmote_bh()
626 static int freeze_go_demote_ok(const struct gfs2_glock *gl) in freeze_go_demote_ok() argument
638 static void iopen_go_callback(struct gfs2_glock *gl, bool remote) in iopen_go_callback() argument
640 struct gfs2_inode *ip = gl->gl_object; in iopen_go_callback()
641 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()
650 if (!gfs2_queue_try_to_evict(gl)) in iopen_go_callback()
651 gl->gl_lockref.count--; in iopen_go_callback()
663 static void inode_go_free(struct gfs2_glock *gl) in inode_go_free() argument
667 if (!test_bit(GLF_FREEING, &gl->gl_flags)) in inode_go_free()
669 clear_bit_unlock(GLF_FREEING, &gl->gl_flags); in inode_go_free()
670 wake_up_bit(&gl->gl_flags, GLF_FREEING); in inode_go_free()
679 static void nondisk_go_callback(struct gfs2_glock *gl, bool remote) in nondisk_go_callback() argument
681 struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; in nondisk_go_callback()
685 if (!remote || gl->gl_name.ln_number != GFS2_LIVE_LOCK) in nondisk_go_callback()
691 clear_bit(GLF_DEMOTE, &gl->gl_flags); in nondisk_go_callback()
692 clear_bit(GLF_PENDING_DEMOTE, &gl->gl_flags); in nondisk_go_callback()
702 if (gl->gl_demote_state != LM_ST_UNLOCKED) in nondisk_go_callback()