Lines Matching refs:ifp
131 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmap_needs_btree() local
134 ifp->if_format == XFS_DINODE_FMT_EXTENTS && in xfs_bmap_needs_btree()
135 ifp->if_nextents > XFS_IFORK_MAXEXT(ip, whichfork); in xfs_bmap_needs_btree()
143 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmap_wants_extents() local
146 ifp->if_format == XFS_DINODE_FMT_BTREE && in xfs_bmap_wants_extents()
147 ifp->if_nextents <= XFS_IFORK_MAXEXT(ip, whichfork); in xfs_bmap_wants_extents()
322 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmap_check_leaf_extents() local
335 if (ifp->if_format != XFS_DINODE_FMT_BTREE) in xfs_bmap_check_leaf_extents()
343 block = ifp->if_broot; in xfs_bmap_check_leaf_extents()
349 xfs_check_block(block, mp, 1, ifp->if_broot_bytes); in xfs_bmap_check_leaf_extents()
350 pp = XFS_BMAP_BROOT_PTR_ADDR(mp, block, 1, ifp->if_broot_bytes); in xfs_bmap_check_leaf_extents()
541 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmap_btree_to_extents() local
543 struct xfs_btree_block *rblock = ifp->if_broot; in xfs_bmap_btree_to_extents()
557 ASSERT(ifp->if_format == XFS_DINODE_FMT_BTREE); in xfs_bmap_btree_to_extents()
560 ASSERT(xfs_bmbt_maxrecs(mp, ifp->if_broot_bytes, 0) == 1); in xfs_bmap_btree_to_extents()
562 pp = XFS_BMAP_BROOT_PTR_ADDR(mp, rblock, 1, ifp->if_broot_bytes); in xfs_bmap_btree_to_extents()
583 ASSERT(ifp->if_broot == NULL); in xfs_bmap_btree_to_extents()
584 ifp->if_format = XFS_DINODE_FMT_EXTENTS; in xfs_bmap_btree_to_extents()
609 struct xfs_ifork *ifp; /* inode fork pointer */ in xfs_bmap_extents_to_btree() local
619 ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmap_extents_to_btree()
620 ASSERT(ifp->if_format == XFS_DINODE_FMT_EXTENTS); in xfs_bmap_extents_to_btree()
631 block = ifp->if_broot; in xfs_bmap_extents_to_btree()
643 ifp->if_format = XFS_DINODE_FMT_BTREE; in xfs_bmap_extents_to_btree()
694 for_each_xfs_iext(ifp, &icur, &rec) { in xfs_bmap_extents_to_btree()
701 ASSERT(cnt == ifp->if_nextents); in xfs_bmap_extents_to_btree()
729 ifp->if_format = XFS_DINODE_FMT_EXTENTS; in xfs_bmap_extents_to_btree()
730 ASSERT(ifp->if_broot == NULL); in xfs_bmap_extents_to_btree()
748 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmap_local_to_extents_empty() local
751 ASSERT(ifp->if_format == XFS_DINODE_FMT_LOCAL); in xfs_bmap_local_to_extents_empty()
752 ASSERT(ifp->if_bytes == 0); in xfs_bmap_local_to_extents_empty()
753 ASSERT(ifp->if_nextents == 0); in xfs_bmap_local_to_extents_empty()
756 ifp->if_u1.if_root = NULL; in xfs_bmap_local_to_extents_empty()
757 ifp->if_height = 0; in xfs_bmap_local_to_extents_empty()
758 ifp->if_format = XFS_DINODE_FMT_EXTENTS; in xfs_bmap_local_to_extents_empty()
773 struct xfs_ifork *ifp)) in xfs_bmap_local_to_extents() argument
777 struct xfs_ifork *ifp; /* inode fork pointer */ in xfs_bmap_local_to_extents() local
788 ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmap_local_to_extents()
789 ASSERT(ifp->if_format == XFS_DINODE_FMT_LOCAL); in xfs_bmap_local_to_extents()
791 if (!ifp->if_bytes) { in xfs_bmap_local_to_extents()
838 init_fn(tp, bp, ip, ifp); in xfs_bmap_local_to_extents()
841 xfs_idata_realloc(ip, -ifp->if_bytes, whichfork); in xfs_bmap_local_to_extents()
845 ifp->if_u1.if_root = NULL; in xfs_bmap_local_to_extents()
846 ifp->if_height = 0; in xfs_bmap_local_to_extents()
852 xfs_iext_first(ifp, &icur); in xfs_bmap_local_to_extents()
855 ifp->if_nextents = 1; in xfs_bmap_local_to_extents()
1118 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_iread_bmbt_block() local
1124 if (unlikely(ir->loaded + num_recs > ifp->if_nextents)) { in xfs_iread_bmbt_block()
1150 xfs_iext_next(ifp, &ir->icur); in xfs_iread_bmbt_block()
1166 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_iread_extents() local
1171 if (!xfs_need_iread_extents(ifp)) in xfs_iread_extents()
1177 xfs_iext_first(ifp, &ir.icur); in xfs_iread_extents()
1185 if (XFS_IS_CORRUPT(mp, ir.loaded != ifp->if_nextents)) { in xfs_iread_extents()
1189 ASSERT(ir.loaded == xfs_iext_count(ifp)); in xfs_iread_extents()
1192 xfs_iext_destroy(ifp); in xfs_iread_extents()
1210 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmap_first_unused() local
1217 if (ifp->if_format == XFS_DINODE_FMT_LOCAL) { in xfs_bmap_first_unused()
1222 ASSERT(xfs_ifork_has_extents(ifp)); in xfs_bmap_first_unused()
1229 for_each_xfs_iext(ifp, &icur, &got) { in xfs_bmap_first_unused()
1257 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmap_last_before() local
1262 switch (ifp->if_format) { in xfs_bmap_last_before()
1278 if (!xfs_iext_lookup_extent_before(ip, ifp, last_block, &icur, &got)) in xfs_bmap_last_before()
1291 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmap_last_extent() local
1299 xfs_iext_last(ifp, &icur); in xfs_bmap_last_extent()
1300 if (!xfs_iext_get_extent(ifp, &icur, rec)) in xfs_bmap_last_extent()
1357 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmap_last_offset() local
1364 if (ifp->if_format == XFS_DINODE_FMT_LOCAL) in xfs_bmap_last_offset()
1367 if (XFS_IS_CORRUPT(ip->i_mount, !xfs_ifork_has_extents(ifp))) in xfs_bmap_last_offset()
1391 struct xfs_ifork *ifp = xfs_ifork_ptr(bma->ip, whichfork); in xfs_bmap_add_extent_delay_real() local
1420 xfs_iext_get_extent(ifp, &bma->icur, &PREV); in xfs_bmap_add_extent_delay_real()
1442 if (xfs_iext_peek_prev_extent(ifp, &bma->icur, &LEFT)) { in xfs_bmap_add_extent_delay_real()
1460 if (xfs_iext_peek_next_extent(ifp, &bma->icur, &RIGHT)) { in xfs_bmap_add_extent_delay_real()
1495 xfs_iext_prev(ifp, &bma->icur); in xfs_bmap_add_extent_delay_real()
1497 ifp->if_nextents--; in xfs_bmap_add_extent_delay_real()
1539 xfs_iext_prev(ifp, &bma->icur); in xfs_bmap_add_extent_delay_real()
1570 xfs_iext_next(ifp, &bma->icur); in xfs_bmap_add_extent_delay_real()
1572 xfs_iext_prev(ifp, &bma->icur); in xfs_bmap_add_extent_delay_real()
1601 ifp->if_nextents++; in xfs_bmap_add_extent_delay_real()
1641 xfs_iext_prev(ifp, &bma->icur); in xfs_bmap_add_extent_delay_real()
1667 ifp->if_nextents++; in xfs_bmap_add_extent_delay_real()
1705 xfs_iext_next(ifp, &bma->icur); in xfs_bmap_add_extent_delay_real()
1707 xfs_iext_prev(ifp, &bma->icur); in xfs_bmap_add_extent_delay_real()
1744 xfs_iext_next(ifp, &bma->icur); in xfs_bmap_add_extent_delay_real()
1754 ifp->if_nextents++; in xfs_bmap_add_extent_delay_real()
1792 xfs_iext_next(ifp, &bma->icur); in xfs_bmap_add_extent_delay_real()
1837 xfs_iext_next(ifp, &bma->icur); in xfs_bmap_add_extent_delay_real()
1840 ifp->if_nextents++; in xfs_bmap_add_extent_delay_real()
1945 struct xfs_ifork *ifp; /* inode fork pointer */ in xfs_bmap_add_extent_unwritten_real() local
1957 ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmap_add_extent_unwritten_real()
1971 xfs_iext_get_extent(ifp, icur, &PREV); in xfs_bmap_add_extent_unwritten_real()
1990 if (xfs_iext_peek_prev_extent(ifp, icur, &LEFT)) { in xfs_bmap_add_extent_unwritten_real()
2008 if (xfs_iext_peek_next_extent(ifp, icur, &RIGHT)) { in xfs_bmap_add_extent_unwritten_real()
2042 xfs_iext_prev(ifp, icur); in xfs_bmap_add_extent_unwritten_real()
2044 ifp->if_nextents -= 2; in xfs_bmap_add_extent_unwritten_real()
2094 xfs_iext_prev(ifp, icur); in xfs_bmap_add_extent_unwritten_real()
2096 ifp->if_nextents--; in xfs_bmap_add_extent_unwritten_real()
2134 xfs_iext_next(ifp, icur); in xfs_bmap_add_extent_unwritten_real()
2136 xfs_iext_prev(ifp, icur); in xfs_bmap_add_extent_unwritten_real()
2138 ifp->if_nextents--; in xfs_bmap_add_extent_unwritten_real()
2208 xfs_iext_prev(ifp, icur); in xfs_bmap_add_extent_unwritten_real()
2246 ifp->if_nextents++; in xfs_bmap_add_extent_unwritten_real()
2285 xfs_iext_next(ifp, icur); in xfs_bmap_add_extent_unwritten_real()
2320 xfs_iext_next(ifp, icur); in xfs_bmap_add_extent_unwritten_real()
2322 ifp->if_nextents++; in xfs_bmap_add_extent_unwritten_real()
2371 xfs_iext_next(ifp, icur); in xfs_bmap_add_extent_unwritten_real()
2374 ifp->if_nextents += 2; in xfs_bmap_add_extent_unwritten_real()
2474 struct xfs_ifork *ifp; /* inode fork pointer */ in xfs_bmap_add_extent_hole_delay() local
2482 ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmap_add_extent_hole_delay()
2488 if (xfs_iext_peek_prev_extent(ifp, icur, &left)) { in xfs_bmap_add_extent_hole_delay()
2498 if (xfs_iext_get_extent(ifp, icur, &right)) { in xfs_bmap_add_extent_hole_delay()
2543 xfs_iext_prev(ifp, icur); in xfs_bmap_add_extent_hole_delay()
2562 xfs_iext_prev(ifp, icur); in xfs_bmap_add_extent_hole_delay()
2618 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmap_add_extent_hole_real() local
2637 if (xfs_iext_peek_prev_extent(ifp, icur, &left)) { in xfs_bmap_add_extent_hole_real()
2647 if (xfs_iext_get_extent(ifp, icur, &right)) { in xfs_bmap_add_extent_hole_real()
2688 xfs_iext_prev(ifp, icur); in xfs_bmap_add_extent_hole_real()
2690 ifp->if_nextents--; in xfs_bmap_add_extent_hole_real()
2732 xfs_iext_prev(ifp, icur); in xfs_bmap_add_extent_hole_real()
2789 ifp->if_nextents++; in xfs_bmap_add_extent_hole_real()
3869 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmapi_read() local
3882 if (WARN_ON_ONCE(!ifp)) in xfs_bmapi_read()
3885 if (XFS_IS_CORRUPT(mp, !xfs_ifork_has_extents(ifp)) || in xfs_bmapi_read()
3898 if (!xfs_iext_lookup_extent(ip, ifp, bno, &icur, &got)) in xfs_bmapi_read()
3930 if (!xfs_iext_next_extent(ifp, &icur, &got)) in xfs_bmapi_read()
3962 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmapi_reserve_delalloc() local
3983 if (!xfs_iext_peek_prev_extent(ifp, icur, &prev)) in xfs_bmapi_reserve_delalloc()
4089 struct xfs_ifork *ifp = xfs_ifork_ptr(bma->ip, whichfork); in xfs_bmapi_allocate() local
4102 if (!xfs_iext_peek_prev_extent(ifp, &bma->icur, &bma->prev)) in xfs_bmapi_allocate()
4134 if (ifp->if_format == XFS_DINODE_FMT_BTREE && !bma->cur) in xfs_bmapi_allocate()
4170 xfs_iext_get_extent(ifp, &bma->icur, &bma->got); in xfs_bmapi_allocate()
4188 struct xfs_ifork *ifp = xfs_ifork_ptr(bma->ip, whichfork); in xfs_bmapi_convert_unwritten() local
4207 if (ifp->if_format == XFS_DINODE_FMT_BTREE && !bma->cur) { in xfs_bmapi_convert_unwritten()
4248 xfs_iext_get_extent(ifp, &bma->icur, &bma->got); in xfs_bmapi_convert_unwritten()
4265 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, fork); in xfs_bmapi_minleft() local
4269 if (ifp->if_format != XFS_DINODE_FMT_BTREE) in xfs_bmapi_minleft()
4271 return be16_to_cpu(ifp->if_broot->bb_level) + 1; in xfs_bmapi_minleft()
4286 struct xfs_ifork *ifp = xfs_ifork_ptr(bma->ip, whichfork); in xfs_bmapi_finish() local
4289 ifp->if_format != XFS_DINODE_FMT_EXTENTS) in xfs_bmapi_finish()
4292 ifp->if_format != XFS_DINODE_FMT_BTREE) in xfs_bmapi_finish()
4325 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmapi_write() local
4350 ASSERT(ifp->if_format != XFS_DINODE_FMT_LOCAL); in xfs_bmapi_write()
4366 if (XFS_IS_CORRUPT(mp, !xfs_ifork_has_extents(ifp)) || in xfs_bmapi_write()
4380 if (!xfs_iext_lookup_extent(ip, ifp, bno, &bma.icur, &bma.got)) in xfs_bmapi_write()
4382 if (!xfs_iext_peek_prev_extent(ifp, &bma.icur, &bma.prev)) in xfs_bmapi_write()
4471 if (!xfs_iext_next_extent(ifp, &bma.icur, &bma.got)) in xfs_bmapi_write()
4481 ASSERT(ifp->if_format != XFS_DINODE_FMT_BTREE || in xfs_bmapi_write()
4482 ifp->if_nextents > XFS_IFORK_MAXEXT(ip, whichfork)); in xfs_bmapi_write()
4506 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmapi_convert_delalloc() local
4537 if (!xfs_iext_lookup_extent(ip, ifp, offset_fsb, &bma.icur, &bma.got) || in xfs_bmapi_convert_delalloc()
4555 *seq = READ_ONCE(ifp->if_seq); in xfs_bmapi_convert_delalloc()
4584 if (!xfs_iext_peek_prev_extent(ifp, &bma.icur, &bma.prev)) in xfs_bmapi_convert_delalloc()
4603 *seq = READ_ONCE(ifp->if_seq); in xfs_bmapi_convert_delalloc()
4636 struct xfs_ifork *ifp; in xfs_bmapi_remap() local
4643 ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmapi_remap()
4652 if (XFS_IS_CORRUPT(mp, !xfs_ifork_has_extents(ifp)) || in xfs_bmapi_remap()
4664 if (xfs_iext_lookup_extent(ip, ifp, bno, &icur, &got)) { in xfs_bmapi_remap()
4673 if (ifp->if_format == XFS_DINODE_FMT_BTREE) { in xfs_bmapi_remap()
4800 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmap_del_extent_delay() local
4850 xfs_iext_prev(ifp, icur); in xfs_bmap_del_extent_delay()
4900 xfs_iext_next(ifp, icur); in xfs_bmap_del_extent_delay()
4927 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, XFS_COW_FORK); in xfs_bmap_del_extent_cow() local
4953 xfs_iext_prev(ifp, icur); in xfs_bmap_del_extent_cow()
4983 xfs_iext_next(ifp, icur); in xfs_bmap_del_extent_cow()
5013 struct xfs_ifork *ifp; /* inode fork pointer */ in xfs_bmap_del_extent_real() local
5025 ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmap_del_extent_real()
5027 xfs_iext_get_extent(ifp, icur, &got); in xfs_bmap_del_extent_real()
5045 ifp->if_format == XFS_DINODE_FMT_EXTENTS && in xfs_bmap_del_extent_real()
5046 ifp->if_nextents >= XFS_IFORK_MAXEXT(ip, whichfork) && in xfs_bmap_del_extent_real()
5102 xfs_iext_prev(ifp, icur); in xfs_bmap_del_extent_real()
5103 ifp->if_nextents--; in xfs_bmap_del_extent_real()
5214 ifp->if_nextents++; in xfs_bmap_del_extent_real()
5215 xfs_iext_next(ifp, icur); in xfs_bmap_del_extent_real()
5273 struct xfs_ifork *ifp; /* inode fork pointer */ in __xfs_bunmapi() local
5291 ifp = xfs_ifork_ptr(ip, whichfork); in __xfs_bunmapi()
5292 if (XFS_IS_CORRUPT(mp, !xfs_ifork_has_extents(ifp))) in __xfs_bunmapi()
5305 if (xfs_iext_count(ifp) == 0) { in __xfs_bunmapi()
5313 if (!xfs_iext_lookup_extent_before(ip, ifp, &end, &icur, &got)) { in __xfs_bunmapi()
5320 if (ifp->if_format == XFS_DINODE_FMT_BTREE) { in __xfs_bunmapi()
5321 ASSERT(ifp->if_format == XFS_DINODE_FMT_BTREE); in __xfs_bunmapi()
5345 !xfs_iext_prev_extent(ifp, &icur, &got)) { in __xfs_bunmapi()
5395 !xfs_iext_prev_extent(ifp, &icur, &got)) { in __xfs_bunmapi()
5447 !xfs_iext_prev_extent(ifp, &icur, &got)) { in __xfs_bunmapi()
5462 if (!xfs_iext_prev_extent(ifp, &icur, &prev)) in __xfs_bunmapi()
5514 if (!xfs_iext_get_extent(ifp, &icur, &got) || in __xfs_bunmapi()
5516 !xfs_iext_prev_extent(ifp, &icur, &got))) { in __xfs_bunmapi()
5547 ifp->if_format != XFS_DINODE_FMT_EXTENTS) in __xfs_bunmapi()
5550 ifp->if_format != XFS_DINODE_FMT_BTREE) in __xfs_bunmapi()
5632 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmse_merge() local
5651 ifp->if_nextents--; in xfs_bmse_merge()
5689 xfs_iext_prev(ifp, icur); in xfs_bmse_merge()
5753 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmap_collapse_extents() local
5761 if (XFS_IS_CORRUPT(mp, !xfs_ifork_has_extents(ifp)) || in xfs_bmap_collapse_extents()
5775 if (ifp->if_format == XFS_DINODE_FMT_BTREE) { in xfs_bmap_collapse_extents()
5780 if (!xfs_iext_lookup_extent(ip, ifp, *next_fsb, &icur, &got)) { in xfs_bmap_collapse_extents()
5790 if (xfs_iext_peek_prev_extent(ifp, &icur, &prev)) { in xfs_bmap_collapse_extents()
5817 if (!xfs_iext_next_extent(ifp, &icur, &got)) { in xfs_bmap_collapse_extents()
5868 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmap_insert_extents() local
5876 if (XFS_IS_CORRUPT(mp, !xfs_ifork_has_extents(ifp)) || in xfs_bmap_insert_extents()
5890 if (ifp->if_format == XFS_DINODE_FMT_BTREE) { in xfs_bmap_insert_extents()
5896 xfs_iext_last(ifp, &icur); in xfs_bmap_insert_extents()
5897 if (!xfs_iext_get_extent(ifp, &icur, &got) || in xfs_bmap_insert_extents()
5903 if (!xfs_iext_lookup_extent(ip, ifp, *next_fsb, &icur, &got)) { in xfs_bmap_insert_extents()
5919 if (xfs_iext_peek_next_extent(ifp, &icur, &next)) { in xfs_bmap_insert_extents()
5940 if (!xfs_iext_prev_extent(ifp, &icur, &got) || in xfs_bmap_insert_extents()
5968 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmap_split_extent() local
5979 if (XFS_IS_CORRUPT(mp, !xfs_ifork_has_extents(ifp)) || in xfs_bmap_split_extent()
5995 if (!xfs_iext_lookup_extent(ip, ifp, split_fsb, &icur, &got) || in xfs_bmap_split_extent()
6005 if (ifp->if_format == XFS_DINODE_FMT_BTREE) { in xfs_bmap_split_extent()
6030 xfs_iext_next(ifp, &icur); in xfs_bmap_split_extent()
6032 ifp->if_nextents++; in xfs_bmap_split_extent()