Lines Matching refs:got
1235 struct xfs_bmbt_irec got;
1253 for_each_xfs_iext(ifp, &icur, &got) {
1257 if (got.br_startoff >= lowest + len &&
1258 got.br_startoff - max >= len)
1260 lastaddr = got.br_startoff + got.br_blockcount;
1282 struct xfs_bmbt_irec got;
1302 if (!xfs_iext_lookup_extent_before(ip, ifp, last_block, &icur, &got))
1416 struct xfs_bmbt_irec *new = &bma->got;
3133 if (!isnullstartblock(ap->got.br_startblock)) {
3137 adjust = gotdiff = ap->got.br_startoff - ap->offset;
3142 gotbno = ap->got.br_startblock;
3219 * use the best as the minimum, otherwise we've got the maxlen we
3332 if (xfs_bmap_extsize_align(mp, &ap->got, &ap->prev, align, 0,
3767 struct xfs_bmbt_irec *got,
3776 got->br_startoff + got->br_blockcount <= obno) {
3777 *mval = *got;
3778 if (isnullstartblock(got->br_startblock))
3788 if (isnullstartblock(got->br_startblock))
3791 mval->br_startblock = got->br_startblock +
3792 (*bno - got->br_startoff);
3794 * Return the minimum of what we got and what we asked for for
3801 got->br_blockcount - (*bno - got->br_startoff));
3802 mval->br_state = got->br_state;
3876 struct xfs_bmbt_irec got;
3904 if (!xfs_iext_lookup_extent(ip, ifp, bno, &icur, &got))
3912 got.br_startoff = end;
3913 if (got.br_startoff > bno) {
3918 XFS_FILBLKS_MIN(len, got.br_startoff - bno);
3928 xfs_bmapi_trim_map(mval, &got, &bno, len, obno, end, n, flags);
3936 if (!xfs_iext_next_extent(ifp, &icur, &got))
3947 * On entry, got refers to the first extent beyond the offset of the extent to
3948 * allocate or eof is specified if no such extent exists. On return, got refers
3952 * during insertion into the inode fork. Thus, got does not reflect the current
3963 struct xfs_bmbt_irec *got,
3980 alen = XFS_FILBLKS_MIN(alen, got->br_startoff - aoff);
3992 error = xfs_bmap_extsize_align(mp, got, &prev, extsz, 0, eof,
4025 got->br_startoff = aoff;
4026 got->br_startblock = nullstartblock(indlen);
4027 got->br_blockcount = alen;
4028 got->br_state = XFS_EXT_NORM;
4030 xfs_bmap_add_extent_hole_delay(ip, whichfork, icur, got);
4106 bma->length = (xfs_extlen_t)bma->got.br_blockcount;
4107 bma->offset = bma->got.br_startoff;
4114 bma->got.br_startoff - bma->offset);
4152 bma->got.br_startoff = bma->offset;
4153 bma->got.br_startblock = bma->blkno;
4154 bma->got.br_blockcount = bma->length;
4155 bma->got.br_state = XFS_EXT_NORM;
4158 bma->got.br_state = XFS_EXT_UNWRITTEN;
4164 whichfork, &bma->icur, &bma->cur, &bma->got,
4176 xfs_iext_get_extent(ifp, &bma->icur, &bma->got);
4178 ASSERT(bma->got.br_startoff <= bma->offset);
4179 ASSERT(bma->got.br_startoff + bma->got.br_blockcount >=
4181 ASSERT(bma->got.br_state == XFS_EXT_NORM ||
4182 bma->got.br_state == XFS_EXT_UNWRITTEN);
4254 xfs_iext_get_extent(ifp, &bma->icur, &bma->got);
4386 if (!xfs_iext_lookup_extent(ip, ifp, bno, &bma.icur, &bma.got))
4399 if (eof || bma.got.br_startoff > bno) {
4409 } else if (isnullstartblock(bma.got.br_startblock)) {
4454 xfs_bmapi_trim_map(mval, &bma.got, &bno, len, obno,
4476 bma.prev = bma.got;
4477 if (!xfs_iext_next_extent(ifp, &bma.icur, &bma.got))
4543 if (!xfs_iext_lookup_extent(ip, ifp, offset_fsb, &bma.icur, &bma.got) ||
4544 bma.got.br_startoff > offset_fsb) {
4559 if (!isnullstartblock(bma.got.br_startblock)) {
4560 xfs_bmbt_to_iomap(ip, iomap, &bma.got, 0, flags,
4569 bma.offset = bma.got.br_startoff;
4570 bma.length = max_t(xfs_filblks_t, bma.got.br_blockcount,
4602 if (WARN_ON_ONCE(!xfs_valid_startblock(ip, bma.got.br_startblock)))
4608 ASSERT(!isnullstartblock(bma.got.br_startblock));
4609 xfs_bmbt_to_iomap(ip, iomap, &bma.got, 0, flags,
4646 struct xfs_bmbt_irec got;
4672 if (xfs_iext_lookup_extent(ip, ifp, bno, &icur, &got)) {
4674 ASSERT(got.br_startoff > bno);
4675 ASSERT(got.br_startoff - bno >= len);
4686 got.br_startoff = bno;
4687 got.br_startblock = startblock;
4688 got.br_blockcount = len;
4690 got.br_state = XFS_EXT_UNWRITTEN;
4692 got.br_state = XFS_EXT_NORM;
4695 &cur, &got, &logflags, flags);
4804 struct xfs_bmbt_irec *got,
4821 got_endoff = got->br_startoff + got->br_blockcount;
4822 da_old = startblockval(got->br_startblock);
4826 ASSERT(got->br_startoff <= del->br_startoff);
4847 if (got->br_startoff == del->br_startoff)
4864 got->br_startoff = del_endoff;
4865 got->br_blockcount -= del->br_blockcount;
4867 got->br_blockcount), da_old);
4868 got->br_startblock = nullstartblock((int)da_new);
4869 xfs_iext_update_extent(ip, state, icur, got);
4875 got->br_blockcount = got->br_blockcount - del->br_blockcount;
4877 got->br_blockcount), da_old);
4878 got->br_startblock = nullstartblock((int)da_new);
4879 xfs_iext_update_extent(ip, state, icur, got);
4891 got->br_blockcount = del->br_startoff - got->br_startoff;
4892 got_indlen = xfs_bmap_worst_indlen(ip, got->br_blockcount);
4901 got->br_startblock = nullstartblock((int)got_indlen);
4904 new.br_state = got->br_state;
4907 xfs_iext_update_extent(ip, state, icur, got);
4931 struct xfs_bmbt_irec *got,
4943 got_endoff = got->br_startoff + got->br_blockcount;
4946 ASSERT(got->br_startoff <= del->br_startoff);
4948 ASSERT(!isnullstartblock(got->br_startblock));
4950 if (got->br_startoff == del->br_startoff)
4967 got->br_startoff = del_endoff;
4968 got->br_blockcount -= del->br_blockcount;
4969 got->br_startblock = del->br_startblock + del->br_blockcount;
4970 xfs_iext_update_extent(ip, state, icur, got);
4976 got->br_blockcount -= del->br_blockcount;
4977 xfs_iext_update_extent(ip, state, icur, got);
4983 got->br_blockcount = del->br_startoff - got->br_startoff;
4987 new.br_state = got->br_state;
4990 xfs_iext_update_extent(ip, state, icur, got);
5018 struct xfs_bmbt_irec got; /* current extent entry */
5019 xfs_fileoff_t got_endoff; /* first offset past got */
5035 xfs_iext_get_extent(ifp, icur, &got);
5036 ASSERT(got.br_startoff <= del->br_startoff);
5038 got_endoff = got.br_startoff + got.br_blockcount;
5040 ASSERT(!isnullstartblock(got.br_startblock));
5055 del->br_startoff > got.br_startoff && del_endoff < got_endoff)
5077 error = xfs_bmbt_lookup_eq(cur, &got, &i);
5086 if (got.br_startoff == del->br_startoff)
5116 got.br_startoff = del_endoff;
5117 got.br_startblock = del_endblock;
5118 got.br_blockcount -= del->br_blockcount;
5119 xfs_iext_update_extent(ip, state, icur, &got);
5124 error = xfs_bmbt_update(cur, &got);
5132 got.br_blockcount -= del->br_blockcount;
5133 xfs_iext_update_extent(ip, state, icur, &got);
5138 error = xfs_bmbt_update(cur, &got);
5147 old = got;
5149 got.br_blockcount = del->br_startoff - got.br_startoff;
5150 xfs_iext_update_extent(ip, state, icur, &got);
5154 new.br_state = got.br_state;
5159 error = xfs_bmbt_update(cur, &got);
5179 error = xfs_bmbt_lookup_eq(cur, &got, &i);
5270 struct xfs_bmbt_irec got; /* current extent record */
5311 if (!xfs_iext_lookup_extent_before(ip, ifp, &end, &icur, &got)) {
5342 if (got.br_startoff > end &&
5343 !xfs_iext_prev_extent(ifp, &icur, &got)) {
5352 got.br_startoff + got.br_blockcount - 1);
5359 del = got;
5362 if (got.br_startoff < start) {
5364 del.br_blockcount -= start - got.br_startoff;
5366 del.br_startblock += start - got.br_startoff;
5392 if (end < got.br_startoff &&
5393 !xfs_iext_prev_extent(ifp, &icur, &got)) {
5444 if (got.br_startoff > end &&
5445 !xfs_iext_prev_extent(ifp, &icur, &got)) {
5495 &got, &del);
5512 if (!xfs_iext_get_extent(ifp, &icur, &got) ||
5513 (got.br_startoff > end &&
5514 !xfs_iext_prev_extent(ifp, &icur, &got))) {
5589 struct xfs_bmbt_irec *got, /* current extent to shift */
5594 startoff = got->br_startoff - shift;
5601 (left->br_startblock + left->br_blockcount != got->br_startblock) ||
5602 (left->br_state != got->br_state) ||
5603 (left->br_blockcount + got->br_blockcount > XFS_MAX_BMBT_EXTLEN))
5625 struct xfs_bmbt_irec *got, /* extent to shift */
5636 blockcount = left->br_blockcount + got->br_blockcount;
5640 ASSERT(xfs_bmse_can_merge(left, got, shift));
5657 error = xfs_bmbt_lookup_eq(cur, got, &i);
5692 xfs_rmap_unmap_extent(tp, ip, whichfork, got);
5693 memcpy(&new, got, sizeof(new));
5705 struct xfs_bmbt_irec *got,
5711 struct xfs_bmbt_irec prev = *got;
5716 got->br_startoff = startoff;
5725 error = xfs_bmbt_update(cur, got);
5733 got);
5737 xfs_rmap_map_extent(tp, ip, whichfork, got);
5753 struct xfs_bmbt_irec got, prev;
5778 if (!xfs_iext_lookup_extent(ip, ifp, *next_fsb, &icur, &got)) {
5782 if (XFS_IS_CORRUPT(mp, isnullstartblock(got.br_startblock))) {
5787 new_startoff = got.br_startoff - offset_shift_fsb;
5794 if (xfs_bmse_can_merge(&prev, &got, offset_shift_fsb)) {
5796 offset_shift_fsb, &icur, &got, &prev,
5803 if (got.br_startoff < offset_shift_fsb) {
5809 error = xfs_bmap_shift_update_extent(tp, ip, whichfork, &icur, &got,
5815 if (!xfs_iext_next_extent(ifp, &icur, &got)) {
5820 *next_fsb = got.br_startoff;
5836 struct xfs_bmbt_irec got;
5846 error = xfs_bmap_last_extent(NULL, ip, XFS_DATA_FORK, &got, &is_empty);
5847 if (!error && !is_empty && got.br_startoff >= off &&
5848 ((got.br_startoff + shift) & BMBT_STARTOFF_MASK) < got.br_startoff)
5868 struct xfs_bmbt_irec got, next;
5895 if (!xfs_iext_get_extent(ifp, &icur, &got) ||
5896 stop_fsb > got.br_startoff) {
5901 if (!xfs_iext_lookup_extent(ip, ifp, *next_fsb, &icur, &got)) {
5906 if (XFS_IS_CORRUPT(mp, isnullstartblock(got.br_startblock))) {
5911 if (XFS_IS_CORRUPT(mp, stop_fsb > got.br_startoff)) {
5916 new_startoff = got.br_startoff + offset_shift_fsb;
5918 if (new_startoff + got.br_blockcount > next.br_startoff) {
5929 if (xfs_bmse_can_merge(&got, &next, offset_shift_fsb))
5933 error = xfs_bmap_shift_update_extent(tp, ip, whichfork, &icur, &got,
5938 if (!xfs_iext_prev_extent(ifp, &icur, &got) ||
5939 stop_fsb >= got.br_startoff + got.br_blockcount) {
5944 *next_fsb = got.br_startoff;
5968 struct xfs_bmbt_irec got;
5971 xfs_fsblock_t gotblkcnt; /* new block count for got */
5993 if (!xfs_iext_lookup_extent(ip, ifp, split_fsb, &icur, &got) ||
5994 got.br_startoff >= split_fsb)
5997 gotblkcnt = split_fsb - got.br_startoff;
5999 new.br_startblock = got.br_startblock + gotblkcnt;
6000 new.br_blockcount = got.br_blockcount - gotblkcnt;
6001 new.br_state = got.br_state;
6006 error = xfs_bmbt_lookup_eq(cur, &got, &i);
6015 got.br_blockcount = gotblkcnt;
6017 &got);
6021 error = xfs_bmbt_update(cur, &got);