Lines Matching refs:got
1314 struct xfs_bmbt_irec got; in xfs_bmap_first_unused() local
1336 for_each_xfs_iext(ifp, &icur, &got) { in xfs_bmap_first_unused()
1340 if (got.br_startoff >= lowest + len && in xfs_bmap_first_unused()
1341 got.br_startoff - max >= len) in xfs_bmap_first_unused()
1343 lastaddr = got.br_startoff + got.br_blockcount; in xfs_bmap_first_unused()
1365 struct xfs_bmbt_irec got; in xfs_bmap_last_before() local
1386 if (!xfs_iext_lookup_extent_before(ip, ifp, last_block, &icur, &got)) in xfs_bmap_last_before()
1533 struct xfs_bmbt_irec *new = &bma->got; in xfs_bmap_add_extent_delay_real()
3139 if (!isnullstartblock(ap->got.br_startblock)) { in xfs_bmap_adjacent()
3143 adjust = gotdiff = ap->got.br_startoff - ap->offset; in xfs_bmap_adjacent()
3148 gotbno = ap->got.br_startblock; in xfs_bmap_adjacent()
3417 error = xfs_bmap_extsize_align(mp, &ap->got, &ap->prev, in xfs_bmap_btalloc()
3696 struct xfs_bmbt_irec *got, in xfs_bmapi_trim_map() argument
3705 got->br_startoff + got->br_blockcount <= obno) { in xfs_bmapi_trim_map()
3706 *mval = *got; in xfs_bmapi_trim_map()
3707 if (isnullstartblock(got->br_startblock)) in xfs_bmapi_trim_map()
3717 if (isnullstartblock(got->br_startblock)) in xfs_bmapi_trim_map()
3720 mval->br_startblock = got->br_startblock + in xfs_bmapi_trim_map()
3721 (*bno - got->br_startoff); in xfs_bmapi_trim_map()
3730 got->br_blockcount - (*bno - got->br_startoff)); in xfs_bmapi_trim_map()
3731 mval->br_state = got->br_state; in xfs_bmapi_trim_map()
3804 struct xfs_bmbt_irec got; in xfs_bmapi_read() local
3862 if (!xfs_iext_lookup_extent(ip, ifp, bno, &icur, &got)) in xfs_bmapi_read()
3870 got.br_startoff = end; in xfs_bmapi_read()
3871 if (got.br_startoff > bno) { in xfs_bmapi_read()
3876 XFS_FILBLKS_MIN(len, got.br_startoff - bno); in xfs_bmapi_read()
3886 xfs_bmapi_trim_map(mval, &got, &bno, len, obno, end, n, flags); in xfs_bmapi_read()
3894 if (!xfs_iext_next_extent(ifp, &icur, &got)) in xfs_bmapi_read()
3921 struct xfs_bmbt_irec *got, in xfs_bmapi_reserve_delalloc() argument
3938 alen = XFS_FILBLKS_MIN(alen, got->br_startoff - aoff); in xfs_bmapi_reserve_delalloc()
3950 error = xfs_bmap_extsize_align(mp, got, &prev, extsz, 0, eof, in xfs_bmapi_reserve_delalloc()
3984 got->br_startoff = aoff; in xfs_bmapi_reserve_delalloc()
3985 got->br_startblock = nullstartblock(indlen); in xfs_bmapi_reserve_delalloc()
3986 got->br_blockcount = alen; in xfs_bmapi_reserve_delalloc()
3987 got->br_state = XFS_EXT_NORM; in xfs_bmapi_reserve_delalloc()
3989 xfs_bmap_add_extent_hole_delay(ip, whichfork, icur, got); in xfs_bmapi_reserve_delalloc()
4029 bma->length = (xfs_extlen_t)bma->got.br_blockcount; in xfs_bmapi_allocate()
4030 bma->offset = bma->got.br_startoff; in xfs_bmapi_allocate()
4036 bma->got.br_startoff - bma->offset); in xfs_bmapi_allocate()
4088 bma->got.br_startoff = bma->offset; in xfs_bmapi_allocate()
4089 bma->got.br_startblock = bma->blkno; in xfs_bmapi_allocate()
4090 bma->got.br_blockcount = bma->length; in xfs_bmapi_allocate()
4091 bma->got.br_state = XFS_EXT_NORM; in xfs_bmapi_allocate()
4104 bma->got.br_state = XFS_EXT_UNWRITTEN; in xfs_bmapi_allocate()
4110 whichfork, &bma->icur, &bma->cur, &bma->got, in xfs_bmapi_allocate()
4122 xfs_iext_get_extent(ifp, &bma->icur, &bma->got); in xfs_bmapi_allocate()
4124 ASSERT(bma->got.br_startoff <= bma->offset); in xfs_bmapi_allocate()
4125 ASSERT(bma->got.br_startoff + bma->got.br_blockcount >= in xfs_bmapi_allocate()
4127 ASSERT(bma->got.br_state == XFS_EXT_NORM || in xfs_bmapi_allocate()
4128 bma->got.br_state == XFS_EXT_UNWRITTEN); in xfs_bmapi_allocate()
4200 xfs_iext_get_extent(ifp, &bma->icur, &bma->got); in xfs_bmapi_convert_unwritten()
4336 if (!xfs_iext_lookup_extent(ip, ifp, bno, &bma.icur, &bma.got)) in xfs_bmapi_write()
4349 if (eof || bma.got.br_startoff > bno) { in xfs_bmapi_write()
4359 } else if (isnullstartblock(bma.got.br_startblock)) { in xfs_bmapi_write()
4404 xfs_bmapi_trim_map(mval, &bma.got, &bno, len, obno, in xfs_bmapi_write()
4426 bma.prev = bma.got; in xfs_bmapi_write()
4427 if (!xfs_iext_next_extent(ifp, &bma.icur, &bma.got)) in xfs_bmapi_write()
4481 if (!xfs_iext_lookup_extent(ip, ifp, offset_fsb, &bma.icur, &bma.got) || in xfs_bmapi_convert_delalloc()
4482 bma.got.br_startoff > offset_fsb) { in xfs_bmapi_convert_delalloc()
4497 if (!isnullstartblock(bma.got.br_startblock)) { in xfs_bmapi_convert_delalloc()
4498 *imap = bma.got; in xfs_bmapi_convert_delalloc()
4506 bma.offset = bma.got.br_startoff; in xfs_bmapi_convert_delalloc()
4507 bma.length = max_t(xfs_filblks_t, bma.got.br_blockcount, MAXEXTLEN); in xfs_bmapi_convert_delalloc()
4524 if (WARN_ON_ONCE(!xfs_valid_startblock(ip, bma.got.br_startblock))) in xfs_bmapi_convert_delalloc()
4530 ASSERT(!isnullstartblock(bma.got.br_startblock)); in xfs_bmapi_convert_delalloc()
4531 *imap = bma.got; in xfs_bmapi_convert_delalloc()
4567 struct xfs_bmbt_irec got; in xfs_bmapi_remap() local
4598 if (xfs_iext_lookup_extent(ip, ifp, bno, &icur, &got)) { in xfs_bmapi_remap()
4600 ASSERT(got.br_startoff > bno); in xfs_bmapi_remap()
4601 ASSERT(got.br_startoff - bno >= len); in xfs_bmapi_remap()
4612 got.br_startoff = bno; in xfs_bmapi_remap()
4613 got.br_startblock = startblock; in xfs_bmapi_remap()
4614 got.br_blockcount = len; in xfs_bmapi_remap()
4616 got.br_state = XFS_EXT_UNWRITTEN; in xfs_bmapi_remap()
4618 got.br_state = XFS_EXT_NORM; in xfs_bmapi_remap()
4621 &cur, &got, &logflags, flags); in xfs_bmapi_remap()
4730 struct xfs_bmbt_irec *got, in xfs_bmap_del_extent_delay() argument
4747 got_endoff = got->br_startoff + got->br_blockcount; in xfs_bmap_del_extent_delay()
4748 da_old = startblockval(got->br_startblock); in xfs_bmap_del_extent_delay()
4752 ASSERT(got->br_startoff <= del->br_startoff); in xfs_bmap_del_extent_delay()
4774 if (got->br_startoff == del->br_startoff) in xfs_bmap_del_extent_delay()
4791 got->br_startoff = del_endoff; in xfs_bmap_del_extent_delay()
4792 got->br_blockcount -= del->br_blockcount; in xfs_bmap_del_extent_delay()
4794 got->br_blockcount), da_old); in xfs_bmap_del_extent_delay()
4795 got->br_startblock = nullstartblock((int)da_new); in xfs_bmap_del_extent_delay()
4796 xfs_iext_update_extent(ip, state, icur, got); in xfs_bmap_del_extent_delay()
4802 got->br_blockcount = got->br_blockcount - del->br_blockcount; in xfs_bmap_del_extent_delay()
4804 got->br_blockcount), da_old); in xfs_bmap_del_extent_delay()
4805 got->br_startblock = nullstartblock((int)da_new); in xfs_bmap_del_extent_delay()
4806 xfs_iext_update_extent(ip, state, icur, got); in xfs_bmap_del_extent_delay()
4818 got->br_blockcount = del->br_startoff - got->br_startoff; in xfs_bmap_del_extent_delay()
4819 got_indlen = xfs_bmap_worst_indlen(ip, got->br_blockcount); in xfs_bmap_del_extent_delay()
4828 got->br_startblock = nullstartblock((int)got_indlen); in xfs_bmap_del_extent_delay()
4831 new.br_state = got->br_state; in xfs_bmap_del_extent_delay()
4834 xfs_iext_update_extent(ip, state, icur, got); in xfs_bmap_del_extent_delay()
4858 struct xfs_bmbt_irec *got, in xfs_bmap_del_extent_cow() argument
4870 got_endoff = got->br_startoff + got->br_blockcount; in xfs_bmap_del_extent_cow()
4873 ASSERT(got->br_startoff <= del->br_startoff); in xfs_bmap_del_extent_cow()
4875 ASSERT(!isnullstartblock(got->br_startblock)); in xfs_bmap_del_extent_cow()
4877 if (got->br_startoff == del->br_startoff) in xfs_bmap_del_extent_cow()
4894 got->br_startoff = del_endoff; in xfs_bmap_del_extent_cow()
4895 got->br_blockcount -= del->br_blockcount; in xfs_bmap_del_extent_cow()
4896 got->br_startblock = del->br_startblock + del->br_blockcount; in xfs_bmap_del_extent_cow()
4897 xfs_iext_update_extent(ip, state, icur, got); in xfs_bmap_del_extent_cow()
4903 got->br_blockcount -= del->br_blockcount; in xfs_bmap_del_extent_cow()
4904 xfs_iext_update_extent(ip, state, icur, got); in xfs_bmap_del_extent_cow()
4910 got->br_blockcount = del->br_startoff - got->br_startoff; in xfs_bmap_del_extent_cow()
4914 new.br_state = got->br_state; in xfs_bmap_del_extent_cow()
4917 xfs_iext_update_extent(ip, state, icur, got); in xfs_bmap_del_extent_cow()
4945 struct xfs_bmbt_irec got; /* current extent entry */ in xfs_bmap_del_extent_real() local
4962 xfs_iext_get_extent(ifp, icur, &got); in xfs_bmap_del_extent_real()
4963 ASSERT(got.br_startoff <= del->br_startoff); in xfs_bmap_del_extent_real()
4965 got_endoff = got.br_startoff + got.br_blockcount; in xfs_bmap_del_extent_real()
4967 ASSERT(!isnullstartblock(got.br_startblock)); in xfs_bmap_del_extent_real()
4983 del->br_startoff > got.br_startoff && del_endoff < got_endoff) in xfs_bmap_del_extent_real()
5013 error = xfs_bmbt_lookup_eq(cur, &got, &i); in xfs_bmap_del_extent_real()
5019 if (got.br_startoff == del->br_startoff) in xfs_bmap_del_extent_real()
5046 got.br_startoff = del_endoff; in xfs_bmap_del_extent_real()
5047 got.br_startblock = del_endblock; in xfs_bmap_del_extent_real()
5048 got.br_blockcount -= del->br_blockcount; in xfs_bmap_del_extent_real()
5049 xfs_iext_update_extent(ip, state, icur, &got); in xfs_bmap_del_extent_real()
5054 error = xfs_bmbt_update(cur, &got); in xfs_bmap_del_extent_real()
5062 got.br_blockcount -= del->br_blockcount; in xfs_bmap_del_extent_real()
5063 xfs_iext_update_extent(ip, state, icur, &got); in xfs_bmap_del_extent_real()
5068 error = xfs_bmbt_update(cur, &got); in xfs_bmap_del_extent_real()
5076 old = got; in xfs_bmap_del_extent_real()
5078 got.br_blockcount = del->br_startoff - got.br_startoff; in xfs_bmap_del_extent_real()
5079 xfs_iext_update_extent(ip, state, icur, &got); in xfs_bmap_del_extent_real()
5083 new.br_state = got.br_state; in xfs_bmap_del_extent_real()
5088 error = xfs_bmbt_update(cur, &got); in xfs_bmap_del_extent_real()
5108 error = xfs_bmbt_lookup_eq(cur, &got, &i); in xfs_bmap_del_extent_real()
5190 struct xfs_bmbt_irec got; /* current extent record */ in __xfs_bunmapi() local
5248 if (!xfs_iext_lookup_extent_before(ip, ifp, &end, &icur, &got)) { in __xfs_bunmapi()
5279 if (got.br_startoff > end && in __xfs_bunmapi()
5280 !xfs_iext_prev_extent(ifp, &icur, &got)) { in __xfs_bunmapi()
5289 got.br_startoff + got.br_blockcount - 1); in __xfs_bunmapi()
5296 del = got; in __xfs_bunmapi()
5309 if (got.br_startoff < start) { in __xfs_bunmapi()
5311 del.br_blockcount -= start - got.br_startoff; in __xfs_bunmapi()
5313 del.br_startblock += start - got.br_startoff; in __xfs_bunmapi()
5347 if (end < got.br_startoff && in __xfs_bunmapi()
5348 !xfs_iext_prev_extent(ifp, &icur, &got)) { in __xfs_bunmapi()
5398 if (got.br_startoff > end && in __xfs_bunmapi()
5399 !xfs_iext_prev_extent(ifp, &icur, &got)) { in __xfs_bunmapi()
5447 &got, &del); in __xfs_bunmapi()
5465 if (!xfs_iext_get_extent(ifp, &icur, &got) || in __xfs_bunmapi()
5466 (got.br_startoff > end && in __xfs_bunmapi()
5467 !xfs_iext_prev_extent(ifp, &icur, &got))) { in __xfs_bunmapi()
5542 struct xfs_bmbt_irec *got, /* current extent to shift */ in xfs_bmse_can_merge() argument
5547 startoff = got->br_startoff - shift; in xfs_bmse_can_merge()
5554 (left->br_startblock + left->br_blockcount != got->br_startblock) || in xfs_bmse_can_merge()
5555 (left->br_state != got->br_state) || in xfs_bmse_can_merge()
5556 (left->br_blockcount + got->br_blockcount > MAXEXTLEN)) in xfs_bmse_can_merge()
5578 struct xfs_bmbt_irec *got, /* extent to shift */ in xfs_bmse_merge() argument
5588 blockcount = left->br_blockcount + got->br_blockcount; in xfs_bmse_merge()
5592 ASSERT(xfs_bmse_can_merge(left, got, shift)); in xfs_bmse_merge()
5610 error = xfs_bmbt_lookup_eq(cur, got, &i); in xfs_bmse_merge()
5642 xfs_rmap_unmap_extent(tp, ip, whichfork, got); in xfs_bmse_merge()
5643 memcpy(&new, got, sizeof(new)); in xfs_bmse_merge()
5655 struct xfs_bmbt_irec *got, in xfs_bmap_shift_update_extent() argument
5661 struct xfs_bmbt_irec prev = *got; in xfs_bmap_shift_update_extent()
5666 got->br_startoff = startoff; in xfs_bmap_shift_update_extent()
5674 error = xfs_bmbt_update(cur, got); in xfs_bmap_shift_update_extent()
5682 got); in xfs_bmap_shift_update_extent()
5686 xfs_rmap_map_extent(tp, ip, whichfork, got); in xfs_bmap_shift_update_extent()
5702 struct xfs_bmbt_irec got, prev; in xfs_bmap_collapse_extents() local
5732 if (!xfs_iext_lookup_extent(ip, ifp, *next_fsb, &icur, &got)) { in xfs_bmap_collapse_extents()
5736 XFS_WANT_CORRUPTED_GOTO(mp, !isnullstartblock(got.br_startblock), in xfs_bmap_collapse_extents()
5739 new_startoff = got.br_startoff - offset_shift_fsb; in xfs_bmap_collapse_extents()
5746 if (xfs_bmse_can_merge(&prev, &got, offset_shift_fsb)) { in xfs_bmap_collapse_extents()
5748 offset_shift_fsb, &icur, &got, &prev, in xfs_bmap_collapse_extents()
5755 if (got.br_startoff < offset_shift_fsb) { in xfs_bmap_collapse_extents()
5761 error = xfs_bmap_shift_update_extent(tp, ip, whichfork, &icur, &got, in xfs_bmap_collapse_extents()
5767 if (!xfs_iext_next_extent(ifp, &icur, &got)) { in xfs_bmap_collapse_extents()
5772 *next_fsb = got.br_startoff; in xfs_bmap_collapse_extents()
5788 struct xfs_bmbt_irec got; in xfs_bmap_can_insert_extents() local
5798 error = xfs_bmap_last_extent(NULL, ip, XFS_DATA_FORK, &got, &is_empty); in xfs_bmap_can_insert_extents()
5799 if (!error && !is_empty && got.br_startoff >= off && in xfs_bmap_can_insert_extents()
5800 ((got.br_startoff + shift) & BMBT_STARTOFF_MASK) < got.br_startoff) in xfs_bmap_can_insert_extents()
5820 struct xfs_bmbt_irec got, next; in xfs_bmap_insert_extents() local
5852 if (!xfs_iext_get_extent(ifp, &icur, &got) || in xfs_bmap_insert_extents()
5853 stop_fsb > got.br_startoff) { in xfs_bmap_insert_extents()
5858 if (!xfs_iext_lookup_extent(ip, ifp, *next_fsb, &icur, &got)) { in xfs_bmap_insert_extents()
5863 XFS_WANT_CORRUPTED_GOTO(mp, !isnullstartblock(got.br_startblock), in xfs_bmap_insert_extents()
5866 if (stop_fsb >= got.br_startoff + got.br_blockcount) { in xfs_bmap_insert_extents()
5871 new_startoff = got.br_startoff + offset_shift_fsb; in xfs_bmap_insert_extents()
5873 if (new_startoff + got.br_blockcount > next.br_startoff) { in xfs_bmap_insert_extents()
5884 if (xfs_bmse_can_merge(&got, &next, offset_shift_fsb)) in xfs_bmap_insert_extents()
5888 error = xfs_bmap_shift_update_extent(tp, ip, whichfork, &icur, &got, in xfs_bmap_insert_extents()
5893 if (!xfs_iext_prev_extent(ifp, &icur, &got) || in xfs_bmap_insert_extents()
5894 stop_fsb >= got.br_startoff + got.br_blockcount) { in xfs_bmap_insert_extents()
5899 *next_fsb = got.br_startoff; in xfs_bmap_insert_extents()
5922 struct xfs_bmbt_irec got; in xfs_bmap_split_extent_at() local
5955 if (!xfs_iext_lookup_extent(ip, ifp, split_fsb, &icur, &got) || in xfs_bmap_split_extent_at()
5956 got.br_startoff >= split_fsb) in xfs_bmap_split_extent_at()
5959 gotblkcnt = split_fsb - got.br_startoff; in xfs_bmap_split_extent_at()
5961 new.br_startblock = got.br_startblock + gotblkcnt; in xfs_bmap_split_extent_at()
5962 new.br_blockcount = got.br_blockcount - gotblkcnt; in xfs_bmap_split_extent_at()
5963 new.br_state = got.br_state; in xfs_bmap_split_extent_at()
5968 error = xfs_bmbt_lookup_eq(cur, &got, &i); in xfs_bmap_split_extent_at()
5974 got.br_blockcount = gotblkcnt; in xfs_bmap_split_extent_at()
5976 &got); in xfs_bmap_split_extent_at()
5980 error = xfs_bmbt_update(cur, &got); in xfs_bmap_split_extent_at()