Lines Matching refs:mp

37 	xfs_mount_t	*mp,		/* file system mount structure */  in xfs_rtget_summary()  argument
45 return xfs_rtmodify_summary_int(mp, tp, log, bbno, 0, rbpp, rsb, sum); in xfs_rtget_summary()
54 xfs_mount_t *mp, /* file system mount structure */ in xfs_rtany_summary() argument
74 error = xfs_rtget_summary(mp, tp, log, bbno, rbpp, rsb, &sum); in xfs_rtany_summary()
141 xfs_mount_t *mp, /* file system mount point */ in xfs_rtallocate_range() argument
159 error = xfs_rtfind_back(mp, tp, start, 0, &preblock); in xfs_rtallocate_range()
166 error = xfs_rtfind_forw(mp, tp, end, mp->m_sb.sb_rextents - 1, in xfs_rtallocate_range()
175 error = xfs_rtmodify_summary(mp, tp, in xfs_rtallocate_range()
177 XFS_BITTOBLOCK(mp, preblock), -1, rbpp, rsb); in xfs_rtallocate_range()
186 error = xfs_rtmodify_summary(mp, tp, in xfs_rtallocate_range()
188 XFS_BITTOBLOCK(mp, preblock), 1, rbpp, rsb); in xfs_rtallocate_range()
198 error = xfs_rtmodify_summary(mp, tp, in xfs_rtallocate_range()
200 XFS_BITTOBLOCK(mp, end + 1), 1, rbpp, rsb); in xfs_rtallocate_range()
208 error = xfs_rtmodify_range(mp, tp, start, len, 0); in xfs_rtallocate_range()
220 xfs_mount_t *mp, /* file system mount point */ in xfs_rtallocate_extent_block() argument
244 for (i = XFS_BLOCKTOBIT(mp, bbno), besti = -1, bestlen = 0, in xfs_rtallocate_extent_block()
245 end = XFS_BLOCKTOBIT(mp, bbno + 1) - 1; in xfs_rtallocate_extent_block()
252 error = xfs_rtcheck_range(mp, tp, i, maxlen, 1, &next, &stat); in xfs_rtallocate_extent_block()
260 error = xfs_rtallocate_range(mp, tp, i, maxlen, rbpp, in xfs_rtallocate_extent_block()
288 error = xfs_rtfind_forw(mp, tp, next, end, &i); in xfs_rtallocate_extent_block()
313 error = xfs_rtallocate_range(mp, tp, besti, bestlen, rbpp, rsb); in xfs_rtallocate_extent_block()
337 xfs_mount_t *mp, /* file system mount point */ in xfs_rtallocate_extent_exact() argument
357 error = xfs_rtcheck_range(mp, tp, bno, maxlen, 1, &next, &isfree); in xfs_rtallocate_extent_exact()
365 error = xfs_rtallocate_range(mp, tp, bno, maxlen, rbpp, rsb); in xfs_rtallocate_extent_exact()
400 error = xfs_rtallocate_range(mp, tp, bno, maxlen, rbpp, rsb); in xfs_rtallocate_extent_exact()
416 xfs_mount_t *mp, /* file system mount point */ in xfs_rtallocate_extent_near() argument
441 if (bno >= mp->m_sb.sb_rextents) in xfs_rtallocate_extent_near()
442 bno = mp->m_sb.sb_rextents - 1; in xfs_rtallocate_extent_near()
446 error = xfs_rtallocate_extent_exact(mp, tp, bno, minlen, maxlen, len, in xfs_rtallocate_extent_near()
458 bbno = XFS_BITTOBLOCK(mp, bno); in xfs_rtallocate_extent_near()
470 error = xfs_rtany_summary(mp, tp, log2len, mp->m_rsumlevels - 1, in xfs_rtallocate_extent_near()
488 error = xfs_rtallocate_extent_block(mp, tp, in xfs_rtallocate_extent_near()
517 error = xfs_rtany_summary(mp, tp, in xfs_rtallocate_extent_near()
518 log2len, mp->m_rsumlevels - 1, in xfs_rtallocate_extent_near()
533 error = xfs_rtallocate_extent_block(mp, in xfs_rtallocate_extent_near()
555 error = xfs_rtallocate_extent_block(mp, tp, in xfs_rtallocate_extent_near()
580 else if (i > 0 && (int)bbno + i < mp->m_sb.sb_rbmblocks - 1) in xfs_rtallocate_extent_near()
586 else if (i <= 0 && (int)bbno - i < mp->m_sb.sb_rbmblocks - 1) in xfs_rtallocate_extent_near()
611 xfs_mount_t *mp, /* file system mount point */ in xfs_rtallocate_extent_size() argument
638 for (l = xfs_highbit32(maxlen); l < mp->m_rsumlevels; l++) { in xfs_rtallocate_extent_size()
642 for (i = 0; i < mp->m_sb.sb_rbmblocks; i++) { in xfs_rtallocate_extent_size()
646 error = xfs_rtget_summary(mp, tp, l, i, rbpp, rsb, in xfs_rtallocate_extent_size()
659 error = xfs_rtallocate_extent_block(mp, tp, i, maxlen, in xfs_rtallocate_extent_size()
676 if (XFS_BITTOBLOCK(mp, n) > i + 1) in xfs_rtallocate_extent_size()
677 i = XFS_BITTOBLOCK(mp, n) - 1; in xfs_rtallocate_extent_size()
701 for (i = 0; i < mp->m_sb.sb_rbmblocks; i++) { in xfs_rtallocate_extent_size()
705 error = xfs_rtget_summary(mp, tp, l, i, rbpp, rsb, in xfs_rtallocate_extent_size()
720 error = xfs_rtallocate_extent_block(mp, tp, i, in xfs_rtallocate_extent_size()
739 if (XFS_BITTOBLOCK(mp, n) > i + 1) in xfs_rtallocate_extent_size()
740 i = XFS_BITTOBLOCK(mp, n) - 1; in xfs_rtallocate_extent_size()
755 struct xfs_mount *mp, /* file system mount point */ in xfs_growfs_rt_alloc() argument
774 resblks = XFS_GROWFSRT_SPACE_RES(mp, nblocks - oblocks); in xfs_growfs_rt_alloc()
778 error = xfs_trans_alloc(mp, &M_RES(mp)->tr_growrtalloc, resblks, in xfs_growfs_rt_alloc()
815 error = xfs_trans_alloc(mp, &M_RES(mp)->tr_growrtzero, in xfs_growfs_rt_alloc()
827 d = XFS_FSB_TO_DADDR(mp, fsbno); in xfs_growfs_rt_alloc()
828 bp = xfs_trans_get_buf(tp, mp->m_ddev_targp, d, in xfs_growfs_rt_alloc()
829 mp->m_bsize, 0); in xfs_growfs_rt_alloc()
834 memset(bp->b_addr, 0, mp->m_sb.sb_blocksize); in xfs_growfs_rt_alloc()
835 xfs_trans_log_buf(tp, bp, 0, mp->m_sb.sb_blocksize - 1); in xfs_growfs_rt_alloc()
865 xfs_mount_t *mp, /* mount point for filesystem */ in xfs_growfs_rt() argument
885 sbp = &mp->m_sb; in xfs_growfs_rt()
891 if (mp->m_rtdev_targp == NULL || mp->m_rbmip == NULL || in xfs_growfs_rt()
900 error = xfs_buf_read_uncached(mp->m_rtdev_targp, in xfs_growfs_rt()
901 XFS_FSB_TO_BB(mp, nrblocks - 1), in xfs_growfs_rt()
902 XFS_FSB_TO_BB(mp, 1), 0, &bp, NULL); in xfs_growfs_rt()
916 nrsumblocks = XFS_B_TO_FSB(mp, nrsumsize); in xfs_growfs_rt()
917 nrsumsize = XFS_FSB_TO_B(mp, nrsumblocks); in xfs_growfs_rt()
923 if (nrsumblocks > (mp->m_sb.sb_logblocks >> 1)) in xfs_growfs_rt()
929 rbmblocks = XFS_B_TO_FSB(mp, mp->m_rbmip->i_d.di_size); in xfs_growfs_rt()
930 rsumblocks = XFS_B_TO_FSB(mp, mp->m_rsumip->i_d.di_size); in xfs_growfs_rt()
934 error = xfs_growfs_rt_alloc(mp, rbmblocks, nrbmblocks, mp->m_rbmip); in xfs_growfs_rt()
937 error = xfs_growfs_rt_alloc(mp, rsumblocks, nrsumblocks, mp->m_rsumip); in xfs_growfs_rt()
951 ((sbp->sb_rextents & ((1 << mp->m_blkbit_log) - 1)) != 0); in xfs_growfs_rt()
956 *nmp = *mp; in xfs_growfs_rt()
975 nrsumblocks = XFS_B_TO_FSB(mp, nrsumsize); in xfs_growfs_rt()
976 nmp->m_rsumsize = nrsumsize = XFS_FSB_TO_B(mp, nrsumblocks); in xfs_growfs_rt()
980 error = xfs_trans_alloc(mp, &M_RES(mp)->tr_growrtfree, 0, 0, 0, in xfs_growfs_rt()
987 xfs_ilock(mp->m_rbmip, XFS_ILOCK_EXCL); in xfs_growfs_rt()
988 xfs_trans_ijoin(tp, mp->m_rbmip, XFS_ILOCK_EXCL); in xfs_growfs_rt()
992 mp->m_rbmip->i_d.di_size = in xfs_growfs_rt()
994 xfs_trans_log_inode(tp, mp->m_rbmip, XFS_ILOG_CORE); in xfs_growfs_rt()
998 xfs_ilock(mp->m_rsumip, XFS_ILOCK_EXCL); in xfs_growfs_rt()
999 xfs_trans_ijoin(tp, mp->m_rsumip, XFS_ILOCK_EXCL); in xfs_growfs_rt()
1003 mp->m_rsumip->i_d.di_size = nmp->m_rsumsize; in xfs_growfs_rt()
1004 xfs_trans_log_inode(tp, mp->m_rsumip, XFS_ILOG_CORE); in xfs_growfs_rt()
1010 mp->m_rsumlevels != nmp->m_rsumlevels) { in xfs_growfs_rt()
1011 error = xfs_rtcopy_summary(mp, nmp, tp); in xfs_growfs_rt()
1052 mp->m_rsumlevels = nrsumlevels; in xfs_growfs_rt()
1053 mp->m_rsumsize = nrsumsize; in xfs_growfs_rt()
1084 xfs_mount_t *mp = tp->t_mountp; in xfs_rtallocate_extent() local
1090 ASSERT(xfs_isilocked(mp->m_rbmip, XFS_ILOCK_EXCL)); in xfs_rtallocate_extent()
1112 error = xfs_rtallocate_extent_size(mp, tp, minlen, maxlen, len, in xfs_rtallocate_extent()
1115 error = xfs_rtallocate_extent_near(mp, tp, bno, minlen, maxlen, in xfs_rtallocate_extent()
1147 struct xfs_mount *mp) /* file system mount structure */ in xfs_rtmount_init() argument
1154 sbp = &mp->m_sb; in xfs_rtmount_init()
1157 if (mp->m_rtdev_targp == NULL) { in xfs_rtmount_init()
1158 xfs_warn(mp, in xfs_rtmount_init()
1162 mp->m_rsumlevels = sbp->sb_rextslog + 1; in xfs_rtmount_init()
1163 mp->m_rsumsize = in xfs_rtmount_init()
1164 (uint)sizeof(xfs_suminfo_t) * mp->m_rsumlevels * in xfs_rtmount_init()
1166 mp->m_rsumsize = roundup(mp->m_rsumsize, sbp->sb_blocksize); in xfs_rtmount_init()
1167 mp->m_rbmip = mp->m_rsumip = NULL; in xfs_rtmount_init()
1171 d = (xfs_daddr_t)XFS_FSB_TO_BB(mp, mp->m_sb.sb_rblocks); in xfs_rtmount_init()
1172 if (XFS_BB_TO_FSB(mp, d) != mp->m_sb.sb_rblocks) { in xfs_rtmount_init()
1173 xfs_warn(mp, "realtime mount -- %llu != %llu", in xfs_rtmount_init()
1174 (unsigned long long) XFS_BB_TO_FSB(mp, d), in xfs_rtmount_init()
1175 (unsigned long long) mp->m_sb.sb_rblocks); in xfs_rtmount_init()
1178 error = xfs_buf_read_uncached(mp->m_rtdev_targp, in xfs_rtmount_init()
1179 d - XFS_FSB_TO_BB(mp, 1), in xfs_rtmount_init()
1180 XFS_FSB_TO_BB(mp, 1), 0, &bp, NULL); in xfs_rtmount_init()
1182 xfs_warn(mp, "realtime device size check failed"); in xfs_rtmount_init()
1195 xfs_mount_t *mp) /* file system mount structure */ in xfs_rtmount_inodes() argument
1200 sbp = &mp->m_sb; in xfs_rtmount_inodes()
1203 error = xfs_iget(mp, NULL, sbp->sb_rbmino, 0, 0, &mp->m_rbmip); in xfs_rtmount_inodes()
1206 ASSERT(mp->m_rbmip != NULL); in xfs_rtmount_inodes()
1208 error = xfs_iget(mp, NULL, sbp->sb_rsumino, 0, 0, &mp->m_rsumip); in xfs_rtmount_inodes()
1210 xfs_irele(mp->m_rbmip); in xfs_rtmount_inodes()
1213 ASSERT(mp->m_rsumip != NULL); in xfs_rtmount_inodes()
1219 struct xfs_mount *mp) in xfs_rtunmount_inodes() argument
1221 if (mp->m_rbmip) in xfs_rtunmount_inodes()
1222 xfs_irele(mp->m_rbmip); in xfs_rtunmount_inodes()
1223 if (mp->m_rsumip) in xfs_rtunmount_inodes()
1224 xfs_irele(mp->m_rsumip); in xfs_rtunmount_inodes()
1236 xfs_mount_t *mp, /* file system mount point */ in xfs_rtpick_extent() argument
1247 ASSERT(xfs_isilocked(mp->m_rbmip, XFS_ILOCK_EXCL)); in xfs_rtpick_extent()
1249 seqp = (uint64_t *)&VFS_I(mp->m_rbmip)->i_atime; in xfs_rtpick_extent()
1250 if (!(mp->m_rbmip->i_d.di_flags & XFS_DIFLAG_NEWRTBM)) { in xfs_rtpick_extent()
1251 mp->m_rbmip->i_d.di_flags |= XFS_DIFLAG_NEWRTBM; in xfs_rtpick_extent()
1259 b = (mp->m_sb.sb_rextents * ((resid << 1) + 1ULL)) >> in xfs_rtpick_extent()
1261 if (b >= mp->m_sb.sb_rextents) in xfs_rtpick_extent()
1262 div64_u64_rem(b, mp->m_sb.sb_rextents, &b); in xfs_rtpick_extent()
1263 if (b + len > mp->m_sb.sb_rextents) in xfs_rtpick_extent()
1264 b = mp->m_sb.sb_rextents - len; in xfs_rtpick_extent()
1267 xfs_trans_log_inode(tp, mp->m_rbmip, XFS_ILOG_CORE); in xfs_rtpick_extent()