Lines Matching defs:gl
34 static void gfs2_ail_error(struct gfs2_glock *gl, const struct buffer_head *bh)
36 struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
44 gl->gl_name.ln_type, gl->gl_name.ln_number,
45 gfs2_glock2aspace(gl));
52 * @gl: the glock
59 static void __gfs2_ail_flush(struct gfs2_glock *gl, bool fsync,
62 struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
63 struct list_head *head = &gl->gl_ail_list;
77 gfs2_ail_error(gl, bh);
82 GLOCK_BUG_ON(gl, !fsync && atomic_read(&gl->gl_ail_count));
88 static int gfs2_ail_empty_gl(struct gfs2_glock *gl)
90 struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
95 revokes = atomic_read(&gl->gl_ail_count);
131 __gfs2_ail_flush(gl, 0, revokes);
141 void gfs2_ail_flush(struct gfs2_glock *gl, bool fsync)
143 struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
144 unsigned int revokes = atomic_read(&gl->gl_ail_count);
153 __gfs2_ail_flush(gl, fsync, revokes);
161 * @gl: the glock protecting the resource group
165 static int gfs2_rgrp_metasync(struct gfs2_glock *gl)
167 struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
169 struct gfs2_rgrpd *rgd = gfs2_glock2rgrp(gl);
186 * @gl: the glock
193 static int rgrp_go_sync(struct gfs2_glock *gl)
195 struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
196 struct gfs2_rgrpd *rgd = gfs2_glock2rgrp(gl);
199 if (!rgd || !test_and_clear_bit(GLF_DIRTY, &gl->gl_flags))
201 GLOCK_BUG_ON(gl, gl->gl_state != LM_ST_EXCLUSIVE);
203 gfs2_log_flush(sdp, gl, GFS2_LOG_HEAD_FLUSH_NORMAL |
205 error = gfs2_rgrp_metasync(gl);
207 error = gfs2_ail_empty_gl(gl);
214 * @gl: the glock
222 static void rgrp_go_inval(struct gfs2_glock *gl, int flags)
224 struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
226 struct gfs2_rgrpd *rgd = gfs2_glock2rgrp(gl);
239 static void gfs2_rgrp_go_dump(struct seq_file *seq, const struct gfs2_glock *gl,
242 struct gfs2_rgrpd *rgd = gl->gl_object;
248 static struct gfs2_inode *gfs2_glock2inode(struct gfs2_glock *gl)
252 spin_lock(&gl->gl_lockref.lock);
253 ip = gl->gl_object;
256 spin_unlock(&gl->gl_lockref.lock);
260 struct gfs2_rgrpd *gfs2_glock2rgrp(struct gfs2_glock *gl)
264 spin_lock(&gl->gl_lockref.lock);
265 rgd = gl->gl_object;
266 spin_unlock(&gl->gl_lockref.lock);
282 * @gl: the glock protecting the inode
285 int gfs2_inode_metasync(struct gfs2_glock *gl)
287 struct address_space *metamapping = gfs2_glock2aspace(gl);
293 gfs2_io_error(gl->gl_name.ln_sbd);
299 * @gl: the glock protecting the inode
303 static int inode_go_sync(struct gfs2_glock *gl)
305 struct gfs2_inode *ip = gfs2_glock2inode(gl);
307 struct address_space *metamapping = gfs2_glock2aspace(gl);
315 if (!test_and_clear_bit(GLF_DIRTY, &gl->gl_flags))
318 GLOCK_BUG_ON(gl, gl->gl_state != LM_ST_EXCLUSIVE);
320 gfs2_log_flush(gl->gl_name.ln_sbd, gl, GFS2_LOG_HEAD_FLUSH_NORMAL |
329 ret = gfs2_inode_metasync(gl);
332 ret = gfs2_ail_empty_gl(gl);
340 clear_bit(GLF_DIRTY, &gl->gl_flags);
349 * @gl: the glock
358 static void inode_go_inval(struct gfs2_glock *gl, int flags)
360 struct gfs2_inode *ip = gfs2_glock2inode(gl);
363 struct address_space *mapping = gfs2_glock2aspace(gl);
366 set_bit(GLF_INSTANTIATE_NEEDED, &gl->gl_flags);
373 if (ip == GFS2_I(gl->gl_name.ln_sbd->sd_rindex)) {
374 gfs2_log_flush(gl->gl_name.ln_sbd, NULL,
377 gl->gl_name.ln_sbd->sd_rindex_uptodate = 0;
387 * @gl: the glock
392 static int inode_go_demote_ok(const struct gfs2_glock *gl)
394 struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
396 if (sdp->sd_jindex == gl->gl_object || sdp->sd_rindex == gl->gl_object)
501 static int inode_go_instantiate(struct gfs2_glock *gl)
503 struct gfs2_inode *ip = gl->gl_object;
513 struct gfs2_glock *gl = gh->gh_gl;
514 struct gfs2_inode *ip = gl->gl_object;
524 (gl->gl_state == LM_ST_EXCLUSIVE) &&
534 * @gl: The glock
539 static void inode_go_dump(struct seq_file *seq, const struct gfs2_glock *gl,
542 struct gfs2_inode *ip = gl->gl_object;
560 * @gl: the glock
564 static void freeze_go_callback(struct gfs2_glock *gl, bool remote)
566 struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
570 (gl->gl_state != LM_ST_SHARED &&
571 gl->gl_state != LM_ST_UNLOCKED) ||
572 gl->gl_demote_state != LM_ST_UNLOCKED)
591 * @gl: the glock
593 static int freeze_go_xmote_bh(struct gfs2_glock *gl)
595 struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
618 * @gl: the glock
623 static int freeze_go_demote_ok(const struct gfs2_glock *gl)
630 * @gl: the glock
635 static void iopen_go_callback(struct gfs2_glock *gl, bool remote)
637 struct gfs2_inode *ip = gl->gl_object;
638 struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
644 if (gl->gl_demote_state == LM_ST_UNLOCKED &&
645 gl->gl_state == LM_ST_SHARED && ip) {
646 gl->gl_lockref.count++;
647 if (!gfs2_queue_try_to_evict(gl))
648 gl->gl_lockref.count--;
654 * @gl: glock being freed
660 static void inode_go_free(struct gfs2_glock *gl)
664 if (!test_bit(GLF_FREEING, &gl->gl_flags))
666 clear_bit_unlock(GLF_FREEING, &gl->gl_flags);
667 wake_up_bit(&gl->gl_flags, GLF_FREEING);
672 * @gl: the nondisk glock
676 static void nondisk_go_callback(struct gfs2_glock *gl, bool remote)
678 struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
682 if (!remote || gl->gl_name.ln_number != GFS2_LIVE_LOCK)
688 clear_bit(GLF_DEMOTE, &gl->gl_flags);
689 clear_bit(GLF_PENDING_DEMOTE, &gl->gl_flags);
699 if (gl->gl_demote_state != LM_ST_UNLOCKED)