Lines Matching full:got
1277 struct xfs_bmbt_irec got; in xfs_bmap_first_unused() local
1297 for_each_xfs_iext(ifp, &icur, &got) { in xfs_bmap_first_unused()
1301 if (got.br_startoff >= lowest + len && in xfs_bmap_first_unused()
1302 got.br_startoff - max >= len) in xfs_bmap_first_unused()
1304 lastaddr = got.br_startoff + got.br_blockcount; in xfs_bmap_first_unused()
1326 struct xfs_bmbt_irec got; in xfs_bmap_last_before() local
1348 if (!xfs_iext_lookup_extent_before(ip, ifp, last_block, &icur, &got)) in xfs_bmap_last_before()
1496 struct xfs_bmbt_irec *new = &bma->got; in xfs_bmap_add_extent_delay_real()
3225 if (!isnullstartblock(ap->got.br_startblock)) { in xfs_bmap_adjacent()
3229 adjust = gotdiff = ap->got.br_startoff - ap->offset; in xfs_bmap_adjacent()
3234 gotbno = ap->got.br_startblock; in xfs_bmap_adjacent()
3504 error = xfs_bmap_extsize_align(mp, &ap->got, &ap->prev, in xfs_bmap_btalloc()
3767 struct xfs_bmbt_irec *got, in xfs_bmapi_trim_map() argument
3776 got->br_startoff + got->br_blockcount <= obno) { in xfs_bmapi_trim_map()
3777 *mval = *got; in xfs_bmapi_trim_map()
3778 if (isnullstartblock(got->br_startblock)) in xfs_bmapi_trim_map()
3788 if (isnullstartblock(got->br_startblock)) in xfs_bmapi_trim_map()
3791 mval->br_startblock = got->br_startblock + in xfs_bmapi_trim_map()
3792 (*bno - got->br_startoff); in xfs_bmapi_trim_map()
3794 * Return the minimum of what we got and what we asked for for in xfs_bmapi_trim_map()
3801 got->br_blockcount - (*bno - got->br_startoff)); in xfs_bmapi_trim_map()
3802 mval->br_state = got->br_state; in xfs_bmapi_trim_map()
3876 struct xfs_bmbt_irec got; in xfs_bmapi_read() local
3906 if (!xfs_iext_lookup_extent(ip, ifp, bno, &icur, &got)) in xfs_bmapi_read()
3914 got.br_startoff = end; in xfs_bmapi_read()
3915 if (got.br_startoff > bno) { in xfs_bmapi_read()
3920 XFS_FILBLKS_MIN(len, got.br_startoff - bno); in xfs_bmapi_read()
3930 xfs_bmapi_trim_map(mval, &got, &bno, len, obno, end, n, flags); in xfs_bmapi_read()
3938 if (!xfs_iext_next_extent(ifp, &icur, &got)) in xfs_bmapi_read()
3949 * On entry, got refers to the first extent beyond the offset of the extent to
3950 * allocate or eof is specified if no such extent exists. On return, got refers
3954 * during insertion into the inode fork. Thus, got does not reflect the current
3965 struct xfs_bmbt_irec *got, in xfs_bmapi_reserve_delalloc() argument
3982 alen = XFS_FILBLKS_MIN(alen, got->br_startoff - aoff); in xfs_bmapi_reserve_delalloc()
3994 error = xfs_bmap_extsize_align(mp, got, &prev, extsz, 0, eof, in xfs_bmapi_reserve_delalloc()
4028 got->br_startoff = aoff; in xfs_bmapi_reserve_delalloc()
4029 got->br_startblock = nullstartblock(indlen); in xfs_bmapi_reserve_delalloc()
4030 got->br_blockcount = alen; in xfs_bmapi_reserve_delalloc()
4031 got->br_state = XFS_EXT_NORM; in xfs_bmapi_reserve_delalloc()
4033 xfs_bmap_add_extent_hole_delay(ip, whichfork, icur, got); in xfs_bmapi_reserve_delalloc()
4106 bma->length = (xfs_extlen_t)bma->got.br_blockcount; in xfs_bmapi_allocate()
4107 bma->offset = bma->got.br_startoff; in xfs_bmapi_allocate()
4114 bma->got.br_startoff - bma->offset); in xfs_bmapi_allocate()
4147 bma->got.br_startoff = bma->offset; in xfs_bmapi_allocate()
4148 bma->got.br_startblock = bma->blkno; in xfs_bmapi_allocate()
4149 bma->got.br_blockcount = bma->length; in xfs_bmapi_allocate()
4150 bma->got.br_state = XFS_EXT_NORM; in xfs_bmapi_allocate()
4153 bma->got.br_state = XFS_EXT_UNWRITTEN; in xfs_bmapi_allocate()
4159 whichfork, &bma->icur, &bma->cur, &bma->got, in xfs_bmapi_allocate()
4171 xfs_iext_get_extent(ifp, &bma->icur, &bma->got); in xfs_bmapi_allocate()
4173 ASSERT(bma->got.br_startoff <= bma->offset); in xfs_bmapi_allocate()
4174 ASSERT(bma->got.br_startoff + bma->got.br_blockcount >= in xfs_bmapi_allocate()
4176 ASSERT(bma->got.br_state == XFS_EXT_NORM || in xfs_bmapi_allocate()
4177 bma->got.br_state == XFS_EXT_UNWRITTEN); in xfs_bmapi_allocate()
4249 xfs_iext_get_extent(ifp, &bma->icur, &bma->got); in xfs_bmapi_convert_unwritten()
4383 if (!xfs_iext_lookup_extent(ip, ifp, bno, &bma.icur, &bma.got)) in xfs_bmapi_write()
4396 if (eof || bma.got.br_startoff > bno) { in xfs_bmapi_write()
4406 } else if (isnullstartblock(bma.got.br_startblock)) { in xfs_bmapi_write()
4451 xfs_bmapi_trim_map(mval, &bma.got, &bno, len, obno, in xfs_bmapi_write()
4473 bma.prev = bma.got; in xfs_bmapi_write()
4474 if (!xfs_iext_next_extent(ifp, &bma.icur, &bma.got)) in xfs_bmapi_write()
4532 if (!xfs_iext_lookup_extent(ip, ifp, offset_fsb, &bma.icur, &bma.got) || in xfs_bmapi_convert_delalloc()
4533 bma.got.br_startoff > offset_fsb) { in xfs_bmapi_convert_delalloc()
4548 if (!isnullstartblock(bma.got.br_startblock)) { in xfs_bmapi_convert_delalloc()
4549 xfs_bmbt_to_iomap(ip, iomap, &bma.got, flags); in xfs_bmapi_convert_delalloc()
4557 bma.offset = bma.got.br_startoff; in xfs_bmapi_convert_delalloc()
4558 bma.length = max_t(xfs_filblks_t, bma.got.br_blockcount, MAXEXTLEN); in xfs_bmapi_convert_delalloc()
4589 if (WARN_ON_ONCE(!xfs_valid_startblock(ip, bma.got.br_startblock))) in xfs_bmapi_convert_delalloc()
4595 ASSERT(!isnullstartblock(bma.got.br_startblock)); in xfs_bmapi_convert_delalloc()
4596 xfs_bmbt_to_iomap(ip, iomap, &bma.got, flags); in xfs_bmapi_convert_delalloc()
4632 struct xfs_bmbt_irec got; in xfs_bmapi_remap() local
4660 if (xfs_iext_lookup_extent(ip, ifp, bno, &icur, &got)) { in xfs_bmapi_remap()
4662 ASSERT(got.br_startoff > bno); in xfs_bmapi_remap()
4663 ASSERT(got.br_startoff - bno >= len); in xfs_bmapi_remap()
4674 got.br_startoff = bno; in xfs_bmapi_remap()
4675 got.br_startblock = startblock; in xfs_bmapi_remap()
4676 got.br_blockcount = len; in xfs_bmapi_remap()
4678 got.br_state = XFS_EXT_UNWRITTEN; in xfs_bmapi_remap()
4680 got.br_state = XFS_EXT_NORM; in xfs_bmapi_remap()
4683 &cur, &got, &logflags, flags); in xfs_bmapi_remap()
4792 struct xfs_bmbt_irec *got, in xfs_bmap_del_extent_delay() argument
4809 got_endoff = got->br_startoff + got->br_blockcount; in xfs_bmap_del_extent_delay()
4810 da_old = startblockval(got->br_startblock); in xfs_bmap_del_extent_delay()
4814 ASSERT(got->br_startoff <= del->br_startoff); in xfs_bmap_del_extent_delay()
4836 if (got->br_startoff == del->br_startoff) in xfs_bmap_del_extent_delay()
4853 got->br_startoff = del_endoff; in xfs_bmap_del_extent_delay()
4854 got->br_blockcount -= del->br_blockcount; in xfs_bmap_del_extent_delay()
4856 got->br_blockcount), da_old); in xfs_bmap_del_extent_delay()
4857 got->br_startblock = nullstartblock((int)da_new); in xfs_bmap_del_extent_delay()
4858 xfs_iext_update_extent(ip, state, icur, got); in xfs_bmap_del_extent_delay()
4864 got->br_blockcount = got->br_blockcount - del->br_blockcount; in xfs_bmap_del_extent_delay()
4866 got->br_blockcount), da_old); in xfs_bmap_del_extent_delay()
4867 got->br_startblock = nullstartblock((int)da_new); in xfs_bmap_del_extent_delay()
4868 xfs_iext_update_extent(ip, state, icur, got); in xfs_bmap_del_extent_delay()
4880 got->br_blockcount = del->br_startoff - got->br_startoff; in xfs_bmap_del_extent_delay()
4881 got_indlen = xfs_bmap_worst_indlen(ip, got->br_blockcount); in xfs_bmap_del_extent_delay()
4890 got->br_startblock = nullstartblock((int)got_indlen); in xfs_bmap_del_extent_delay()
4893 new.br_state = got->br_state; in xfs_bmap_del_extent_delay()
4896 xfs_iext_update_extent(ip, state, icur, got); in xfs_bmap_del_extent_delay()
4920 struct xfs_bmbt_irec *got, in xfs_bmap_del_extent_cow() argument
4932 got_endoff = got->br_startoff + got->br_blockcount; in xfs_bmap_del_extent_cow()
4935 ASSERT(got->br_startoff <= del->br_startoff); in xfs_bmap_del_extent_cow()
4937 ASSERT(!isnullstartblock(got->br_startblock)); in xfs_bmap_del_extent_cow()
4939 if (got->br_startoff == del->br_startoff) in xfs_bmap_del_extent_cow()
4956 got->br_startoff = del_endoff; in xfs_bmap_del_extent_cow()
4957 got->br_blockcount -= del->br_blockcount; in xfs_bmap_del_extent_cow()
4958 got->br_startblock = del->br_startblock + del->br_blockcount; in xfs_bmap_del_extent_cow()
4959 xfs_iext_update_extent(ip, state, icur, got); in xfs_bmap_del_extent_cow()
4965 got->br_blockcount -= del->br_blockcount; in xfs_bmap_del_extent_cow()
4966 xfs_iext_update_extent(ip, state, icur, got); in xfs_bmap_del_extent_cow()
4972 got->br_blockcount = del->br_startoff - got->br_startoff; in xfs_bmap_del_extent_cow()
4976 new.br_state = got->br_state; in xfs_bmap_del_extent_cow()
4979 xfs_iext_update_extent(ip, state, icur, got); in xfs_bmap_del_extent_cow()
5007 struct xfs_bmbt_irec got; /* current extent entry */ in xfs_bmap_del_extent_real() local
5008 xfs_fileoff_t got_endoff; /* first offset past got */ in xfs_bmap_del_extent_real()
5024 xfs_iext_get_extent(ifp, icur, &got); in xfs_bmap_del_extent_real()
5025 ASSERT(got.br_startoff <= del->br_startoff); in xfs_bmap_del_extent_real()
5027 got_endoff = got.br_startoff + got.br_blockcount; in xfs_bmap_del_extent_real()
5029 ASSERT(!isnullstartblock(got.br_startblock)); in xfs_bmap_del_extent_real()
5044 del->br_startoff > got.br_startoff && del_endoff < got_endoff) in xfs_bmap_del_extent_real()
5079 error = xfs_bmbt_lookup_eq(cur, &got, &i); in xfs_bmap_del_extent_real()
5088 if (got.br_startoff == del->br_startoff) in xfs_bmap_del_extent_real()
5118 got.br_startoff = del_endoff; in xfs_bmap_del_extent_real()
5119 got.br_startblock = del_endblock; in xfs_bmap_del_extent_real()
5120 got.br_blockcount -= del->br_blockcount; in xfs_bmap_del_extent_real()
5121 xfs_iext_update_extent(ip, state, icur, &got); in xfs_bmap_del_extent_real()
5126 error = xfs_bmbt_update(cur, &got); in xfs_bmap_del_extent_real()
5134 got.br_blockcount -= del->br_blockcount; in xfs_bmap_del_extent_real()
5135 xfs_iext_update_extent(ip, state, icur, &got); in xfs_bmap_del_extent_real()
5140 error = xfs_bmbt_update(cur, &got); in xfs_bmap_del_extent_real()
5148 old = got; in xfs_bmap_del_extent_real()
5150 got.br_blockcount = del->br_startoff - got.br_startoff; in xfs_bmap_del_extent_real()
5151 xfs_iext_update_extent(ip, state, icur, &got); in xfs_bmap_del_extent_real()
5155 new.br_state = got.br_state; in xfs_bmap_del_extent_real()
5160 error = xfs_bmbt_update(cur, &got); in xfs_bmap_del_extent_real()
5180 error = xfs_bmbt_lookup_eq(cur, &got, &i); in xfs_bmap_del_extent_real()
5268 struct xfs_bmbt_irec got; /* current extent record */ in __xfs_bunmapi() local
5320 if (!xfs_iext_lookup_extent_before(ip, ifp, &end, &icur, &got)) { in __xfs_bunmapi()
5351 if (got.br_startoff > end && in __xfs_bunmapi()
5352 !xfs_iext_prev_extent(ifp, &icur, &got)) { in __xfs_bunmapi()
5361 got.br_startoff + got.br_blockcount - 1); in __xfs_bunmapi()
5368 del = got; in __xfs_bunmapi()
5381 if (got.br_startoff < start) { in __xfs_bunmapi()
5383 del.br_blockcount -= start - got.br_startoff; in __xfs_bunmapi()
5385 del.br_startblock += start - got.br_startoff; in __xfs_bunmapi()
5419 if (end < got.br_startoff && in __xfs_bunmapi()
5420 !xfs_iext_prev_extent(ifp, &icur, &got)) { in __xfs_bunmapi()
5471 if (got.br_startoff > end && in __xfs_bunmapi()
5472 !xfs_iext_prev_extent(ifp, &icur, &got)) { in __xfs_bunmapi()
5522 &got, &del); in __xfs_bunmapi()
5540 if (!xfs_iext_get_extent(ifp, &icur, &got) || in __xfs_bunmapi()
5541 (got.br_startoff > end && in __xfs_bunmapi()
5542 !xfs_iext_prev_extent(ifp, &icur, &got))) { in __xfs_bunmapi()
5617 struct xfs_bmbt_irec *got, /* current extent to shift */ in xfs_bmse_can_merge() argument
5622 startoff = got->br_startoff - shift; in xfs_bmse_can_merge()
5629 (left->br_startblock + left->br_blockcount != got->br_startblock) || in xfs_bmse_can_merge()
5630 (left->br_state != got->br_state) || in xfs_bmse_can_merge()
5631 (left->br_blockcount + got->br_blockcount > MAXEXTLEN)) in xfs_bmse_can_merge()
5653 struct xfs_bmbt_irec *got, /* extent to shift */ in xfs_bmse_merge() argument
5664 blockcount = left->br_blockcount + got->br_blockcount; in xfs_bmse_merge()
5668 ASSERT(xfs_bmse_can_merge(left, got, shift)); in xfs_bmse_merge()
5685 error = xfs_bmbt_lookup_eq(cur, got, &i); in xfs_bmse_merge()
5720 xfs_rmap_unmap_extent(tp, ip, whichfork, got); in xfs_bmse_merge()
5721 memcpy(&new, got, sizeof(new)); in xfs_bmse_merge()
5733 struct xfs_bmbt_irec *got, in xfs_bmap_shift_update_extent() argument
5739 struct xfs_bmbt_irec prev = *got; in xfs_bmap_shift_update_extent()
5744 got->br_startoff = startoff; in xfs_bmap_shift_update_extent()
5753 error = xfs_bmbt_update(cur, got); in xfs_bmap_shift_update_extent()
5761 got); in xfs_bmap_shift_update_extent()
5765 xfs_rmap_map_extent(tp, ip, whichfork, got); in xfs_bmap_shift_update_extent()
5781 struct xfs_bmbt_irec got, prev; in xfs_bmap_collapse_extents() local
5808 if (!xfs_iext_lookup_extent(ip, ifp, *next_fsb, &icur, &got)) { in xfs_bmap_collapse_extents()
5812 if (XFS_IS_CORRUPT(mp, isnullstartblock(got.br_startblock))) { in xfs_bmap_collapse_extents()
5817 new_startoff = got.br_startoff - offset_shift_fsb; in xfs_bmap_collapse_extents()
5824 if (xfs_bmse_can_merge(&prev, &got, offset_shift_fsb)) { in xfs_bmap_collapse_extents()
5826 offset_shift_fsb, &icur, &got, &prev, in xfs_bmap_collapse_extents()
5833 if (got.br_startoff < offset_shift_fsb) { in xfs_bmap_collapse_extents()
5839 error = xfs_bmap_shift_update_extent(tp, ip, whichfork, &icur, &got, in xfs_bmap_collapse_extents()
5845 if (!xfs_iext_next_extent(ifp, &icur, &got)) { in xfs_bmap_collapse_extents()
5850 *next_fsb = got.br_startoff; in xfs_bmap_collapse_extents()
5866 struct xfs_bmbt_irec got; in xfs_bmap_can_insert_extents() local
5876 error = xfs_bmap_last_extent(NULL, ip, XFS_DATA_FORK, &got, &is_empty); in xfs_bmap_can_insert_extents()
5877 if (!error && !is_empty && got.br_startoff >= off && in xfs_bmap_can_insert_extents()
5878 ((got.br_startoff + shift) & BMBT_STARTOFF_MASK) < got.br_startoff) in xfs_bmap_can_insert_extents()
5898 struct xfs_bmbt_irec got, next; in xfs_bmap_insert_extents() local
5927 if (!xfs_iext_get_extent(ifp, &icur, &got) || in xfs_bmap_insert_extents()
5928 stop_fsb > got.br_startoff) { in xfs_bmap_insert_extents()
5933 if (!xfs_iext_lookup_extent(ip, ifp, *next_fsb, &icur, &got)) { in xfs_bmap_insert_extents()
5938 if (XFS_IS_CORRUPT(mp, isnullstartblock(got.br_startblock))) { in xfs_bmap_insert_extents()
5943 if (XFS_IS_CORRUPT(mp, stop_fsb > got.br_startoff)) { in xfs_bmap_insert_extents()
5948 new_startoff = got.br_startoff + offset_shift_fsb; in xfs_bmap_insert_extents()
5950 if (new_startoff + got.br_blockcount > next.br_startoff) { in xfs_bmap_insert_extents()
5961 if (xfs_bmse_can_merge(&got, &next, offset_shift_fsb)) in xfs_bmap_insert_extents()
5965 error = xfs_bmap_shift_update_extent(tp, ip, whichfork, &icur, &got, in xfs_bmap_insert_extents()
5970 if (!xfs_iext_prev_extent(ifp, &icur, &got) || in xfs_bmap_insert_extents()
5971 stop_fsb >= got.br_startoff + got.br_blockcount) { in xfs_bmap_insert_extents()
5976 *next_fsb = got.br_startoff; in xfs_bmap_insert_extents()
6000 struct xfs_bmbt_irec got; in xfs_bmap_split_extent() local
6003 xfs_fsblock_t gotblkcnt; /* new block count for got */ in xfs_bmap_split_extent()
6027 if (!xfs_iext_lookup_extent(ip, ifp, split_fsb, &icur, &got) || in xfs_bmap_split_extent()
6028 got.br_startoff >= split_fsb) in xfs_bmap_split_extent()
6031 gotblkcnt = split_fsb - got.br_startoff; in xfs_bmap_split_extent()
6033 new.br_startblock = got.br_startblock + gotblkcnt; in xfs_bmap_split_extent()
6034 new.br_blockcount = got.br_blockcount - gotblkcnt; in xfs_bmap_split_extent()
6035 new.br_state = got.br_state; in xfs_bmap_split_extent()
6040 error = xfs_bmbt_lookup_eq(cur, &got, &i); in xfs_bmap_split_extent()
6049 got.br_blockcount = gotblkcnt; in xfs_bmap_split_extent()
6051 &got); in xfs_bmap_split_extent()
6055 error = xfs_bmbt_update(cur, &got); in xfs_bmap_split_extent()