31 static void gfs2_ail_error(
struct gfs2_glock *gl,
const struct buffer_head *bh)
33 fs_err(gl->
gl_sbd,
"AIL buffer %p: blocknr %llu state 0x%08lx mapping %p page state 0x%lx\n",
34 bh, (
unsigned long long)bh->b_blocknr, bh->b_state,
35 bh->b_page->mapping, bh->b_page->flags);
38 gfs2_glock2aspace(gl));
50 static void __gfs2_ail_flush(
struct gfs2_glock *gl,
bool fsync)
55 struct buffer_head *bh;
56 const unsigned long b_state = (1
UL << BH_Dirty)|(1
UL <<
BH_Pinned)|(1
UL << BH_Lock);
63 if (bh->b_state & b_state) {
66 gfs2_ail_error(gl, bh);
68 blocknr = bh->b_blocknr;
83 static void gfs2_ail_empty_gl(
struct gfs2_glock *gl)
96 tr.tr_ip = (
unsigned long)__builtin_return_address(0);
97 sb_start_intwrite(sdp->
sd_vfs);
102 __gfs2_ail_flush(gl, 0);
120 __gfs2_ail_flush(gl, fsync);
134 static void rgrp_go_sync(
struct gfs2_glock *gl)
147 mapping_set_error(metamapping, error);
148 gfs2_ail_empty_gl(gl);
187 static void inode_go_sync(
struct gfs2_glock *gl)
196 unmap_shared_mapping_range(ip->
i_inode.i_mapping, 0, 0);
208 mapping_set_error(mapping, error);
211 mapping_set_error(metamapping, error);
212 gfs2_ail_empty_gl(gl);
232 static void inode_go_inval(
struct gfs2_glock *gl,
int flags)
243 forget_all_cached_acls(&ip->
i_inode);
248 if (ip == GFS2_I(gl->
gl_sbd->sd_rindex)) {
250 gl->
gl_sbd->sd_rindex_uptodate = 0;
263 static int inode_go_demote_ok(
const struct gfs2_glock *gl)
306 static int gfs2_dinode_in(
struct gfs2_inode *ip,
const void *
buf)
375 struct buffer_head *dibh;
378 error = gfs2_meta_inode_buffer(ip, &dibh);
382 error = gfs2_dinode_in(ip, dibh->b_data);
440 gfs2_print_dbg(seq,
" I: n:%llu/%llu t:%u f:0x%02lx d:0x%08x s:%llu\n",
445 (
unsigned long long)i_size_read(&ip->
i_inode));
457 static void trans_go_sync(
struct gfs2_glock *gl)
483 j_gl->
gl_ops->go_inval(j_gl, DIO_METADATA);
494 gfs2_log_pointers_init(sdp, head.lh_blkno);
507 static int trans_go_demote_ok(
const struct gfs2_glock *gl)
518 static void iopen_go_callback(
struct gfs2_glock *gl)
539 .go_xmote_th = inode_go_sync,
540 .go_inval = inode_go_inval,
541 .go_demote_ok = inode_go_demote_ok,
542 .go_lock = inode_go_lock,
543 .go_dump = inode_go_dump,
549 .go_xmote_th = rgrp_go_sync,
550 .go_inval = rgrp_go_inval,
559 .go_xmote_th = trans_go_sync,
560 .go_xmote_bh = trans_go_xmote_bh,
561 .go_demote_ok = trans_go_demote_ok,
567 .go_callback = iopen_go_callback,