/fs/xfs/libxfs/ |
D | xfs_inode_fork.c | 38 struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, whichfork); in xfs_init_local_fork() local 59 ifp->if_u1.if_data = kmem_zalloc(real_size, KM_NOFS); in xfs_init_local_fork() 60 memcpy(ifp->if_u1.if_data, data, size); in xfs_init_local_fork() 62 ifp->if_u1.if_data[size] = '\0'; in xfs_init_local_fork() 64 ifp->if_u1.if_data = NULL; in xfs_init_local_fork() 67 ifp->if_bytes = size; in xfs_init_local_fork() 111 struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, whichfork); in xfs_iformat_extents() local 133 ifp->if_bytes = 0; in xfs_iformat_extents() 134 ifp->if_u1.if_root = NULL; in xfs_iformat_extents() 135 ifp->if_height = 0; in xfs_iformat_extents() [all …]
|
D | xfs_iext_tree.c | 128 inline xfs_extnum_t xfs_iext_count(struct xfs_ifork *ifp) in xfs_iext_count() argument 130 return ifp->if_bytes / sizeof(struct xfs_iext_rec); in xfs_iext_count() 133 static inline int xfs_iext_max_recs(struct xfs_ifork *ifp) in xfs_iext_max_recs() argument 135 if (ifp->if_height == 1) in xfs_iext_max_recs() 136 return xfs_iext_count(ifp); in xfs_iext_max_recs() 145 static inline bool xfs_iext_valid(struct xfs_ifork *ifp, in xfs_iext_valid() argument 150 if (cur->pos < 0 || cur->pos >= xfs_iext_max_recs(ifp)) in xfs_iext_valid() 159 struct xfs_ifork *ifp) in xfs_iext_find_first_leaf() argument 161 struct xfs_iext_node *node = ifp->if_u1.if_root; in xfs_iext_find_first_leaf() 164 if (!ifp->if_height) in xfs_iext_find_first_leaf() [all …]
|
D | xfs_inode_fork.h | 116 static inline bool xfs_ifork_has_extents(struct xfs_ifork *ifp) in xfs_ifork_has_extents() argument 118 return ifp->if_format == XFS_DINODE_FMT_EXTENTS || in xfs_ifork_has_extents() 119 ifp->if_format == XFS_DINODE_FMT_BTREE; in xfs_ifork_has_extents() 122 static inline xfs_extnum_t xfs_ifork_nextents(struct xfs_ifork *ifp) in xfs_ifork_nextents() argument 124 if (!ifp) in xfs_ifork_nextents() 126 return ifp->if_nextents; in xfs_ifork_nextents() 129 static inline int8_t xfs_ifork_format(struct xfs_ifork *ifp) in xfs_ifork_format() argument 131 if (!ifp) in xfs_ifork_format() 133 return ifp->if_format; in xfs_ifork_format() 144 void xfs_idestroy_fork(struct xfs_ifork *ifp); [all …]
|
D | xfs_bmap.c | 133 struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, whichfork); in xfs_bmap_needs_btree() local 136 ifp->if_format == XFS_DINODE_FMT_EXTENTS && in xfs_bmap_needs_btree() 137 ifp->if_nextents > XFS_IFORK_MAXEXT(ip, whichfork); in xfs_bmap_needs_btree() 145 struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, whichfork); in xfs_bmap_wants_extents() local 148 ifp->if_format == XFS_DINODE_FMT_BTREE && in xfs_bmap_wants_extents() 149 ifp->if_nextents <= XFS_IFORK_MAXEXT(ip, whichfork); in xfs_bmap_wants_extents() 324 struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, whichfork); in xfs_bmap_check_leaf_extents() local 337 if (ifp->if_format != XFS_DINODE_FMT_BTREE) in xfs_bmap_check_leaf_extents() 345 block = ifp->if_broot; in xfs_bmap_check_leaf_extents() 351 xfs_check_block(block, mp, 1, ifp->if_broot_bytes); in xfs_bmap_check_leaf_extents() [all …]
|
D | xfs_symlink_remote.c | 169 struct xfs_ifork *ifp) in xfs_symlink_local_to_remote() argument 178 memcpy(bp->b_addr, ifp->if_u1.if_data, ifp->if_bytes); in xfs_symlink_local_to_remote() 179 xfs_trans_log_buf(tp, bp, 0, ifp->if_bytes - 1); in xfs_symlink_local_to_remote() 188 ifp->if_bytes + sizeof(struct xfs_dsymlink_hdr)); in xfs_symlink_local_to_remote() 193 buf += xfs_symlink_hdr_set(mp, ip->i_ino, 0, ifp->if_bytes, bp); in xfs_symlink_local_to_remote() 194 memcpy(buf, ifp->if_u1.if_data, ifp->if_bytes); in xfs_symlink_local_to_remote() 196 ifp->if_bytes - 1); in xfs_symlink_local_to_remote() 207 struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, XFS_DATA_FORK); in xfs_symlink_shortform_verify() local 208 char *sfp = (char *)ifp->if_u1.if_data; in xfs_symlink_shortform_verify() 209 int size = ifp->if_bytes; in xfs_symlink_shortform_verify() [all …]
|
D | xfs_bmap_btree.c | 303 struct xfs_ifork *ifp; in xfs_bmbt_get_minrecs() local 305 ifp = XFS_IFORK_PTR(cur->bc_ino.ip, in xfs_bmbt_get_minrecs() 309 ifp->if_broot_bytes, level == 0) / 2; in xfs_bmbt_get_minrecs() 321 struct xfs_ifork *ifp; in xfs_bmbt_get_maxrecs() local 323 ifp = XFS_IFORK_PTR(cur->bc_ino.ip, in xfs_bmbt_get_maxrecs() 327 ifp->if_broot_bytes, level == 0); in xfs_bmbt_get_maxrecs() 551 struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, whichfork); in xfs_bmbt_init_cursor() local 559 cur->bc_nlevels = be16_to_cpu(ifp->if_broot->bb_level) + 1; in xfs_bmbt_init_cursor()
|
D | xfs_attr_leaf.c | 655 struct xfs_ifork *ifp = dp->i_afp; in xfs_attr_shortform_create() local 660 ASSERT(ifp->if_bytes == 0); in xfs_attr_shortform_create() 661 if (ifp->if_format == XFS_DINODE_FMT_EXTENTS) in xfs_attr_shortform_create() 662 ifp->if_format = XFS_DINODE_FMT_LOCAL; in xfs_attr_shortform_create() 664 hdr = (struct xfs_attr_sf_hdr *)ifp->if_u1.if_data; in xfs_attr_shortform_create() 729 struct xfs_ifork *ifp; in xfs_attr_shortform_add() local 737 ifp = dp->i_afp; in xfs_attr_shortform_add() 738 ASSERT(ifp->if_format == XFS_DINODE_FMT_LOCAL); in xfs_attr_shortform_add() 739 sf = (struct xfs_attr_shortform *)ifp->if_u1.if_data; in xfs_attr_shortform_add() 746 sf = (struct xfs_attr_shortform *)ifp->if_u1.if_data; in xfs_attr_shortform_add() [all …]
|
D | xfs_btree_staging.c | 381 struct xfs_ifork *ifp = xfs_btree_ifork_ptr(cur); in xfs_btree_bload_prep_block() local 388 ifp->if_broot = kmem_zalloc(new_size, 0); in xfs_btree_bload_prep_block() 389 ifp->if_broot_bytes = (int)new_size; in xfs_btree_bload_prep_block() 392 xfs_btree_init_block_int(cur->bc_mp, ifp->if_broot, in xfs_btree_bload_prep_block() 398 *blockp = ifp->if_broot; in xfs_btree_bload_prep_block()
|
D | xfs_dir2_block.c | 1074 struct xfs_ifork *ifp = XFS_IFORK_PTR(dp, XFS_DATA_FORK); in xfs_dir2_sf_to_block() local 1099 ASSERT(ifp->if_format == XFS_DINODE_FMT_LOCAL); in xfs_dir2_sf_to_block() 1102 oldsfp = (xfs_dir2_sf_hdr_t *)ifp->if_u1.if_data; in xfs_dir2_sf_to_block() 1104 ASSERT(ifp->if_bytes == dp->i_disk_size); in xfs_dir2_sf_to_block() 1105 ASSERT(ifp->if_u1.if_data != NULL); in xfs_dir2_sf_to_block() 1113 sfp = kmem_alloc(ifp->if_bytes, 0); in xfs_dir2_sf_to_block() 1114 memcpy(sfp, oldsfp, ifp->if_bytes); in xfs_dir2_sf_to_block() 1116 xfs_idata_realloc(dp, -ifp->if_bytes, XFS_DATA_FORK); in xfs_dir2_sf_to_block()
|
D | xfs_attr.c | 88 struct xfs_ifork *ifp = ip->i_afp; in xfs_attr_is_leaf() local 92 if (ifp->if_nextents != 1 || ifp->if_format != XFS_DINODE_FMT_EXTENTS) in xfs_attr_is_leaf() 95 xfs_iext_first(ifp, &icur); in xfs_attr_is_leaf() 96 xfs_iext_get_extent(ifp, &icur, &imap); in xfs_attr_is_leaf()
|
D | xfs_shared.h | 131 struct xfs_inode *ip, struct xfs_ifork *ifp);
|
D | xfs_dir2_sf.c | 713 struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, XFS_DATA_FORK); in xfs_dir2_sf_verify() local 726 ASSERT(ifp->if_format == XFS_DINODE_FMT_LOCAL); in xfs_dir2_sf_verify() 728 sfp = (struct xfs_dir2_sf_hdr *)ifp->if_u1.if_data; in xfs_dir2_sf_verify() 729 size = ifp->if_bytes; in xfs_dir2_sf_verify()
|
/fs/xfs/scrub/ |
D | bmap.c | 396 struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, info->whichfork); in xchk_bmapbt_rec() local 426 if (!xfs_iext_lookup_extent(ip, ifp, irec.br_startoff, &icur, in xchk_bmapbt_rec() 445 struct xfs_ifork *ifp = XFS_IFORK_PTR(sc->ip, whichfork); in xchk_bmap_btree() local 452 info->was_loaded = !xfs_need_iread_extents(ifp); in xchk_bmap_btree() 483 struct xfs_ifork *ifp; in xchk_bmap_check_rmap() local 497 ifp = XFS_IFORK_PTR(sc->ip, sbcri->whichfork); in xchk_bmap_check_rmap() 498 if (!ifp) { in xchk_bmap_check_rmap() 503 have_map = xfs_iext_lookup_extent(sc->ip, ifp, rec->rm_offset, in xchk_bmap_check_rmap() 535 have_map = xfs_iext_next_extent(ifp, &sbcri->icur, &irec); in xchk_bmap_check_rmap() 582 struct xfs_ifork *ifp = XFS_IFORK_PTR(sc->ip, whichfork); in xchk_bmap_check_rmaps() local [all …]
|
D | symlink.c | 38 struct xfs_ifork *ifp; in xchk_symlink() local 44 ifp = XFS_IFORK_PTR(ip, XFS_DATA_FORK); in xchk_symlink() 54 if (ifp->if_format == XFS_DINODE_FMT_LOCAL) { in xchk_symlink() 56 len > strnlen(ifp->if_u1.if_data, XFS_IFORK_DSIZE(ip))) in xchk_symlink()
|
D | dir.c | 665 struct xfs_ifork *ifp = XFS_IFORK_PTR(sc->ip, XFS_DATA_FORK); in xchk_directory_blocks() local 677 if (ifp->if_format != XFS_DINODE_FMT_EXTENTS && in xchk_directory_blocks() 678 ifp->if_format != XFS_DINODE_FMT_BTREE) in xchk_directory_blocks() 694 found = xfs_iext_lookup_extent(sc->ip, ifp, lblk, &icur, &got); in xchk_directory_blocks() 722 found = xfs_iext_lookup_extent(sc->ip, ifp, lblk, &icur, &got); in xchk_directory_blocks() 729 if (xfs_iext_lookup_extent(sc->ip, ifp, leaf_lblk, &icur, &got) && in xchk_directory_blocks() 732 !xfs_iext_next_extent(ifp, &icur, &got)) { in xchk_directory_blocks() 748 found = xfs_iext_lookup_extent(sc->ip, ifp, lblk, &icur, &got); in xchk_directory_blocks() 786 found = xfs_iext_lookup_extent(sc->ip, ifp, lblk, &icur, &got); in xchk_directory_blocks()
|
D | quota.c | 177 struct xfs_ifork *ifp; in xchk_quota_data_fork() local 188 ifp = XFS_IFORK_PTR(sc->ip, XFS_DATA_FORK); in xchk_quota_data_fork() 189 for_each_xfs_iext(ifp, &icur, &irec) { in xchk_quota_data_fork()
|
/fs/xfs/ |
D | xfs_bmap_util.c | 229 struct xfs_ifork *ifp, in xfs_bmap_count_leaves() argument 236 for_each_xfs_iext(ifp, &icur, &got) { in xfs_bmap_count_leaves() 259 struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, whichfork); in xfs_bmap_count_blocks() local 267 if (!ifp) in xfs_bmap_count_blocks() 270 switch (ifp->if_format) { in xfs_bmap_count_blocks() 291 *nextents = xfs_bmap_count_leaves(ifp, count); in xfs_bmap_count_blocks() 415 struct xfs_ifork *ifp; in xfs_getbmap() local 442 ifp = XFS_IFORK_PTR(ip, whichfork); in xfs_getbmap() 455 if (!ifp) in xfs_getbmap() 494 switch (ifp->if_format) { in xfs_getbmap() [all …]
|
D | xfs_reflink.c | 583 struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, XFS_COW_FORK); in xfs_reflink_cancel_cow_blocks() local 590 if (!xfs_iext_lookup_extent_before(ip, ifp, &end_fsb, &icur, &got)) in xfs_reflink_cancel_cow_blocks() 600 xfs_iext_prev(ifp, &icur); in xfs_reflink_cancel_cow_blocks() 636 xfs_iext_prev(ifp, &icur); in xfs_reflink_cancel_cow_blocks() 639 if (!xfs_iext_get_extent(ifp, &icur, &got)) in xfs_reflink_cancel_cow_blocks() 644 if (!ifp->if_bytes) in xfs_reflink_cancel_cow_blocks() 724 struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, XFS_COW_FORK); in xfs_reflink_end_cow_extent() local 730 if (ifp->if_bytes == 0) { in xfs_reflink_end_cow_extent() 759 if (!xfs_iext_lookup_extent_before(ip, ifp, end_fsb, &icur, &got) || in xfs_reflink_end_cow_extent() 1521 struct xfs_ifork *ifp; in xfs_reflink_inode_has_shared_extents() local [all …]
|
D | xfs_dir2_readdir.c | 250 struct xfs_ifork *ifp = XFS_IFORK_PTR(dp, XFS_DATA_FORK); in xfs_dir2_leaf_readbuf() local 272 if (!xfs_iext_lookup_extent(dp, ifp, map_off, &icur, &map)) in xfs_dir2_leaf_readbuf() 300 !xfs_iext_next_extent(ifp, &icur, &map)) in xfs_dir2_leaf_readbuf() 324 if (!xfs_iext_next_extent(ifp, &icur, &map)) { in xfs_dir2_leaf_readbuf()
|
D | xfs_iomap.c | 156 struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, XFS_DATA_FORK); in xfs_iomap_eof_align_last_fsb() local 162 ASSERT(!xfs_need_iread_extents(ifp)); in xfs_iomap_eof_align_last_fsb() 177 xfs_iext_last(ifp, &icur); in xfs_iomap_eof_align_last_fsb() 178 if (!xfs_iext_get_extent(ifp, &icur, &irec) || in xfs_iomap_eof_align_last_fsb() 364 struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, whichfork); in xfs_iomap_prealloc_size() local 387 !xfs_iext_prev_extent(ifp, &ncur, &prev) || in xfs_iomap_prealloc_size() 397 while (xfs_iext_prev_extent(ifp, &ncur, &got)) { in xfs_iomap_prealloc_size()
|
D | xfs_bmap_util.h | 74 xfs_extnum_t xfs_bmap_count_leaves(struct xfs_ifork *ifp, xfs_filblks_t *count);
|
D | xfs_icache.c | 1792 struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, whichfork); in xfs_check_delalloc() local 1796 if (!ifp || !xfs_iext_lookup_extent(ip, ifp, 0, &icur, &got)) in xfs_check_delalloc() 1806 } while (xfs_iext_next_extent(ifp, &icur, &got)); in xfs_check_delalloc()
|
D | xfs_ioctl.c | 1065 struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, whichfork); in xfs_fill_fsxattr() local 1090 if (ifp && !xfs_need_iread_extents(ifp)) in xfs_fill_fsxattr() 1091 fa->fsx_nextents = xfs_iext_count(ifp); in xfs_fill_fsxattr() 1093 fa->fsx_nextents = xfs_ifork_nextents(ifp); in xfs_fill_fsxattr()
|
D | xfs_qm.c | 1166 struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, XFS_DATA_FORK); in xfs_qm_dqusage_adjust() local 1172 xfs_bmap_count_leaves(ifp, &rtblks); in xfs_qm_dqusage_adjust()
|
/fs/btrfs/ |
D | backref.c | 2345 struct inode_fs_paths *ifp; local 2352 ifp = kmalloc(sizeof(*ifp), GFP_KERNEL); 2353 if (!ifp) { 2358 ifp->btrfs_path = path; 2359 ifp->fspath = fspath; 2360 ifp->fs_root = fs_root; 2362 return ifp;
|