Lines Matching refs:ifp

38 	struct xfs_ifork	*ifp = xfs_ifork_ptr(ip, whichfork);  in xfs_init_local_fork()  local
53 ifp->if_u1.if_data = kmem_alloc(mem_size, KM_NOFS); in xfs_init_local_fork()
54 memcpy(ifp->if_u1.if_data, data, size); in xfs_init_local_fork()
56 ifp->if_u1.if_data[size] = '\0'; in xfs_init_local_fork()
58 ifp->if_u1.if_data = NULL; in xfs_init_local_fork()
61 ifp->if_bytes = size; in xfs_init_local_fork()
105 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_iformat_extents() local
127 ifp->if_bytes = 0; in xfs_iformat_extents()
128 ifp->if_u1.if_root = NULL; in xfs_iformat_extents()
129 ifp->if_height = 0; in xfs_iformat_extents()
133 xfs_iext_first(ifp, &icur); in xfs_iformat_extents()
148 xfs_iext_next(ifp, &icur); in xfs_iformat_extents()
170 struct xfs_ifork *ifp; in xfs_iformat_btree() local
176 ifp = xfs_ifork_ptr(ip, whichfork); in xfs_iformat_btree()
189 if (unlikely(ifp->if_nextents <= XFS_IFORK_MAXEXT(ip, whichfork) || in xfs_iformat_btree()
193 ifp->if_nextents > ip->i_nblocks) || in xfs_iformat_btree()
203 ifp->if_broot_bytes = size; in xfs_iformat_btree()
204 ifp->if_broot = kmem_alloc(size, KM_NOFS); in xfs_iformat_btree()
205 ASSERT(ifp->if_broot != NULL); in xfs_iformat_btree()
211 ifp->if_broot, size); in xfs_iformat_btree()
213 ifp->if_bytes = 0; in xfs_iformat_btree()
214 ifp->if_u1.if_root = NULL; in xfs_iformat_btree()
215 ifp->if_height = 0; in xfs_iformat_btree()
363 struct xfs_ifork *ifp; in xfs_iroot_realloc() local
377 ifp = xfs_ifork_ptr(ip, whichfork); in xfs_iroot_realloc()
383 if (ifp->if_broot_bytes == 0) { in xfs_iroot_realloc()
385 ifp->if_broot = kmem_alloc(new_size, KM_NOFS); in xfs_iroot_realloc()
386 ifp->if_broot_bytes = (int)new_size; in xfs_iroot_realloc()
396 cur_max = xfs_bmbt_maxrecs(mp, ifp->if_broot_bytes, 0); in xfs_iroot_realloc()
399 ifp->if_broot = krealloc(ifp->if_broot, new_size, in xfs_iroot_realloc()
401 op = (char *)XFS_BMAP_BROOT_PTR_ADDR(mp, ifp->if_broot, 1, in xfs_iroot_realloc()
402 ifp->if_broot_bytes); in xfs_iroot_realloc()
403 np = (char *)XFS_BMAP_BROOT_PTR_ADDR(mp, ifp->if_broot, 1, in xfs_iroot_realloc()
405 ifp->if_broot_bytes = (int)new_size; in xfs_iroot_realloc()
406 ASSERT(XFS_BMAP_BMDR_SPACE(ifp->if_broot) <= in xfs_iroot_realloc()
417 ASSERT((ifp->if_broot != NULL) && (ifp->if_broot_bytes > 0)); in xfs_iroot_realloc()
418 cur_max = xfs_bmbt_maxrecs(mp, ifp->if_broot_bytes, 0); in xfs_iroot_realloc()
430 memcpy(new_broot, ifp->if_broot, in xfs_iroot_realloc()
443 op = (char *)XFS_BMBT_REC_ADDR(mp, ifp->if_broot, 1); in xfs_iroot_realloc()
450 op = (char *)XFS_BMAP_BROOT_PTR_ADDR(mp, ifp->if_broot, 1, in xfs_iroot_realloc()
451 ifp->if_broot_bytes); in xfs_iroot_realloc()
456 kmem_free(ifp->if_broot); in xfs_iroot_realloc()
457 ifp->if_broot = new_broot; in xfs_iroot_realloc()
458 ifp->if_broot_bytes = (int)new_size; in xfs_iroot_realloc()
459 if (ifp->if_broot) in xfs_iroot_realloc()
460 ASSERT(XFS_BMAP_BMDR_SPACE(ifp->if_broot) <= in xfs_iroot_realloc()
487 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_idata_realloc() local
488 int64_t new_size = ifp->if_bytes + byte_diff; in xfs_idata_realloc()
497 kmem_free(ifp->if_u1.if_data); in xfs_idata_realloc()
498 ifp->if_u1.if_data = NULL; in xfs_idata_realloc()
499 ifp->if_bytes = 0; in xfs_idata_realloc()
503 ifp->if_u1.if_data = krealloc(ifp->if_u1.if_data, new_size, in xfs_idata_realloc()
505 ifp->if_bytes = new_size; in xfs_idata_realloc()
510 struct xfs_ifork *ifp) in xfs_idestroy_fork() argument
512 if (ifp->if_broot != NULL) { in xfs_idestroy_fork()
513 kmem_free(ifp->if_broot); in xfs_idestroy_fork()
514 ifp->if_broot = NULL; in xfs_idestroy_fork()
517 switch (ifp->if_format) { in xfs_idestroy_fork()
519 kmem_free(ifp->if_u1.if_data); in xfs_idestroy_fork()
520 ifp->if_u1.if_data = NULL; in xfs_idestroy_fork()
524 if (ifp->if_height) in xfs_idestroy_fork()
525 xfs_iext_destroy(ifp); in xfs_idestroy_fork()
546 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_iextents_copy() local
552 ASSERT(ifp->if_bytes > 0); in xfs_iextents_copy()
554 for_each_xfs_iext(ifp, &icur, &rec) { in xfs_iextents_copy()
565 ASSERT(copied <= ifp->if_bytes); in xfs_iextents_copy()
587 struct xfs_ifork *ifp; in xfs_iflush_fork() local
598 ifp = xfs_ifork_ptr(ip, whichfork); in xfs_iflush_fork()
603 if (!ifp) { in xfs_iflush_fork()
609 switch (ifp->if_format) { in xfs_iflush_fork()
612 (ifp->if_bytes > 0)) { in xfs_iflush_fork()
613 ASSERT(ifp->if_u1.if_data != NULL); in xfs_iflush_fork()
614 ASSERT(ifp->if_bytes <= xfs_inode_fork_size(ip, whichfork)); in xfs_iflush_fork()
615 memcpy(cp, ifp->if_u1.if_data, ifp->if_bytes); in xfs_iflush_fork()
621 (ifp->if_bytes > 0)) { in xfs_iflush_fork()
622 ASSERT(ifp->if_nextents > 0); in xfs_iflush_fork()
630 (ifp->if_broot_bytes > 0)) { in xfs_iflush_fork()
631 ASSERT(ifp->if_broot != NULL); in xfs_iflush_fork()
632 ASSERT(XFS_BMAP_BMDR_SPACE(ifp->if_broot) <= in xfs_iflush_fork()
634 xfs_bmbt_to_bmdr(mp, ifp->if_broot, ifp->if_broot_bytes, in xfs_iflush_fork()
714 struct xfs_ifork *ifp = &ip->i_af; in xfs_ifork_verify_local_attr() local
724 ifp->if_u1.if_data, ifp->if_bytes, fa); in xfs_ifork_verify_local_attr()
737 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_iext_count_may_overflow() local
750 nr_exts = ifp->if_nextents + nr_to_add; in xfs_iext_count_may_overflow()
751 if (nr_exts < ifp->if_nextents || nr_exts > max_exts) in xfs_iext_count_may_overflow()