Lines Matching full:ifp

136 	struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork);  in xfs_bmap_needs_btree()  local
139 ifp->if_format == XFS_DINODE_FMT_EXTENTS && in xfs_bmap_needs_btree()
140 ifp->if_nextents > XFS_IFORK_MAXEXT(ip, whichfork); in xfs_bmap_needs_btree()
148 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmap_wants_extents() local
151 ifp->if_format == XFS_DINODE_FMT_BTREE && in xfs_bmap_wants_extents()
152 ifp->if_nextents <= XFS_IFORK_MAXEXT(ip, whichfork); in xfs_bmap_wants_extents()
349 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmap_check_leaf_extents() local
362 if (ifp->if_format != XFS_DINODE_FMT_BTREE) in xfs_bmap_check_leaf_extents()
370 block = ifp->if_broot; in xfs_bmap_check_leaf_extents()
376 xfs_check_block(block, mp, 1, ifp->if_broot_bytes); in xfs_bmap_check_leaf_extents()
377 pp = xfs_bmap_broot_ptr_addr(mp, block, 1, ifp->if_broot_bytes); in xfs_bmap_check_leaf_extents()
569 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmap_btree_to_extents() local
571 struct xfs_btree_block *rblock = ifp->if_broot; in xfs_bmap_btree_to_extents()
585 ASSERT(ifp->if_format == XFS_DINODE_FMT_BTREE); in xfs_bmap_btree_to_extents()
588 ASSERT(xfs_bmbt_maxrecs(mp, ifp->if_broot_bytes, false) == 1); in xfs_bmap_btree_to_extents()
590 pp = xfs_bmap_broot_ptr_addr(mp, rblock, 1, ifp->if_broot_bytes); in xfs_bmap_btree_to_extents()
619 ASSERT(ifp->if_broot == NULL); in xfs_bmap_btree_to_extents()
620 ifp->if_format = XFS_DINODE_FMT_EXTENTS; in xfs_bmap_btree_to_extents()
645 struct xfs_ifork *ifp; /* inode fork pointer */ in xfs_bmap_extents_to_btree() local
655 ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmap_extents_to_btree()
656 ASSERT(ifp->if_format == XFS_DINODE_FMT_EXTENTS); in xfs_bmap_extents_to_btree()
667 block = ifp->if_broot; in xfs_bmap_extents_to_btree()
678 ifp->if_format = XFS_DINODE_FMT_BTREE; in xfs_bmap_extents_to_btree()
715 for_each_xfs_iext(ifp, &icur, &rec) { in xfs_bmap_extents_to_btree()
722 ASSERT(cnt == ifp->if_nextents); in xfs_bmap_extents_to_btree()
750 ifp->if_format = XFS_DINODE_FMT_EXTENTS; in xfs_bmap_extents_to_btree()
751 ASSERT(ifp->if_broot == NULL); in xfs_bmap_extents_to_btree()
769 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmap_local_to_extents_empty() local
772 ASSERT(ifp->if_format == XFS_DINODE_FMT_LOCAL); in xfs_bmap_local_to_extents_empty()
773 ASSERT(ifp->if_bytes == 0); in xfs_bmap_local_to_extents_empty()
774 ASSERT(ifp->if_nextents == 0); in xfs_bmap_local_to_extents_empty()
777 ifp->if_data = NULL; in xfs_bmap_local_to_extents_empty()
778 ifp->if_height = 0; in xfs_bmap_local_to_extents_empty()
779 ifp->if_format = XFS_DINODE_FMT_EXTENTS; in xfs_bmap_local_to_extents_empty()
794 struct xfs_ifork *ifp, void *priv), in xfs_bmap_local_to_extents() argument
799 struct xfs_ifork *ifp; /* inode fork pointer */ in xfs_bmap_local_to_extents() local
810 ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmap_local_to_extents()
811 ASSERT(ifp->if_format == XFS_DINODE_FMT_LOCAL); in xfs_bmap_local_to_extents()
813 if (!ifp->if_bytes) { in xfs_bmap_local_to_extents()
856 init_fn(tp, bp, ip, ifp, priv); in xfs_bmap_local_to_extents()
859 xfs_idata_realloc(ip, -ifp->if_bytes, whichfork); in xfs_bmap_local_to_extents()
863 ifp->if_data = NULL; in xfs_bmap_local_to_extents()
864 ifp->if_height = 0; in xfs_bmap_local_to_extents()
870 xfs_iext_first(ifp, &icur); in xfs_bmap_local_to_extents()
873 ifp->if_nextents = 1; in xfs_bmap_local_to_extents()
1151 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_iread_bmbt_block() local
1157 if (unlikely(ir->loaded + num_recs > ifp->if_nextents)) { in xfs_iread_bmbt_block()
1186 xfs_iext_next(ifp, &ir->icur); in xfs_iread_bmbt_block()
1202 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_iread_extents() local
1207 if (!xfs_need_iread_extents(ifp)) in xfs_iread_extents()
1213 xfs_iext_first(ifp, &ir.icur); in xfs_iread_extents()
1221 if (XFS_IS_CORRUPT(mp, ir.loaded != ifp->if_nextents)) { in xfs_iread_extents()
1226 ASSERT(ir.loaded == xfs_iext_count(ifp)); in xfs_iread_extents()
1232 smp_store_release(&ifp->if_needextents, 0); in xfs_iread_extents()
1237 xfs_iext_destroy(ifp); in xfs_iread_extents()
1255 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmap_first_unused() local
1262 if (ifp->if_format == XFS_DINODE_FMT_LOCAL) { in xfs_bmap_first_unused()
1267 ASSERT(xfs_ifork_has_extents(ifp)); in xfs_bmap_first_unused()
1274 for_each_xfs_iext(ifp, &icur, &got) { in xfs_bmap_first_unused()
1302 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmap_last_before() local
1307 switch (ifp->if_format) { in xfs_bmap_last_before()
1324 if (!xfs_iext_lookup_extent_before(ip, ifp, last_block, &icur, &got)) in xfs_bmap_last_before()
1337 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmap_last_extent() local
1345 xfs_iext_last(ifp, &icur); in xfs_bmap_last_extent()
1346 if (!xfs_iext_get_extent(ifp, &icur, rec)) in xfs_bmap_last_extent()
1403 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmap_last_offset() local
1410 if (ifp->if_format == XFS_DINODE_FMT_LOCAL) in xfs_bmap_last_offset()
1413 if (XFS_IS_CORRUPT(ip->i_mount, !xfs_ifork_has_extents(ifp))) { in xfs_bmap_last_offset()
1457 struct xfs_ifork *ifp = xfs_ifork_ptr(bma->ip, whichfork); in xfs_bmap_add_extent_delay_real() local
1485 xfs_iext_get_extent(ifp, &bma->icur, &PREV); in xfs_bmap_add_extent_delay_real()
1507 if (xfs_iext_peek_prev_extent(ifp, &bma->icur, &LEFT)) { in xfs_bmap_add_extent_delay_real()
1526 if (xfs_iext_peek_next_extent(ifp, &bma->icur, &RIGHT)) { in xfs_bmap_add_extent_delay_real()
1562 xfs_iext_prev(ifp, &bma->icur); in xfs_bmap_add_extent_delay_real()
1564 ifp->if_nextents--; in xfs_bmap_add_extent_delay_real()
1610 xfs_iext_prev(ifp, &bma->icur); in xfs_bmap_add_extent_delay_real()
1643 xfs_iext_next(ifp, &bma->icur); in xfs_bmap_add_extent_delay_real()
1645 xfs_iext_prev(ifp, &bma->icur); in xfs_bmap_add_extent_delay_real()
1676 ifp->if_nextents++; in xfs_bmap_add_extent_delay_real()
1719 xfs_iext_prev(ifp, &bma->icur); in xfs_bmap_add_extent_delay_real()
1747 ifp->if_nextents++; in xfs_bmap_add_extent_delay_real()
1787 xfs_iext_next(ifp, &bma->icur); in xfs_bmap_add_extent_delay_real()
1789 xfs_iext_prev(ifp, &bma->icur); in xfs_bmap_add_extent_delay_real()
1827 xfs_iext_next(ifp, &bma->icur); in xfs_bmap_add_extent_delay_real()
1838 ifp->if_nextents++; in xfs_bmap_add_extent_delay_real()
1878 xfs_iext_next(ifp, &bma->icur); in xfs_bmap_add_extent_delay_real()
1924 xfs_iext_next(ifp, &bma->icur); in xfs_bmap_add_extent_delay_real()
1927 ifp->if_nextents++; in xfs_bmap_add_extent_delay_real()
2033 struct xfs_ifork *ifp; /* inode fork pointer */ in xfs_bmap_add_extent_unwritten_real() local
2045 ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmap_add_extent_unwritten_real()
2059 xfs_iext_get_extent(ifp, icur, &PREV); in xfs_bmap_add_extent_unwritten_real()
2078 if (xfs_iext_peek_prev_extent(ifp, icur, &LEFT)) { in xfs_bmap_add_extent_unwritten_real()
2097 if (xfs_iext_peek_next_extent(ifp, icur, &RIGHT)) { in xfs_bmap_add_extent_unwritten_real()
2132 xfs_iext_prev(ifp, icur); in xfs_bmap_add_extent_unwritten_real()
2134 ifp->if_nextents -= 2; in xfs_bmap_add_extent_unwritten_real()
2189 xfs_iext_prev(ifp, icur); in xfs_bmap_add_extent_unwritten_real()
2191 ifp->if_nextents--; in xfs_bmap_add_extent_unwritten_real()
2232 xfs_iext_next(ifp, icur); in xfs_bmap_add_extent_unwritten_real()
2234 xfs_iext_prev(ifp, icur); in xfs_bmap_add_extent_unwritten_real()
2236 ifp->if_nextents--; in xfs_bmap_add_extent_unwritten_real()
2310 xfs_iext_prev(ifp, icur); in xfs_bmap_add_extent_unwritten_real()
2349 ifp->if_nextents++; in xfs_bmap_add_extent_unwritten_real()
2390 xfs_iext_next(ifp, icur); in xfs_bmap_add_extent_unwritten_real()
2426 xfs_iext_next(ifp, icur); in xfs_bmap_add_extent_unwritten_real()
2428 ifp->if_nextents++; in xfs_bmap_add_extent_unwritten_real()
2480 xfs_iext_next(ifp, icur); in xfs_bmap_add_extent_unwritten_real()
2483 ifp->if_nextents += 2; in xfs_bmap_add_extent_unwritten_real()
2587 struct xfs_ifork *ifp; /* inode fork pointer */ in xfs_bmap_add_extent_hole_delay() local
2595 ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmap_add_extent_hole_delay()
2601 if (xfs_iext_peek_prev_extent(ifp, icur, &left)) { in xfs_bmap_add_extent_hole_delay()
2611 if (xfs_iext_get_extent(ifp, icur, &right)) { in xfs_bmap_add_extent_hole_delay()
2656 xfs_iext_prev(ifp, icur); in xfs_bmap_add_extent_hole_delay()
2675 xfs_iext_prev(ifp, icur); in xfs_bmap_add_extent_hole_delay()
2731 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmap_add_extent_hole_real() local
2750 if (xfs_iext_peek_prev_extent(ifp, icur, &left)) { in xfs_bmap_add_extent_hole_real()
2760 if (xfs_iext_get_extent(ifp, icur, &right)) { in xfs_bmap_add_extent_hole_real()
2803 xfs_iext_prev(ifp, icur); in xfs_bmap_add_extent_hole_real()
2805 ifp->if_nextents--; in xfs_bmap_add_extent_hole_real()
2850 xfs_iext_prev(ifp, icur); in xfs_bmap_add_extent_hole_real()
2909 ifp->if_nextents++; in xfs_bmap_add_extent_hole_real()
3972 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmapi_read() local
3985 if (WARN_ON_ONCE(!ifp)) { in xfs_bmapi_read()
3990 if (XFS_IS_CORRUPT(mp, !xfs_ifork_has_extents(ifp)) || in xfs_bmapi_read()
4005 if (!xfs_iext_lookup_extent(ip, ifp, bno, &icur, &got)) in xfs_bmapi_read()
4037 if (!xfs_iext_next_extent(ifp, &icur, &got)) in xfs_bmapi_read()
4069 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmapi_reserve_delalloc() local
4103 if (!xfs_iext_peek_prev_extent(ifp, icur, &prev)) in xfs_bmapi_reserve_delalloc()
4188 struct xfs_ifork *ifp = xfs_ifork_ptr(bma->ip, whichfork); in xfs_bmapi_allocate() local
4241 if (ifp->if_format == XFS_DINODE_FMT_BTREE && !bma->cur) in xfs_bmapi_allocate()
4274 xfs_iext_get_extent(ifp, &bma->icur, &bma->got); in xfs_bmapi_allocate()
4292 struct xfs_ifork *ifp = xfs_ifork_ptr(bma->ip, whichfork); in xfs_bmapi_convert_unwritten() local
4311 if (ifp->if_format == XFS_DINODE_FMT_BTREE && !bma->cur) { in xfs_bmapi_convert_unwritten()
4352 xfs_iext_get_extent(ifp, &bma->icur, &bma->got); in xfs_bmapi_convert_unwritten()
4369 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, fork); in xfs_bmapi_minleft() local
4373 if (ifp->if_format != XFS_DINODE_FMT_BTREE) in xfs_bmapi_minleft()
4375 return be16_to_cpu(ifp->if_broot->bb_level) + 1; in xfs_bmapi_minleft()
4390 struct xfs_ifork *ifp = xfs_ifork_ptr(bma->ip, whichfork); in xfs_bmapi_finish() local
4393 ifp->if_format != XFS_DINODE_FMT_EXTENTS) in xfs_bmapi_finish()
4396 ifp->if_format != XFS_DINODE_FMT_BTREE) in xfs_bmapi_finish()
4438 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmapi_write() local
4463 ASSERT(ifp->if_format != XFS_DINODE_FMT_LOCAL); in xfs_bmapi_write()
4479 if (XFS_IS_CORRUPT(mp, !xfs_ifork_has_extents(ifp)) || in xfs_bmapi_write()
4494 if (!xfs_iext_lookup_extent(ip, ifp, bno, &bma.icur, &bma.got)) in xfs_bmapi_write()
4496 if (!xfs_iext_peek_prev_extent(ifp, &bma.icur, &bma.prev)) in xfs_bmapi_write()
4598 if (!xfs_iext_next_extent(ifp, &bma.icur, &bma.got)) in xfs_bmapi_write()
4607 ASSERT(ifp->if_format != XFS_DINODE_FMT_BTREE || in xfs_bmapi_write()
4608 ifp->if_nextents > XFS_IFORK_MAXEXT(ip, whichfork)); in xfs_bmapi_write()
4647 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmapi_convert_one_delalloc() local
4675 if (!xfs_iext_lookup_extent(ip, ifp, offset_fsb, &bma.icur, &bma.got) || in xfs_bmapi_convert_one_delalloc()
4695 *seq = READ_ONCE(ifp->if_seq); in xfs_bmapi_convert_one_delalloc()
4729 if (!xfs_iext_peek_prev_extent(ifp, &bma.icur, &bma.prev)) in xfs_bmapi_convert_one_delalloc()
4743 *seq = READ_ONCE(ifp->if_seq); in xfs_bmapi_convert_one_delalloc()
4806 struct xfs_ifork *ifp; in xfs_bmapi_remap() local
4813 ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmapi_remap()
4822 if (XFS_IS_CORRUPT(mp, !xfs_ifork_has_extents(ifp)) || in xfs_bmapi_remap()
4835 if (xfs_iext_lookup_extent(ip, ifp, bno, &icur, &got)) { in xfs_bmapi_remap()
4845 if (ifp->if_format == XFS_DINODE_FMT_BTREE) in xfs_bmapi_remap()
4954 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmap_del_extent_delay() local
4994 xfs_iext_prev(ifp, icur); in xfs_bmap_del_extent_delay()
5060 xfs_iext_next(ifp, icur); in xfs_bmap_del_extent_delay()
5088 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, XFS_COW_FORK); in xfs_bmap_del_extent_cow() local
5114 xfs_iext_prev(ifp, icur); in xfs_bmap_del_extent_cow()
5144 xfs_iext_next(ifp, icur); in xfs_bmap_del_extent_cow()
5200 struct xfs_ifork *ifp; /* inode fork pointer */ in xfs_bmap_del_extent_real() local
5214 ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmap_del_extent_real()
5216 xfs_iext_get_extent(ifp, icur, &got); in xfs_bmap_del_extent_real()
5233 ifp->if_format == XFS_DINODE_FMT_EXTENTS && in xfs_bmap_del_extent_real()
5234 ifp->if_nextents >= XFS_IFORK_MAXEXT(ip, whichfork) && in xfs_bmap_del_extent_real()
5267 xfs_iext_prev(ifp, icur); in xfs_bmap_del_extent_real()
5268 ifp->if_nextents--; in xfs_bmap_del_extent_real()
5378 ifp->if_nextents++; in xfs_bmap_del_extent_real()
5379 xfs_iext_next(ifp, icur); in xfs_bmap_del_extent_real()
5459 struct xfs_ifork *ifp; /* inode fork pointer */ in __xfs_bunmapi() local
5476 ifp = xfs_ifork_ptr(ip, whichfork); in __xfs_bunmapi()
5477 if (XFS_IS_CORRUPT(mp, !xfs_ifork_has_extents(ifp))) { in __xfs_bunmapi()
5492 if (xfs_iext_count(ifp) == 0) { in __xfs_bunmapi()
5500 if (!xfs_iext_lookup_extent_before(ip, ifp, &end, &icur, &got)) { in __xfs_bunmapi()
5507 if (ifp->if_format == XFS_DINODE_FMT_BTREE) { in __xfs_bunmapi()
5508 ASSERT(ifp->if_format == XFS_DINODE_FMT_BTREE); in __xfs_bunmapi()
5521 !xfs_iext_prev_extent(ifp, &icur, &got)) { in __xfs_bunmapi()
5571 !xfs_iext_prev_extent(ifp, &icur, &got)) { in __xfs_bunmapi()
5624 !xfs_iext_prev_extent(ifp, &icur, &got)) { in __xfs_bunmapi()
5639 if (!xfs_iext_prev_extent(ifp, &icur, &prev)) in __xfs_bunmapi()
5689 if (!xfs_iext_get_extent(ifp, &icur, &got) || in __xfs_bunmapi()
5691 !xfs_iext_prev_extent(ifp, &icur, &got))) { in __xfs_bunmapi()
5722 ifp->if_format != XFS_DINODE_FMT_EXTENTS) in __xfs_bunmapi()
5725 ifp->if_format != XFS_DINODE_FMT_BTREE) in __xfs_bunmapi()
5810 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmse_merge() local
5828 ifp->if_nextents--; in xfs_bmse_merge()
5872 xfs_iext_prev(ifp, icur); in xfs_bmse_merge()
5938 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmap_collapse_extents() local
5946 if (XFS_IS_CORRUPT(mp, !xfs_ifork_has_extents(ifp)) || in xfs_bmap_collapse_extents()
5961 if (ifp->if_format == XFS_DINODE_FMT_BTREE) in xfs_bmap_collapse_extents()
5964 if (!xfs_iext_lookup_extent(ip, ifp, *next_fsb, &icur, &got)) { in xfs_bmap_collapse_extents()
5975 if (xfs_iext_peek_prev_extent(ifp, &icur, &prev)) { in xfs_bmap_collapse_extents()
6003 if (!xfs_iext_next_extent(ifp, &icur, &got)) { in xfs_bmap_collapse_extents()
6054 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmap_insert_extents() local
6062 if (XFS_IS_CORRUPT(mp, !xfs_ifork_has_extents(ifp)) || in xfs_bmap_insert_extents()
6077 if (ifp->if_format == XFS_DINODE_FMT_BTREE) in xfs_bmap_insert_extents()
6081 xfs_iext_last(ifp, &icur); in xfs_bmap_insert_extents()
6082 if (!xfs_iext_get_extent(ifp, &icur, &got) || in xfs_bmap_insert_extents()
6088 if (!xfs_iext_lookup_extent(ip, ifp, *next_fsb, &icur, &got)) { in xfs_bmap_insert_extents()
6106 if (xfs_iext_peek_next_extent(ifp, &icur, &next)) { in xfs_bmap_insert_extents()
6128 if (!xfs_iext_prev_extent(ifp, &icur, &got) || in xfs_bmap_insert_extents()
6156 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_bmap_split_extent() local
6167 if (XFS_IS_CORRUPT(mp, !xfs_ifork_has_extents(ifp)) || in xfs_bmap_split_extent()
6184 if (!xfs_iext_lookup_extent(ip, ifp, split_fsb, &icur, &got) || in xfs_bmap_split_extent()
6194 if (ifp->if_format == XFS_DINODE_FMT_BTREE) { in xfs_bmap_split_extent()
6219 xfs_iext_next(ifp, &icur); in xfs_bmap_split_extent()
6221 ifp->if_nextents++; in xfs_bmap_split_extent()