Lines Matching +full:ip +full:- +full:blocks

1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Copyright (C) 2020-2023 Oracle. All Rights Reserved.
32 struct xfs_mount *mp = sc->mp; in xrep_setup_rtbitmap()
33 unsigned long long blocks = 0; in xrep_setup_rtbitmap() local
36 * Reserve enough blocks to write out a completely new bmbt for a in xrep_setup_rtbitmap()
40 blocks = xfs_bmbt_calc_size(mp, mp->m_sb.sb_rbmblocks); in xrep_setup_rtbitmap()
41 if (blocks > UINT_MAX) in xrep_setup_rtbitmap()
42 return -EOPNOTSUPP; in xrep_setup_rtbitmap()
44 rtb->resblks += blocks; in xrep_setup_rtbitmap()
50 * mapped to written blocks. The caller must ensure that the inode is joined
62 ASSERT(sc->ip != NULL); in xrep_rtbitmap_data_mappings()
71 error = xfs_bmapi_read(sc->ip, off, len - off, &map, &nmaps, in xrep_rtbitmap_data_mappings()
77 return -EFSCORRUPTED; in xrep_rtbitmap_data_mappings()
95 return -EFSCORRUPTED; in xrep_rtbitmap_data_mappings()
100 return -EFSCORRUPTED; in xrep_rtbitmap_data_mappings()
105 error = xfs_bmapi_write(sc->tp, sc->ip, map.br_startoff, in xrep_rtbitmap_data_mappings()
129 struct xfs_mount *mp = sc->mp; in xrep_rtbitmap_geometry()
130 struct xfs_trans *tp = sc->tp; in xrep_rtbitmap_geometry()
133 if (mp->m_sb.sb_rextents != rtb->rextents) in xrep_rtbitmap_geometry()
134 xfs_trans_mod_sb(sc->tp, XFS_TRANS_SB_REXTENTS, in xrep_rtbitmap_geometry()
135 rtb->rextents - mp->m_sb.sb_rextents); in xrep_rtbitmap_geometry()
137 if (mp->m_sb.sb_rbmblocks != rtb->rbmblocks) in xrep_rtbitmap_geometry()
139 rtb->rbmblocks - mp->m_sb.sb_rbmblocks); in xrep_rtbitmap_geometry()
141 if (mp->m_sb.sb_rextslog != rtb->rextslog) in xrep_rtbitmap_geometry()
143 rtb->rextslog - mp->m_sb.sb_rextslog); in xrep_rtbitmap_geometry()
146 sc->ip->i_disk_size = roundup_64(sc->ip->i_disk_size, in xrep_rtbitmap_geometry()
147 mp->m_sb.sb_blocksize); in xrep_rtbitmap_geometry()
149 if (sc->ip->i_disk_size < XFS_FSB_TO_B(mp, rtb->rbmblocks)) in xrep_rtbitmap_geometry()
150 sc->ip->i_disk_size = XFS_FSB_TO_B(mp, rtb->rbmblocks); in xrep_rtbitmap_geometry()
152 xfs_trans_log_inode(sc->tp, sc->ip, XFS_ILOG_CORE); in xrep_rtbitmap_geometry()
161 struct xchk_rtbitmap *rtb = sc->buf; in xrep_rtbitmap()
162 struct xfs_mount *mp = sc->mp; in xrep_rtbitmap()
163 unsigned long long blocks = 0; in xrep_rtbitmap() local
167 if (rtb->rbmblocks > U32_MAX) in xrep_rtbitmap()
175 blocks = xfs_bmbt_calc_size(mp, rtb->rbmblocks); in xrep_rtbitmap()
176 if (blocks > UINT_MAX) in xrep_rtbitmap()
177 return -EOPNOTSUPP; in xrep_rtbitmap()
178 if (blocks > rtb->resblks) { in xrep_rtbitmap()
179 error = xfs_trans_reserve_more(sc->tp, blocks, 0); in xrep_rtbitmap()
183 rtb->resblks += blocks; in xrep_rtbitmap()
191 xfs_trans_ijoin(sc->tp, sc->ip, 0); in xrep_rtbitmap()
194 error = xrep_rtbitmap_data_mappings(sc, rtb->rbmblocks); in xrep_rtbitmap()