Lines Matching refs:mp
81 xfs_mount_t *mp, /* file system mount point */ in xfs_growfs_rt_alloc() argument
106 tp = xfs_trans_alloc(mp, XFS_TRANS_GROWFSRT_ALLOC); in xfs_growfs_rt_alloc()
107 resblks = XFS_GROWFSRT_SPACE_RES(mp, nblocks - oblocks); in xfs_growfs_rt_alloc()
112 XFS_GROWRTALLOC_LOG_RES(mp), 0, in xfs_growfs_rt_alloc()
120 if ((error = xfs_trans_iget(mp, tp, ino, 0, in xfs_growfs_rt_alloc()
153 tp = xfs_trans_alloc(mp, XFS_TRANS_GROWFSRT_ZERO); in xfs_growfs_rt_alloc()
158 XFS_GROWRTZERO_LOG_RES(mp), 0, 0, 0))) in xfs_growfs_rt_alloc()
163 if ((error = xfs_trans_iget(mp, tp, ino, 0, in xfs_growfs_rt_alloc()
169 d = XFS_FSB_TO_DADDR(mp, fsbno); in xfs_growfs_rt_alloc()
170 bp = xfs_trans_get_buf(tp, mp->m_ddev_targp, d, in xfs_growfs_rt_alloc()
171 mp->m_bsize, 0); in xfs_growfs_rt_alloc()
178 memset(XFS_BUF_PTR(bp), 0, mp->m_sb.sb_blocksize); in xfs_growfs_rt_alloc()
179 xfs_trans_log_buf(tp, bp, 0, mp->m_sb.sb_blocksize - 1); in xfs_growfs_rt_alloc()
205 xfs_mount_t *mp, /* file system mount point */ in xfs_rtallocate_extent_block() argument
229 for (i = XFS_BLOCKTOBIT(mp, bbno), besti = -1, bestlen = 0, in xfs_rtallocate_extent_block()
230 end = XFS_BLOCKTOBIT(mp, bbno + 1) - 1; in xfs_rtallocate_extent_block()
237 error = xfs_rtcheck_range(mp, tp, i, maxlen, 1, &next, &stat); in xfs_rtallocate_extent_block()
245 error = xfs_rtallocate_range(mp, tp, i, maxlen, rbpp, in xfs_rtallocate_extent_block()
273 error = xfs_rtfind_forw(mp, tp, next, end, &i); in xfs_rtallocate_extent_block()
294 error = xfs_rtallocate_range(mp, tp, besti, bestlen, rbpp, rsb); in xfs_rtallocate_extent_block()
318 xfs_mount_t *mp, /* file system mount point */ in xfs_rtallocate_extent_exact() argument
338 error = xfs_rtcheck_range(mp, tp, bno, maxlen, 1, &next, &isfree); in xfs_rtallocate_extent_exact()
346 error = xfs_rtallocate_range(mp, tp, bno, maxlen, rbpp, rsb); in xfs_rtallocate_extent_exact()
381 error = xfs_rtallocate_range(mp, tp, bno, maxlen, rbpp, rsb); in xfs_rtallocate_extent_exact()
397 xfs_mount_t *mp, /* file system mount point */ in xfs_rtallocate_extent_near() argument
422 if (bno >= mp->m_sb.sb_rextents) in xfs_rtallocate_extent_near()
423 bno = mp->m_sb.sb_rextents - 1; in xfs_rtallocate_extent_near()
427 error = xfs_rtallocate_extent_exact(mp, tp, bno, minlen, maxlen, len, in xfs_rtallocate_extent_near()
439 bbno = XFS_BITTOBLOCK(mp, bno); in xfs_rtallocate_extent_near()
451 error = xfs_rtany_summary(mp, tp, log2len, mp->m_rsumlevels - 1, in xfs_rtallocate_extent_near()
469 error = xfs_rtallocate_extent_block(mp, tp, in xfs_rtallocate_extent_near()
498 error = xfs_rtany_summary(mp, tp, in xfs_rtallocate_extent_near()
499 log2len, mp->m_rsumlevels - 1, in xfs_rtallocate_extent_near()
514 error = xfs_rtallocate_extent_block(mp, in xfs_rtallocate_extent_near()
536 error = xfs_rtallocate_extent_block(mp, tp, in xfs_rtallocate_extent_near()
561 else if (i > 0 && (int)bbno + i < mp->m_sb.sb_rbmblocks - 1) in xfs_rtallocate_extent_near()
567 else if (i <= 0 && (int)bbno - i < mp->m_sb.sb_rbmblocks - 1) in xfs_rtallocate_extent_near()
592 xfs_mount_t *mp, /* file system mount point */ in xfs_rtallocate_extent_size() argument
619 for (l = xfs_highbit32(maxlen); l < mp->m_rsumlevels; l++) { in xfs_rtallocate_extent_size()
623 for (i = 0; i < mp->m_sb.sb_rbmblocks; i++) { in xfs_rtallocate_extent_size()
627 error = xfs_rtget_summary(mp, tp, l, i, rbpp, rsb, in xfs_rtallocate_extent_size()
640 error = xfs_rtallocate_extent_block(mp, tp, i, maxlen, in xfs_rtallocate_extent_size()
657 if (XFS_BITTOBLOCK(mp, n) > i + 1) in xfs_rtallocate_extent_size()
658 i = XFS_BITTOBLOCK(mp, n) - 1; in xfs_rtallocate_extent_size()
682 for (i = 0; i < mp->m_sb.sb_rbmblocks; i++) { in xfs_rtallocate_extent_size()
686 error = xfs_rtget_summary(mp, tp, l, i, rbpp, rsb, in xfs_rtallocate_extent_size()
701 error = xfs_rtallocate_extent_block(mp, tp, i, in xfs_rtallocate_extent_size()
720 if (XFS_BITTOBLOCK(mp, n) > i + 1) in xfs_rtallocate_extent_size()
721 i = XFS_BITTOBLOCK(mp, n) - 1; in xfs_rtallocate_extent_size()
737 xfs_mount_t *mp, /* file system mount point */ in xfs_rtallocate_range() argument
755 error = xfs_rtfind_back(mp, tp, start, 0, &preblock); in xfs_rtallocate_range()
762 error = xfs_rtfind_forw(mp, tp, end, mp->m_sb.sb_rextents - 1, in xfs_rtallocate_range()
771 error = xfs_rtmodify_summary(mp, tp, in xfs_rtallocate_range()
773 XFS_BITTOBLOCK(mp, preblock), -1, rbpp, rsb); in xfs_rtallocate_range()
782 error = xfs_rtmodify_summary(mp, tp, in xfs_rtallocate_range()
784 XFS_BITTOBLOCK(mp, preblock), 1, rbpp, rsb); in xfs_rtallocate_range()
794 error = xfs_rtmodify_summary(mp, tp, in xfs_rtallocate_range()
796 XFS_BITTOBLOCK(mp, end + 1), 1, rbpp, rsb); in xfs_rtallocate_range()
804 error = xfs_rtmodify_range(mp, tp, start, len, 0); in xfs_rtallocate_range()
814 xfs_mount_t *mp, /* file system mount structure */ in xfs_rtany_summary() argument
834 error = xfs_rtget_summary(mp, tp, log, bbno, rbpp, rsb, &sum); in xfs_rtany_summary()
859 xfs_mount_t *mp, /* file system mount structure */ in xfs_rtbuf_get() argument
871 ip = issum ? mp->m_rsumip : mp->m_rbmip; in xfs_rtbuf_get()
884 d = XFS_FSB_TO_DADDR(mp, fsb); in xfs_rtbuf_get()
888 error = xfs_trans_read_buf(mp, tp, mp->m_ddev_targp, d, in xfs_rtbuf_get()
889 mp->m_bsize, 0, &bp); in xfs_rtbuf_get()
904 xfs_mount_t *mp, /* file system mount point */ in xfs_rtcheck_alloc_range() argument
912 return xfs_rtcheck_range(mp, tp, bno, len, 0, &new, stat); in xfs_rtcheck_alloc_range()
922 xfs_mount_t *mp, /* file system mount point */ in xfs_rtcheck_range() argument
945 block = XFS_BITTOBLOCK(mp, start); in xfs_rtcheck_range()
949 error = xfs_rtbuf_get(mp, tp, block, 0, &bp); in xfs_rtcheck_range()
957 word = XFS_BITTOWORD(mp, start); in xfs_rtcheck_range()
995 if (++word == XFS_BLOCKWSIZE(mp) && i < len) { in xfs_rtcheck_range()
1000 error = xfs_rtbuf_get(mp, tp, ++block, 0, &bp); in xfs_rtcheck_range()
1041 if (++word == XFS_BLOCKWSIZE(mp) && i < len) { in xfs_rtcheck_range()
1046 error = xfs_rtbuf_get(mp, tp, ++block, 0, &bp); in xfs_rtcheck_range()
1140 xfs_mount_t *mp, /* file system mount point */ in xfs_rtfind_back() argument
1163 block = XFS_BITTOBLOCK(mp, start); in xfs_rtfind_back()
1164 error = xfs_rtbuf_get(mp, tp, block, 0, &bp); in xfs_rtfind_back()
1172 word = XFS_BITTOWORD(mp, start); in xfs_rtfind_back()
1216 error = xfs_rtbuf_get(mp, tp, --block, 0, &bp); in xfs_rtfind_back()
1221 word = XFS_BLOCKWMASK(mp); in xfs_rtfind_back()
1262 error = xfs_rtbuf_get(mp, tp, --block, 0, &bp); in xfs_rtfind_back()
1267 word = XFS_BLOCKWMASK(mp); in xfs_rtfind_back()
1315 xfs_mount_t *mp, /* file system mount point */ in xfs_rtfind_forw() argument
1338 block = XFS_BITTOBLOCK(mp, start); in xfs_rtfind_forw()
1339 error = xfs_rtbuf_get(mp, tp, block, 0, &bp); in xfs_rtfind_forw()
1347 word = XFS_BITTOWORD(mp, start); in xfs_rtfind_forw()
1385 if (++word == XFS_BLOCKWSIZE(mp) && i < len) { in xfs_rtfind_forw()
1390 error = xfs_rtbuf_get(mp, tp, ++block, 0, &bp); in xfs_rtfind_forw()
1430 if (++word == XFS_BLOCKWSIZE(mp) && i < len) { in xfs_rtfind_forw()
1435 error = xfs_rtbuf_get(mp, tp, ++block, 0, &bp); in xfs_rtfind_forw()
1485 xfs_mount_t *mp, /* file system mount point */ in xfs_rtfree_range() argument
1501 error = xfs_rtmodify_range(mp, tp, start, len, 1); in xfs_rtfree_range()
1510 error = xfs_rtfind_back(mp, tp, start, 0, &preblock); in xfs_rtfree_range()
1517 error = xfs_rtfind_forw(mp, tp, end, mp->m_sb.sb_rextents - 1, in xfs_rtfree_range()
1524 error = xfs_rtmodify_summary(mp, tp, in xfs_rtfree_range()
1526 XFS_BITTOBLOCK(mp, preblock), -1, rbpp, rsb); in xfs_rtfree_range()
1536 error = xfs_rtmodify_summary(mp, tp, in xfs_rtfree_range()
1538 XFS_BITTOBLOCK(mp, end + 1), -1, rbpp, rsb); in xfs_rtfree_range()
1547 error = xfs_rtmodify_summary(mp, tp, in xfs_rtfree_range()
1549 XFS_BITTOBLOCK(mp, preblock), 1, rbpp, rsb); in xfs_rtfree_range()
1561 xfs_mount_t *mp, /* file system mount structure */ in xfs_rtget_summary() argument
1578 so = XFS_SUMOFFS(mp, log, bbno); in xfs_rtget_summary()
1582 sb = XFS_SUMOFFSTOBLOCK(mp, so); in xfs_rtget_summary()
1597 error = xfs_rtbuf_get(mp, tp, sb, 1, &bp); in xfs_rtget_summary()
1612 sp = XFS_SUMPTR(mp, bp, so); in xfs_rtget_summary()
1628 xfs_mount_t *mp, /* file system mount point */ in xfs_rtmodify_range() argument
1649 block = XFS_BITTOBLOCK(mp, start); in xfs_rtmodify_range()
1653 error = xfs_rtbuf_get(mp, tp, block, 0, &bp); in xfs_rtmodify_range()
1661 word = XFS_BITTOWORD(mp, start); in xfs_rtmodify_range()
1690 if (++word == XFS_BLOCKWSIZE(mp) && i < len) { in xfs_rtmodify_range()
1698 error = xfs_rtbuf_get(mp, tp, ++block, 0, &bp); in xfs_rtmodify_range()
1730 if (++word == XFS_BLOCKWSIZE(mp) && i < len) { in xfs_rtmodify_range()
1738 error = xfs_rtbuf_get(mp, tp, ++block, 0, &bp); in xfs_rtmodify_range()
1787 xfs_mount_t *mp, /* file system mount point */ in xfs_rtmodify_summary() argument
1804 so = XFS_SUMOFFS(mp, log, bbno); in xfs_rtmodify_summary()
1808 sb = XFS_SUMOFFSTOBLOCK(mp, so); in xfs_rtmodify_summary()
1823 error = xfs_rtbuf_get(mp, tp, sb, 1, &bp); in xfs_rtmodify_summary()
1838 sp = XFS_SUMPTR(mp, bp, so); in xfs_rtmodify_summary()
1854 xfs_mount_t *mp, /* mount point for filesystem */ in xfs_growfs_rt() argument
1875 sbp = &mp->m_sb; in xfs_growfs_rt()
1881 if (mp->m_rtdev_targp == NULL || mp->m_rbmip == NULL || in xfs_growfs_rt()
1890 error = xfs_read_buf(mp, mp->m_rtdev_targp, in xfs_growfs_rt()
1891 XFS_FSB_TO_BB(mp, nrblocks - 1), in xfs_growfs_rt()
1892 XFS_FSB_TO_BB(mp, 1), 0, &bp); in xfs_growfs_rt()
1906 nrsumblocks = XFS_B_TO_FSB(mp, nrsumsize); in xfs_growfs_rt()
1907 nrsumsize = XFS_FSB_TO_B(mp, nrsumblocks); in xfs_growfs_rt()
1913 if (nrsumblocks > (mp->m_sb.sb_logblocks >> 1)) in xfs_growfs_rt()
1919 rbmblocks = XFS_B_TO_FSB(mp, mp->m_rbmip->i_d.di_size); in xfs_growfs_rt()
1920 rsumblocks = XFS_B_TO_FSB(mp, mp->m_rsumip->i_d.di_size); in xfs_growfs_rt()
1924 if ((error = xfs_growfs_rt_alloc(mp, rbmblocks, nrbmblocks, in xfs_growfs_rt()
1925 mp->m_sb.sb_rbmino))) in xfs_growfs_rt()
1927 if ((error = xfs_growfs_rt_alloc(mp, rsumblocks, nrsumblocks, in xfs_growfs_rt()
1928 mp->m_sb.sb_rsumino))) in xfs_growfs_rt()
1941 ((sbp->sb_rextents & ((1 << mp->m_blkbit_log) - 1)) != 0); in xfs_growfs_rt()
1947 *nmp = *mp; in xfs_growfs_rt()
1966 nrsumblocks = XFS_B_TO_FSB(mp, nrsumsize); in xfs_growfs_rt()
1967 nmp->m_rsumsize = nrsumsize = XFS_FSB_TO_B(mp, nrsumblocks); in xfs_growfs_rt()
1971 tp = xfs_trans_alloc(mp, XFS_TRANS_GROWFSRT_FREE); in xfs_growfs_rt()
1978 if ((error = xfs_trans_iget(mp, tp, mp->m_sb.sb_rbmino, 0, in xfs_growfs_rt()
1981 ASSERT(ip == mp->m_rbmip); in xfs_growfs_rt()
1985 mp->m_rbmip->i_d.di_size = in xfs_growfs_rt()
1987 xfs_trans_log_inode(tp, mp->m_rbmip, XFS_ILOG_CORE); in xfs_growfs_rt()
1992 if ((error = xfs_trans_iget(mp, tp, mp->m_sb.sb_rsumino, 0, in xfs_growfs_rt()
1995 ASSERT(ip == mp->m_rsumip); in xfs_growfs_rt()
1999 mp->m_rsumip->i_d.di_size = nmp->m_rsumsize; in xfs_growfs_rt()
2000 xfs_trans_log_inode(tp, mp->m_rsumip, XFS_ILOG_CORE); in xfs_growfs_rt()
2006 mp->m_rsumlevels != nmp->m_rsumlevels) { in xfs_growfs_rt()
2007 error = xfs_rtcopy_summary(mp, nmp, tp); in xfs_growfs_rt()
2048 mp->m_rsumlevels = nrsumlevels; in xfs_growfs_rt()
2049 mp->m_rsumsize = nrsumsize; in xfs_growfs_rt()
2083 xfs_mount_t *mp; /* file system mount structure */ in xfs_rtallocate_extent() local
2089 mp = tp->t_mountp; in xfs_rtallocate_extent()
2108 if ((error = xfs_trans_iget(mp, tp, mp->m_sb.sb_rbmino, 0, in xfs_rtallocate_extent()
2117 error = xfs_rtallocate_extent_size(mp, tp, minlen, maxlen, len, in xfs_rtallocate_extent()
2121 error = xfs_rtallocate_extent_near(mp, tp, bno, minlen, maxlen, in xfs_rtallocate_extent()
2125 error = xfs_rtallocate_extent_exact(mp, tp, bno, minlen, maxlen, in xfs_rtallocate_extent()
2162 xfs_mount_t *mp; /* file system mount structure */ in xfs_rtfree_extent() local
2166 mp = tp->t_mountp; in xfs_rtfree_extent()
2170 if ((error = xfs_trans_iget(mp, tp, mp->m_sb.sb_rbmino, 0, in xfs_rtfree_extent()
2180 error = xfs_rtcheck_alloc_range(mp, tp, bno, len, &stat); in xfs_rtfree_extent()
2191 error = xfs_rtfree_range(mp, tp, bno, len, &sumbp, &sb); in xfs_rtfree_extent()
2203 if (tp->t_frextents_delta + mp->m_sb.sb_frextents == in xfs_rtfree_extent()
2204 mp->m_sb.sb_rextents) { in xfs_rtfree_extent()
2218 xfs_mount_t *mp) /* file system mount structure */ in xfs_rtmount_init() argument
2225 sbp = &mp->m_sb; in xfs_rtmount_init()
2228 if (mp->m_rtdev_targp == NULL) { in xfs_rtmount_init()
2233 mp->m_rsumlevels = sbp->sb_rextslog + 1; in xfs_rtmount_init()
2234 mp->m_rsumsize = in xfs_rtmount_init()
2235 (uint)sizeof(xfs_suminfo_t) * mp->m_rsumlevels * in xfs_rtmount_init()
2237 mp->m_rsumsize = roundup(mp->m_rsumsize, sbp->sb_blocksize); in xfs_rtmount_init()
2238 mp->m_rbmip = mp->m_rsumip = NULL; in xfs_rtmount_init()
2242 d = (xfs_daddr_t)XFS_FSB_TO_BB(mp, mp->m_sb.sb_rblocks); in xfs_rtmount_init()
2243 if (XFS_BB_TO_FSB(mp, d) != mp->m_sb.sb_rblocks) { in xfs_rtmount_init()
2245 (unsigned long long) XFS_BB_TO_FSB(mp, d), in xfs_rtmount_init()
2246 (unsigned long long) mp->m_sb.sb_rblocks); in xfs_rtmount_init()
2249 error = xfs_read_buf(mp, mp->m_rtdev_targp, in xfs_rtmount_init()
2250 d - XFS_FSB_TO_BB(mp, 1), in xfs_rtmount_init()
2251 XFS_FSB_TO_BB(mp, 1), 0, &bp); in xfs_rtmount_init()
2269 xfs_mount_t *mp) /* file system mount structure */ in xfs_rtmount_inodes() argument
2274 sbp = &mp->m_sb; in xfs_rtmount_inodes()
2277 error = xfs_iget(mp, NULL, sbp->sb_rbmino, 0, 0, &mp->m_rbmip, 0); in xfs_rtmount_inodes()
2280 ASSERT(mp->m_rbmip != NULL); in xfs_rtmount_inodes()
2282 error = xfs_iget(mp, NULL, sbp->sb_rsumino, 0, 0, &mp->m_rsumip, 0); in xfs_rtmount_inodes()
2284 IRELE(mp->m_rbmip); in xfs_rtmount_inodes()
2287 ASSERT(mp->m_rsumip != NULL); in xfs_rtmount_inodes()
2300 xfs_mount_t *mp, /* file system mount point */ in xfs_rtpick_extent() argument
2313 if ((error = xfs_trans_iget(mp, tp, mp->m_sb.sb_rbmino, 0, in xfs_rtpick_extent()
2316 ASSERT(ip == mp->m_rbmip); in xfs_rtpick_extent()
2327 b = (mp->m_sb.sb_rextents * ((resid << 1) + 1ULL)) >> in xfs_rtpick_extent()
2329 if (b >= mp->m_sb.sb_rextents) in xfs_rtpick_extent()
2330 b = do_mod(b, mp->m_sb.sb_rextents); in xfs_rtpick_extent()
2331 if (b + len > mp->m_sb.sb_rextents) in xfs_rtpick_extent()
2332 b = mp->m_sb.sb_rextents - len; in xfs_rtpick_extent()