Lines Matching full:ifp
40 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_init_local_fork() local
62 ifp->if_data = new_data; in xfs_init_local_fork()
64 ifp->if_data = NULL; in xfs_init_local_fork()
67 ifp->if_bytes = size; in xfs_init_local_fork()
112 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_iformat_extents() local
135 ifp->if_bytes = 0; in xfs_iformat_extents()
136 ifp->if_data = NULL; in xfs_iformat_extents()
137 ifp->if_height = 0; in xfs_iformat_extents()
141 xfs_iext_first(ifp, &icur); in xfs_iformat_extents()
158 xfs_iext_next(ifp, &icur); in xfs_iformat_extents()
180 struct xfs_ifork *ifp; in xfs_iformat_btree() local
186 ifp = xfs_ifork_ptr(ip, whichfork); in xfs_iformat_btree()
199 if (unlikely(ifp->if_nextents <= XFS_IFORK_MAXEXT(ip, whichfork) || in xfs_iformat_btree()
203 ifp->if_nextents > ip->i_nblocks) || in xfs_iformat_btree()
214 ifp->if_broot_bytes = size; in xfs_iformat_btree()
215 ifp->if_broot = kmalloc(size, in xfs_iformat_btree()
217 ASSERT(ifp->if_broot != NULL); in xfs_iformat_btree()
223 ifp->if_broot, size); in xfs_iformat_btree()
225 ifp->if_bytes = 0; in xfs_iformat_btree()
226 ifp->if_data = NULL; in xfs_iformat_btree()
227 ifp->if_height = 0; in xfs_iformat_btree()
391 struct xfs_ifork *ifp; in xfs_iroot_realloc() local
405 ifp = xfs_ifork_ptr(ip, whichfork); in xfs_iroot_realloc()
411 if (ifp->if_broot_bytes == 0) { in xfs_iroot_realloc()
413 ifp->if_broot = kmalloc(new_size, in xfs_iroot_realloc()
415 ifp->if_broot_bytes = (int)new_size; in xfs_iroot_realloc()
425 cur_max = xfs_bmbt_maxrecs(mp, ifp->if_broot_bytes, false); in xfs_iroot_realloc()
428 ifp->if_broot = krealloc(ifp->if_broot, new_size, in xfs_iroot_realloc()
430 op = (char *)xfs_bmap_broot_ptr_addr(mp, ifp->if_broot, 1, in xfs_iroot_realloc()
431 ifp->if_broot_bytes); in xfs_iroot_realloc()
432 np = (char *)xfs_bmap_broot_ptr_addr(mp, ifp->if_broot, 1, in xfs_iroot_realloc()
434 ifp->if_broot_bytes = (int)new_size; in xfs_iroot_realloc()
435 ASSERT(xfs_bmap_bmdr_space(ifp->if_broot) <= in xfs_iroot_realloc()
446 ASSERT((ifp->if_broot != NULL) && (ifp->if_broot_bytes > 0)); in xfs_iroot_realloc()
447 cur_max = xfs_bmbt_maxrecs(mp, ifp->if_broot_bytes, false); in xfs_iroot_realloc()
459 memcpy(new_broot, ifp->if_broot, in xfs_iroot_realloc()
472 op = (char *)xfs_bmbt_key_addr(mp, ifp->if_broot, 1); in xfs_iroot_realloc()
479 op = (char *)xfs_bmap_broot_ptr_addr(mp, ifp->if_broot, 1, in xfs_iroot_realloc()
480 ifp->if_broot_bytes); in xfs_iroot_realloc()
485 kfree(ifp->if_broot); in xfs_iroot_realloc()
486 ifp->if_broot = new_broot; in xfs_iroot_realloc()
487 ifp->if_broot_bytes = (int)new_size; in xfs_iroot_realloc()
488 if (ifp->if_broot) in xfs_iroot_realloc()
489 ASSERT(xfs_bmap_bmdr_space(ifp->if_broot) <= in xfs_iroot_realloc()
516 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_idata_realloc() local
517 int64_t new_size = ifp->if_bytes + byte_diff; in xfs_idata_realloc()
523 ifp->if_data = krealloc(ifp->if_data, new_size, in xfs_idata_realloc()
526 ifp->if_data = NULL; in xfs_idata_realloc()
527 ifp->if_bytes = new_size; in xfs_idata_realloc()
530 return ifp->if_data; in xfs_idata_realloc()
536 struct xfs_ifork *ifp) in xfs_idestroy_fork() argument
538 if (ifp->if_broot != NULL) { in xfs_idestroy_fork()
539 kfree(ifp->if_broot); in xfs_idestroy_fork()
540 ifp->if_broot = NULL; in xfs_idestroy_fork()
543 switch (ifp->if_format) { in xfs_idestroy_fork()
545 kfree(ifp->if_data); in xfs_idestroy_fork()
546 ifp->if_data = NULL; in xfs_idestroy_fork()
550 if (ifp->if_height) in xfs_idestroy_fork()
551 xfs_iext_destroy(ifp); in xfs_idestroy_fork()
572 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_iextents_copy() local
578 ASSERT(ifp->if_bytes > 0); in xfs_iextents_copy()
580 for_each_xfs_iext(ifp, &icur, &rec) { in xfs_iextents_copy()
591 ASSERT(copied <= ifp->if_bytes); in xfs_iextents_copy()
613 struct xfs_ifork *ifp; in xfs_iflush_fork() local
624 ifp = xfs_ifork_ptr(ip, whichfork); in xfs_iflush_fork()
629 if (!ifp) { in xfs_iflush_fork()
635 switch (ifp->if_format) { in xfs_iflush_fork()
638 (ifp->if_bytes > 0)) { in xfs_iflush_fork()
639 ASSERT(ifp->if_data != NULL); in xfs_iflush_fork()
640 ASSERT(ifp->if_bytes <= xfs_inode_fork_size(ip, whichfork)); in xfs_iflush_fork()
641 memcpy(cp, ifp->if_data, ifp->if_bytes); in xfs_iflush_fork()
647 (ifp->if_bytes > 0)) { in xfs_iflush_fork()
648 ASSERT(ifp->if_nextents > 0); in xfs_iflush_fork()
656 (ifp->if_broot_bytes > 0)) { in xfs_iflush_fork()
657 ASSERT(ifp->if_broot != NULL); in xfs_iflush_fork()
658 ASSERT(xfs_bmap_bmdr_space(ifp->if_broot) <= in xfs_iflush_fork()
660 xfs_bmbt_to_bmdr(mp, ifp->if_broot, ifp->if_broot_bytes, in xfs_iflush_fork()
718 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, XFS_DATA_FORK); in xfs_ifork_verify_local_data() local
719 struct xfs_dir2_sf_hdr *sfp = ifp->if_data; in xfs_ifork_verify_local_data()
721 fa = xfs_dir2_sf_verify(mp, sfp, ifp->if_bytes); in xfs_ifork_verify_local_data()
725 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, XFS_DATA_FORK); in xfs_ifork_verify_local_data() local
727 fa = xfs_symlink_shortform_verify(ifp->if_data, ifp->if_bytes); in xfs_ifork_verify_local_data()
748 struct xfs_ifork *ifp = &ip->i_af; in xfs_ifork_verify_local_attr() local
754 struct xfs_ifork *ifp = &ip->i_af; in xfs_ifork_verify_local_attr() local
756 ASSERT(ifp->if_format == XFS_DINODE_FMT_LOCAL); in xfs_ifork_verify_local_attr()
757 fa = xfs_attr_shortform_verify(ifp->if_data, ifp->if_bytes); in xfs_ifork_verify_local_attr()
761 ifp->if_data, ifp->if_bytes, fa); in xfs_ifork_verify_local_attr()
785 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_iext_count_extend() local
794 nr_exts = ifp->if_nextents + nr_to_add; in xfs_iext_count_extend()
795 if (nr_exts < ifp->if_nextents) in xfs_iext_count_extend()