Lines Matching refs:ifp
42 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_init_local_fork() local
64 ifp->if_data = new_data; in xfs_init_local_fork()
66 ifp->if_data = NULL; in xfs_init_local_fork()
69 ifp->if_bytes = size; in xfs_init_local_fork()
114 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_iformat_extents() local
137 ifp->if_bytes = 0; in xfs_iformat_extents()
138 ifp->if_data = NULL; in xfs_iformat_extents()
139 ifp->if_height = 0; in xfs_iformat_extents()
143 xfs_iext_first(ifp, &icur); in xfs_iformat_extents()
160 xfs_iext_next(ifp, &icur); in xfs_iformat_extents()
182 struct xfs_ifork *ifp; in xfs_iformat_btree() local
188 ifp = xfs_ifork_ptr(ip, whichfork); in xfs_iformat_btree()
201 if (unlikely(ifp->if_nextents <= XFS_IFORK_MAXEXT(ip, whichfork) || in xfs_iformat_btree()
205 ifp->if_nextents > ip->i_nblocks) || in xfs_iformat_btree()
216 broot = xfs_broot_alloc(ifp, size); in xfs_iformat_btree()
224 ifp->if_bytes = 0; in xfs_iformat_btree()
225 ifp->if_data = NULL; in xfs_iformat_btree()
226 ifp->if_height = 0; in xfs_iformat_btree()
381 struct xfs_ifork *ifp, in xfs_broot_alloc() argument
384 ASSERT(ifp->if_broot == NULL); in xfs_broot_alloc()
386 ifp->if_broot = kmalloc(new_size, in xfs_broot_alloc()
388 ifp->if_broot_bytes = new_size; in xfs_broot_alloc()
389 return ifp->if_broot; in xfs_broot_alloc()
398 struct xfs_ifork *ifp, in xfs_broot_realloc() argument
402 if (new_size == ifp->if_broot_bytes) in xfs_broot_realloc()
403 return ifp->if_broot; in xfs_broot_realloc()
407 ifp->if_broot_bytes = 0; in xfs_broot_realloc()
408 kfree(ifp->if_broot); in xfs_broot_realloc()
409 ifp->if_broot = NULL; in xfs_broot_realloc()
417 if (ifp->if_broot_bytes > 0 && ifp->if_broot_bytes > new_size) { in xfs_broot_realloc()
418 struct xfs_btree_block *old_broot = ifp->if_broot; in xfs_broot_realloc()
420 ifp->if_broot = kmalloc(new_size, GFP_KERNEL | __GFP_NOFAIL); in xfs_broot_realloc()
421 ifp->if_broot_bytes = new_size; in xfs_broot_realloc()
422 memcpy(ifp->if_broot, old_broot, new_size); in xfs_broot_realloc()
424 return ifp->if_broot; in xfs_broot_realloc()
431 ifp->if_broot = krealloc(ifp->if_broot, new_size, in xfs_broot_realloc()
433 ifp->if_broot_bytes = new_size; in xfs_broot_realloc()
434 return ifp->if_broot; in xfs_broot_realloc()
458 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_idata_realloc() local
459 int64_t new_size = ifp->if_bytes + byte_diff; in xfs_idata_realloc()
465 ifp->if_data = krealloc(ifp->if_data, new_size, in xfs_idata_realloc()
468 ifp->if_data = NULL; in xfs_idata_realloc()
469 ifp->if_bytes = new_size; in xfs_idata_realloc()
472 return ifp->if_data; in xfs_idata_realloc()
478 struct xfs_ifork *ifp) in xfs_idestroy_fork() argument
480 if (ifp->if_broot != NULL) { in xfs_idestroy_fork()
481 kfree(ifp->if_broot); in xfs_idestroy_fork()
482 ifp->if_broot = NULL; in xfs_idestroy_fork()
485 switch (ifp->if_format) { in xfs_idestroy_fork()
487 kfree(ifp->if_data); in xfs_idestroy_fork()
488 ifp->if_data = NULL; in xfs_idestroy_fork()
492 if (ifp->if_height) in xfs_idestroy_fork()
493 xfs_iext_destroy(ifp); in xfs_idestroy_fork()
514 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_iextents_copy() local
520 ASSERT(ifp->if_bytes > 0); in xfs_iextents_copy()
522 for_each_xfs_iext(ifp, &icur, &rec) { in xfs_iextents_copy()
533 ASSERT(copied <= ifp->if_bytes); in xfs_iextents_copy()
555 struct xfs_ifork *ifp; in xfs_iflush_fork() local
566 ifp = xfs_ifork_ptr(ip, whichfork); in xfs_iflush_fork()
571 if (!ifp) { in xfs_iflush_fork()
577 switch (ifp->if_format) { in xfs_iflush_fork()
580 (ifp->if_bytes > 0)) { in xfs_iflush_fork()
581 ASSERT(ifp->if_data != NULL); in xfs_iflush_fork()
582 ASSERT(ifp->if_bytes <= xfs_inode_fork_size(ip, whichfork)); in xfs_iflush_fork()
583 memcpy(cp, ifp->if_data, ifp->if_bytes); in xfs_iflush_fork()
589 (ifp->if_bytes > 0)) { in xfs_iflush_fork()
590 ASSERT(ifp->if_nextents > 0); in xfs_iflush_fork()
598 (ifp->if_broot_bytes > 0)) { in xfs_iflush_fork()
599 ASSERT(ifp->if_broot != NULL); in xfs_iflush_fork()
600 ASSERT(xfs_bmap_bmdr_space(ifp->if_broot) <= in xfs_iflush_fork()
602 xfs_bmbt_to_bmdr(mp, ifp->if_broot, ifp->if_broot_bytes, in xfs_iflush_fork()
679 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, XFS_DATA_FORK); in xfs_ifork_verify_local_data() local
680 struct xfs_dir2_sf_hdr *sfp = ifp->if_data; in xfs_ifork_verify_local_data()
682 fa = xfs_dir2_sf_verify(mp, sfp, ifp->if_bytes); in xfs_ifork_verify_local_data()
686 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, XFS_DATA_FORK); in xfs_ifork_verify_local_data() local
688 fa = xfs_symlink_shortform_verify(ifp->if_data, ifp->if_bytes); in xfs_ifork_verify_local_data()
709 struct xfs_ifork *ifp = &ip->i_af; in xfs_ifork_verify_local_attr() local
715 struct xfs_ifork *ifp = &ip->i_af; in xfs_ifork_verify_local_attr() local
717 ASSERT(ifp->if_format == XFS_DINODE_FMT_LOCAL); in xfs_ifork_verify_local_attr()
718 fa = xfs_attr_shortform_verify(ifp->if_data, ifp->if_bytes); in xfs_ifork_verify_local_attr()
722 ifp->if_data, ifp->if_bytes, fa); in xfs_ifork_verify_local_attr()
746 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_iext_count_extend() local
755 nr_exts = ifp->if_nextents + nr_to_add; in xfs_iext_count_extend()
756 if (nr_exts < ifp->if_nextents) in xfs_iext_count_extend()