Lines Matching full:sdp
109 struct gfs2_sbd *sdp = rbm->rgd->rd_sbd; in gfs2_setbit() local
111 fs_warn(sdp, "buf_blk = 0x%x old_state=%d, new_state=%d\n", in gfs2_setbit()
113 fs_warn(sdp, "rgrp=0x%llx bi_start=0x%x biblk: 0x%llx\n", in gfs2_setbit()
116 fs_warn(sdp, "bi_offset=0x%x bi_bytes=0x%x block=0x%llx\n", in gfs2_setbit()
467 struct gfs2_sbd *sdp = rgd->rd_sbd; in gfs2_rgrp_verify() local
486 gfs2_lm(sdp, "free data mismatch: %u != %u\n", in gfs2_rgrp_verify()
494 gfs2_lm(sdp, "used data mismatch: %u != %u\n", in gfs2_rgrp_verify()
501 gfs2_lm(sdp, "used metadata mismatch: %u != %u\n", in gfs2_rgrp_verify()
510 * @sdp: The GFS2 superblock
524 struct gfs2_rgrpd *gfs2_blk2rgrpd(struct gfs2_sbd *sdp, u64 blk, bool exact) in gfs2_blk2rgrpd() argument
529 spin_lock(&sdp->sd_rindex_spin); in gfs2_blk2rgrpd()
530 n = sdp->sd_rindex_tree.rb_node; in gfs2_blk2rgrpd()
539 spin_unlock(&sdp->sd_rindex_spin); in gfs2_blk2rgrpd()
550 spin_unlock(&sdp->sd_rindex_spin); in gfs2_blk2rgrpd()
557 * @sdp: The GFS2 superblock
562 struct gfs2_rgrpd *gfs2_rgrpd_get_first(struct gfs2_sbd *sdp) in gfs2_rgrpd_get_first() argument
567 spin_lock(&sdp->sd_rindex_spin); in gfs2_rgrpd_get_first()
568 n = rb_first(&sdp->sd_rindex_tree); in gfs2_rgrpd_get_first()
570 spin_unlock(&sdp->sd_rindex_spin); in gfs2_rgrpd_get_first()
584 struct gfs2_sbd *sdp = rgd->rd_sbd; in gfs2_rgrpd_get_next() local
587 spin_lock(&sdp->sd_rindex_spin); in gfs2_rgrpd_get_next()
590 n = rb_first(&sdp->sd_rindex_tree); in gfs2_rgrpd_get_next()
593 spin_unlock(&sdp->sd_rindex_spin); in gfs2_rgrpd_get_next()
597 spin_unlock(&sdp->sd_rindex_spin); in gfs2_rgrpd_get_next()
603 struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); in check_and_update_goal() local
604 if (!ip->i_goal || gfs2_blk2rgrpd(sdp, ip->i_goal, 1) == NULL) in check_and_update_goal()
716 void gfs2_clear_rgrpd(struct gfs2_sbd *sdp) in gfs2_clear_rgrpd() argument
722 while ((n = rb_first(&sdp->sd_rindex_tree))) { in gfs2_clear_rgrpd()
726 rb_erase(n, &sdp->sd_rindex_tree); in gfs2_clear_rgrpd()
757 struct gfs2_sbd *sdp = rgd->rd_sbd; in compute_bitstructs() local
785 bytes = sdp->sd_sb.sb_bsize - sizeof(struct gfs2_rgrp); in compute_bitstructs()
799 bytes = sdp->sd_sb.sb_bsize - in compute_bitstructs()
816 gfs2_lm(sdp, in compute_bitstructs()
838 * @sdp: the filesystem
841 u64 gfs2_ri_total(struct gfs2_sbd *sdp) in gfs2_ri_total() argument
844 struct inode *inode = sdp->sd_rindex; in gfs2_ri_total()
865 struct gfs2_sbd *sdp = rgd->rd_sbd; in rgd_insert() local
866 struct rb_node **newn = &sdp->sd_rindex_tree.rb_node, *parent = NULL; in rgd_insert()
883 rb_insert_color(&rgd->rd_node, &sdp->sd_rindex_tree); in rgd_insert()
884 sdp->sd_rgrps++; in rgd_insert()
897 struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); in read_rindex_entry() local
898 loff_t pos = sdp->sd_rgrps * sizeof(struct gfs2_rindex); in read_rindex_entry()
917 rgd->rd_sbd = sdp; in read_rindex_entry()
926 error = gfs2_glock_get(sdp, rgd->rd_addr, in read_rindex_entry()
937 if (rgd->rd_data > sdp->sd_max_rg_data) in read_rindex_entry()
938 sdp->sd_max_rg_data = rgd->rd_data; in read_rindex_entry()
939 spin_lock(&sdp->sd_rindex_spin); in read_rindex_entry()
941 spin_unlock(&sdp->sd_rindex_spin); in read_rindex_entry()
960 * @sdp: the GFS2 superblock
966 static void set_rgrp_preferences(struct gfs2_sbd *sdp) in set_rgrp_preferences() argument
973 rgd = gfs2_rgrpd_get_first(sdp); in set_rgrp_preferences()
974 for (i = 0; i < sdp->sd_lockstruct.ls_jid; i++) in set_rgrp_preferences()
980 for (i = 0; i < sdp->sd_journals; i++) { in set_rgrp_preferences()
997 struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); in gfs2_ri_update() local
1007 if (RB_EMPTY_ROOT(&sdp->sd_rindex_tree)) { in gfs2_ri_update()
1008 fs_err(sdp, "no resource groups found in the file system.\n"); in gfs2_ri_update()
1011 set_rgrp_preferences(sdp); in gfs2_ri_update()
1013 sdp->sd_rindex_uptodate = 1; in gfs2_ri_update()
1019 * @sdp: The GFS2 superblock
1034 int gfs2_rindex_update(struct gfs2_sbd *sdp) in gfs2_rindex_update() argument
1036 struct gfs2_inode *ip = GFS2_I(sdp->sd_rindex); in gfs2_rindex_update()
1043 if (!sdp->sd_rindex_uptodate) { in gfs2_rindex_update()
1050 if (!sdp->sd_rindex_uptodate) in gfs2_rindex_update()
1115 struct gfs2_sbd *sdp = rgd->rd_sbd; in gfs2_rgrp_lvb_valid() local
1119 fs_warn(sdp, "GFS2: rgd: %llu lvb flag mismatch %u/%u", in gfs2_rgrp_lvb_valid()
1125 fs_warn(sdp, "GFS2: rgd: %llu lvb free mismatch %u/%u", in gfs2_rgrp_lvb_valid()
1131 fs_warn(sdp, "GFS2: rgd: %llu lvb dinode mismatch %u/%u", in gfs2_rgrp_lvb_valid()
1138 fs_warn(sdp, "GFS2: rgd: %llu lvb igen mismatch %llu/%llu", in gfs2_rgrp_lvb_valid()
1202 struct gfs2_sbd *sdp = rgd->rd_sbd; in gfs2_rgrp_go_instantiate() local
1220 error = gfs2_meta_wait(sdp, bi->bi_bh); in gfs2_rgrp_go_instantiate()
1223 if (gfs2_metatype_check(sdp, bi->bi_bh, y ? GFS2_METATYPE_RB : in gfs2_rgrp_go_instantiate()
1241 } else if (sdp->sd_args.ar_rgrplvb) { in gfs2_rgrp_go_instantiate()
1257 gfs2_assert_warn(sdp, !bi->bi_clone); in gfs2_rgrp_go_instantiate()
1309 int gfs2_rgrp_send_discards(struct gfs2_sbd *sdp, u64 offset, in gfs2_rgrp_send_discards() argument
1313 struct super_block *sb = sdp->sd_vfs; in gfs2_rgrp_send_discards()
1370 if (sdp->sd_args.ar_discard) in gfs2_rgrp_send_discards()
1371 fs_warn(sdp, "error %d on discard request, turning discards off for this filesystem\n", rv); in gfs2_rgrp_send_discards()
1372 sdp->sd_args.ar_discard = 0; in gfs2_rgrp_send_discards()
1387 struct gfs2_sbd *sdp = GFS2_SB(inode); in gfs2_fitrim() local
1388 struct block_device *bdev = sdp->sd_vfs->s_bdev; in gfs2_fitrim()
1399 unsigned bs_shift = sdp->sd_sb.sb_bsize_shift; in gfs2_fitrim()
1404 if (!test_bit(SDF_JOURNAL_LIVE, &sdp->sd_flags)) in gfs2_fitrim()
1413 ret = gfs2_rindex_update(sdp); in gfs2_fitrim()
1419 minlen = max_t(u64, r.minlen, sdp->sd_sb.sb_bsize); in gfs2_fitrim()
1422 if (end <= start || minlen > sdp->sd_max_rg_data) in gfs2_fitrim()
1425 rgd = gfs2_blk2rgrpd(sdp, start, 0); in gfs2_fitrim()
1426 rgd_end = gfs2_blk2rgrpd(sdp, end, 0); in gfs2_fitrim()
1428 if ((gfs2_rgrpd_get_first(sdp) == gfs2_rgrpd_get_next(rgd_end)) in gfs2_fitrim()
1444 ret = gfs2_rgrp_send_discards(sdp, in gfs2_fitrim()
1456 ret = gfs2_trans_begin(sdp, RES_RG_HDR, 0); in gfs2_fitrim()
1464 gfs2_trans_end(sdp); in gfs2_fitrim()
1845 struct gfs2_sbd *sdp = rgd->rd_sbd; in try_rgrp_unlink() local
1869 error = gfs2_glock_get(sdp, block, &gfs2_iopen_glops, CREATE, &gl); in try_rgrp_unlink()
1926 const struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; in gfs2_rgrp_congested() local
1937 st = &per_cpu_ptr(sdp->sd_lkstats, cpu)->lkstats[LM_TYPE_RGRP]; in gfs2_rgrp_congested()
1943 st = &this_cpu_ptr(sdp->sd_lkstats)->lkstats[LM_TYPE_RGRP]; in gfs2_rgrp_congested()
1989 const struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); in gfs2_orlov_skip() local
1993 return skip % sdp->sd_rgrps; in gfs2_orlov_skip()
1999 struct gfs2_sbd *sdp = rgd->rd_sbd; in gfs2_select_rgrp() local
2003 rgd = gfs2_rgrpd_get_first(sdp); in gfs2_select_rgrp()
2047 struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); in gfs2_inplace_reserve() local
2059 if (sdp->sd_args.ar_rgrplvb) in gfs2_inplace_reserve()
2061 if (gfs2_assert_warn(sdp, target)) in gfs2_inplace_reserve()
2070 rs->rs_rgd = begin = gfs2_blk2rgrpd(sdp, ip->i_goal, 1); in gfs2_inplace_reserve()
2104 if (sdp->sd_args.ar_rgrplvb) { in gfs2_inplace_reserve()
2121 if (sdp->sd_args.ar_rgrplvb) { in gfs2_inplace_reserve()
2179 if (ip == GFS2_I(sdp->sd_rindex) && !sdp->sd_rindex_uptodate) { in gfs2_inplace_reserve()
2188 gfs2_log_flush(sdp, NULL, GFS2_LOG_HEAD_FLUSH_NORMAL | in gfs2_inplace_reserve()
2255 * @sdp: the filesystem
2262 static void rgblk_free(struct gfs2_sbd *sdp, struct gfs2_rgrpd *rgd, in rgblk_free() argument
2326 struct gfs2_sbd *sdp = rgd->rd_sbd; in gfs2_rgrp_error() local
2327 char fs_id_buf[sizeof(sdp->sd_fsname) + 7]; in gfs2_rgrp_error()
2329 fs_warn(sdp, "rgrp %llu has an error, marking it readonly until umount\n", in gfs2_rgrp_error()
2331 fs_warn(sdp, "umount on all nodes and run fsck.gfs2 to fix the error\n"); in gfs2_rgrp_error()
2332 sprintf(fs_id_buf, "fsid=%s: ", sdp->sd_fsname); in gfs2_rgrp_error()
2422 struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); in gfs2_alloc_blocks() local
2443 fs_warn(sdp, "inum=%llu error=%d, nblocks=%u, full=%d fail_pt=%d\n", in gfs2_alloc_blocks()
2468 fs_warn(sdp, "nblocks=%u\n", *nblocks); in gfs2_alloc_blocks()
2490 gfs2_statfs_change(sdp, 0, -(s64)*nblocks, dinode ? 1 : 0); in gfs2_alloc_blocks()
2492 gfs2_trans_remove_revoke(sdp, block, *nblocks); in gfs2_alloc_blocks()
2520 struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); in __gfs2_free_blocks() local
2523 rgblk_free(sdp, rgd, bstart, blen, GFS2_BLKST_FREE); in __gfs2_free_blocks()
2548 struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); in gfs2_free_meta() local
2551 gfs2_statfs_change(sdp, 0, +blen, 0); in gfs2_free_meta()
2558 struct gfs2_sbd *sdp = GFS2_SB(inode); in gfs2_unlink_di() local
2562 rgd = gfs2_blk2rgrpd(sdp, blkno, true); in gfs2_unlink_di()
2566 rgblk_free(sdp, rgd, blkno, 1, GFS2_BLKST_UNLINKED); in gfs2_unlink_di()
2576 struct gfs2_sbd *sdp = rgd->rd_sbd; in gfs2_free_di() local
2579 rgblk_free(sdp, rgd, ip->i_no_addr, 1, GFS2_BLKST_FREE); in gfs2_free_di()
2590 gfs2_statfs_change(sdp, 0, +1, -1); in gfs2_free_di()
2598 * @sdp: The superblock
2611 int gfs2_check_blk_type(struct gfs2_sbd *sdp, u64 no_addr, unsigned int type) in gfs2_check_blk_type() argument
2618 rgd = gfs2_blk2rgrpd(sdp, no_addr, 1); in gfs2_check_blk_type()
2661 struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); in gfs2_rlist_add() local
2667 if (gfs2_assert_warn(sdp, !rlist->rl_ghs)) in gfs2_rlist_add()
2678 rgd = gfs2_blk2rgrpd(sdp, block, 1); in gfs2_rlist_add()
2682 rgd = gfs2_blk2rgrpd(sdp, block, 1); in gfs2_rlist_add()
2686 fs_err(sdp, "rlist_add: no rgrp for block %llu\n", in gfs2_rlist_add()