Lines Matching refs:ip
138 static inline bool xfs_bmap_needs_btree(struct xfs_inode *ip, int whichfork) in xfs_bmap_needs_btree() argument
140 return XFS_IFORK_FORMAT(ip, whichfork) == XFS_DINODE_FMT_EXTENTS && in xfs_bmap_needs_btree()
141 XFS_IFORK_NEXTENTS(ip, whichfork) > in xfs_bmap_needs_btree()
142 XFS_IFORK_MAXEXT(ip, whichfork); in xfs_bmap_needs_btree()
148 static inline bool xfs_bmap_wants_extents(struct xfs_inode *ip, int whichfork) in xfs_bmap_wants_extents() argument
150 return XFS_IFORK_FORMAT(ip, whichfork) == XFS_DINODE_FMT_BTREE && in xfs_bmap_wants_extents()
151 XFS_IFORK_NEXTENTS(ip, whichfork) <= in xfs_bmap_wants_extents()
152 XFS_IFORK_MAXEXT(ip, whichfork); in xfs_bmap_wants_extents()
180 xfs_inode_t *ip, /* incore inode pointer */ in xfs_bmap_worst_indlen() argument
188 mp = ip->i_mount; in xfs_bmap_worst_indlen()
210 struct xfs_inode *ip) in xfs_default_attroffset() argument
212 struct xfs_mount *mp = ip->i_mount; in xfs_default_attroffset()
216 offset = XFS_LITINO(mp, ip->i_d.di_version) - in xfs_default_attroffset()
222 ASSERT(offset < XFS_LITINO(mp, ip->i_d.di_version)); in xfs_default_attroffset()
233 xfs_inode_t *ip, in xfs_bmap_forkoff_reset() argument
237 ip->i_d.di_format != XFS_DINODE_FMT_DEV && in xfs_bmap_forkoff_reset()
238 ip->i_d.di_format != XFS_DINODE_FMT_UUID && in xfs_bmap_forkoff_reset()
239 ip->i_d.di_format != XFS_DINODE_FMT_BTREE) { in xfs_bmap_forkoff_reset()
240 uint dfl_forkoff = xfs_default_attroffset(ip) >> 3; in xfs_bmap_forkoff_reset()
242 if (dfl_forkoff > ip->i_d.di_forkoff) in xfs_bmap_forkoff_reset()
243 ip->i_d.di_forkoff = dfl_forkoff; in xfs_bmap_forkoff_reset()
334 xfs_inode_t *ip, /* incore inode pointer */ in xfs_bmap_check_leaf_extents() argument
351 if (XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_BTREE) { in xfs_bmap_check_leaf_extents()
356 mp = ip->i_mount; in xfs_bmap_check_leaf_extents()
357 ifp = XFS_IFORK_PTR(ip, whichfork); in xfs_bmap_check_leaf_extents()
496 xfs_inode_t *ip, /* incore inode pointer */ in xfs_bmap_trace_exlist() argument
508 ifp = XFS_IFORK_PTR(ip, whichfork); in xfs_bmap_trace_exlist()
511 trace_xfs_extlist(ip, idx, whichfork, caller_ip); in xfs_bmap_trace_exlist()
556 #define xfs_bmap_check_leaf_extents(cur, ip, whichfork) do { } while (0) argument
662 xfs_inode_t *ip, /* incore inode pointer */ in xfs_bmap_btree_to_extents() argument
677 mp = ip->i_mount; in xfs_bmap_btree_to_extents()
678 ifp = XFS_IFORK_PTR(ip, whichfork); in xfs_bmap_btree_to_extents()
680 ASSERT(XFS_IFORK_FORMAT(ip, whichfork) == XFS_DINODE_FMT_BTREE); in xfs_bmap_btree_to_extents()
700 ip->i_d.di_nblocks--; in xfs_bmap_btree_to_extents()
701 xfs_trans_mod_dquot_byino(tp, ip, XFS_TRANS_DQ_BCOUNT, -1L); in xfs_bmap_btree_to_extents()
705 xfs_iroot_realloc(ip, -1, whichfork); in xfs_bmap_btree_to_extents()
708 XFS_IFORK_FMT_SET(ip, whichfork, XFS_DINODE_FMT_EXTENTS); in xfs_bmap_btree_to_extents()
720 xfs_inode_t *ip, /* incore inode pointer */ in xfs_bmap_extents_to_btree() argument
743 mp = ip->i_mount; in xfs_bmap_extents_to_btree()
744 ifp = XFS_IFORK_PTR(ip, whichfork); in xfs_bmap_extents_to_btree()
745 ASSERT(XFS_IFORK_FORMAT(ip, whichfork) == XFS_DINODE_FMT_EXTENTS); in xfs_bmap_extents_to_btree()
750 xfs_iroot_realloc(ip, 1, whichfork); in xfs_bmap_extents_to_btree()
759 XFS_BMAP_CRC_MAGIC, 1, 1, ip->i_ino, in xfs_bmap_extents_to_btree()
763 XFS_BMAP_MAGIC, 1, 1, ip->i_ino, in xfs_bmap_extents_to_btree()
769 cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork); in xfs_bmap_extents_to_btree()
776 XFS_IFORK_FMT_SET(ip, whichfork, XFS_DINODE_FMT_BTREE); in xfs_bmap_extents_to_btree()
783 args.fsbno = XFS_INO_TO_FSB(mp, ip->i_ino); in xfs_bmap_extents_to_btree()
795 xfs_iroot_realloc(ip, -1, whichfork); in xfs_bmap_extents_to_btree()
809 ip->i_d.di_nblocks++; in xfs_bmap_extents_to_btree()
810 xfs_trans_mod_dquot_byino(tp, ip, XFS_TRANS_DQ_BCOUNT, 1L); in xfs_bmap_extents_to_btree()
819 XFS_BMAP_CRC_MAGIC, 0, 0, ip->i_ino, in xfs_bmap_extents_to_btree()
823 XFS_BMAP_MAGIC, 0, 0, ip->i_ino, in xfs_bmap_extents_to_btree()
836 ASSERT(cnt == XFS_IFORK_NEXTENTS(ip, whichfork)); in xfs_bmap_extents_to_btree()
869 struct xfs_inode *ip, in xfs_bmap_local_to_extents_empty() argument
872 struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, whichfork); in xfs_bmap_local_to_extents_empty()
874 ASSERT(XFS_IFORK_FORMAT(ip, whichfork) == XFS_DINODE_FMT_LOCAL); in xfs_bmap_local_to_extents_empty()
876 ASSERT(XFS_IFORK_NEXTENTS(ip, whichfork) == 0); in xfs_bmap_local_to_extents_empty()
878 xfs_bmap_forkoff_reset(ip, whichfork); in xfs_bmap_local_to_extents_empty()
881 XFS_IFORK_FMT_SET(ip, whichfork, XFS_DINODE_FMT_EXTENTS); in xfs_bmap_local_to_extents_empty()
888 xfs_inode_t *ip, /* incore inode pointer */ in xfs_bmap_local_to_extents() argument
895 struct xfs_inode *ip, in xfs_bmap_local_to_extents() argument
909 ASSERT(!(S_ISREG(ip->i_d.di_mode) && whichfork == XFS_DATA_FORK)); in xfs_bmap_local_to_extents()
910 ifp = XFS_IFORK_PTR(ip, whichfork); in xfs_bmap_local_to_extents()
911 ASSERT(XFS_IFORK_FORMAT(ip, whichfork) == XFS_DINODE_FMT_LOCAL); in xfs_bmap_local_to_extents()
914 xfs_bmap_local_to_extents_empty(ip, whichfork); in xfs_bmap_local_to_extents()
925 args.mp = ip->i_mount; in xfs_bmap_local_to_extents()
932 args.fsbno = XFS_INO_TO_FSB(args.mp, ip->i_ino); in xfs_bmap_local_to_extents()
955 init_fn(tp, bp, ip, ifp); in xfs_bmap_local_to_extents()
959 xfs_idata_realloc(ip, -ifp->if_bytes, whichfork); in xfs_bmap_local_to_extents()
960 xfs_bmap_local_to_extents_empty(ip, whichfork); in xfs_bmap_local_to_extents()
966 trace_xfs_bmap_post_update(ip, 0, in xfs_bmap_local_to_extents()
969 XFS_IFORK_NEXT_SET(ip, whichfork, 1); in xfs_bmap_local_to_extents()
970 ip->i_d.di_nblocks = 1; in xfs_bmap_local_to_extents()
971 xfs_trans_mod_dquot_byino(tp, ip, in xfs_bmap_local_to_extents()
986 xfs_inode_t *ip, /* incore inode pointer */ in xfs_bmap_add_attrfork_btree() argument
996 mp = ip->i_mount; in xfs_bmap_add_attrfork_btree()
997 if (ip->i_df.if_broot_bytes <= XFS_IFORK_DSIZE(ip)) in xfs_bmap_add_attrfork_btree()
1000 cur = xfs_bmbt_init_cursor(mp, tp, ip, XFS_DATA_FORK); in xfs_bmap_add_attrfork_btree()
1029 xfs_inode_t *ip, /* incore inode pointer */ in xfs_bmap_add_attrfork_extents() argument
1037 if (ip->i_d.di_nextents * sizeof(xfs_bmbt_rec_t) <= XFS_IFORK_DSIZE(ip)) in xfs_bmap_add_attrfork_extents()
1040 error = xfs_bmap_extents_to_btree(tp, ip, firstblock, flist, &cur, 0, in xfs_bmap_add_attrfork_extents()
1064 xfs_inode_t *ip, /* incore inode pointer */ in xfs_bmap_add_attrfork_local() argument
1071 if (ip->i_df.if_bytes <= XFS_IFORK_DSIZE(ip)) in xfs_bmap_add_attrfork_local()
1074 if (S_ISDIR(ip->i_d.di_mode)) { in xfs_bmap_add_attrfork_local()
1076 dargs.geo = ip->i_mount->m_dir_geo; in xfs_bmap_add_attrfork_local()
1077 dargs.dp = ip; in xfs_bmap_add_attrfork_local()
1086 if (S_ISLNK(ip->i_d.di_mode)) in xfs_bmap_add_attrfork_local()
1087 return xfs_bmap_local_to_extents(tp, ip, firstblock, 1, in xfs_bmap_add_attrfork_local()
1102 xfs_inode_t *ip, /* incore inode pointer */ in xfs_bmap_add_attrfork() argument
1117 ASSERT(XFS_IFORK_Q(ip) == 0); in xfs_bmap_add_attrfork()
1119 mp = ip->i_mount; in xfs_bmap_add_attrfork()
1120 ASSERT(!XFS_NOT_DQATTACHED(mp, ip)); in xfs_bmap_add_attrfork()
1131 xfs_ilock(ip, XFS_ILOCK_EXCL); in xfs_bmap_add_attrfork()
1132 error = xfs_trans_reserve_quota_nblks(tp, ip, blks, 0, rsvd ? in xfs_bmap_add_attrfork()
1138 if (XFS_IFORK_Q(ip)) in xfs_bmap_add_attrfork()
1140 if (ip->i_d.di_aformat != XFS_DINODE_FMT_EXTENTS) { in xfs_bmap_add_attrfork()
1144 ASSERT(ip->i_d.di_aformat == 0); in xfs_bmap_add_attrfork()
1145 ip->i_d.di_aformat = XFS_DINODE_FMT_EXTENTS; in xfs_bmap_add_attrfork()
1147 ASSERT(ip->i_d.di_anextents == 0); in xfs_bmap_add_attrfork()
1149 xfs_trans_ijoin(tp, ip, 0); in xfs_bmap_add_attrfork()
1150 xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); in xfs_bmap_add_attrfork()
1152 switch (ip->i_d.di_format) { in xfs_bmap_add_attrfork()
1154 ip->i_d.di_forkoff = roundup(sizeof(xfs_dev_t), 8) >> 3; in xfs_bmap_add_attrfork()
1157 ip->i_d.di_forkoff = roundup(sizeof(uuid_t), 8) >> 3; in xfs_bmap_add_attrfork()
1162 ip->i_d.di_forkoff = xfs_attr_shortform_bytesfit(ip, size); in xfs_bmap_add_attrfork()
1163 if (!ip->i_d.di_forkoff) in xfs_bmap_add_attrfork()
1164 ip->i_d.di_forkoff = xfs_default_attroffset(ip) >> 3; in xfs_bmap_add_attrfork()
1174 ASSERT(ip->i_afp == NULL); in xfs_bmap_add_attrfork()
1175 ip->i_afp = kmem_zone_zalloc(xfs_ifork_zone, KM_SLEEP); in xfs_bmap_add_attrfork()
1176 ip->i_afp->if_flags = XFS_IFEXTENTS; in xfs_bmap_add_attrfork()
1179 switch (ip->i_d.di_format) { in xfs_bmap_add_attrfork()
1181 error = xfs_bmap_add_attrfork_local(tp, ip, &firstblock, &flist, in xfs_bmap_add_attrfork()
1185 error = xfs_bmap_add_attrfork_extents(tp, ip, &firstblock, in xfs_bmap_add_attrfork()
1189 error = xfs_bmap_add_attrfork_btree(tp, ip, &firstblock, &flist, in xfs_bmap_add_attrfork()
1197 xfs_trans_log_inode(tp, ip, logflags); in xfs_bmap_add_attrfork()
1222 xfs_iunlock(ip, XFS_ILOCK_EXCL); in xfs_bmap_add_attrfork()
1229 xfs_iunlock(ip, XFS_ILOCK_EXCL); in xfs_bmap_add_attrfork()
1246 xfs_inode_t *ip, /* incore inode */ in xfs_bmap_read_extents() argument
1263 mp = ip->i_mount; in xfs_bmap_read_extents()
1264 ifp = XFS_IFORK_PTR(ip, whichfork); in xfs_bmap_read_extents()
1266 XFS_EXTFMT_INODE(ip); in xfs_bmap_read_extents()
1313 xfs_warn(ip->i_mount, in xfs_bmap_read_extents()
1315 (unsigned long long) ip->i_ino); in xfs_bmap_read_extents()
1317 XFS_ERRLEVEL_LOW, ip->i_mount, block); in xfs_bmap_read_extents()
1347 ip->i_mount); in xfs_bmap_read_extents()
1365 ASSERT(i == XFS_IFORK_NEXTENTS(ip, whichfork)); in xfs_bmap_read_extents()
1366 XFS_BMAP_TRACE_EXLIST(ip, i, whichfork); in xfs_bmap_read_extents()
1430 xfs_inode_t *ip, /* incore inode pointer */ in xfs_bmap_search_extents() argument
1442 ifp = XFS_IFORK_PTR(ip, fork); in xfs_bmap_search_extents()
1447 !(XFS_IS_REALTIME_INODE(ip) && fork == XFS_DATA_FORK))) { in xfs_bmap_search_extents()
1448 xfs_alert_tag(ip->i_mount, XFS_PTAG_FSBLOCK_ZERO, in xfs_bmap_search_extents()
1452 (unsigned long long)ip->i_ino, in xfs_bmap_search_extents()
1474 xfs_inode_t *ip, /* incore inode */ in xfs_bmap_first_unused() argument
1488 ASSERT(XFS_IFORK_FORMAT(ip, whichfork) == XFS_DINODE_FMT_BTREE || in xfs_bmap_first_unused()
1489 XFS_IFORK_FORMAT(ip, whichfork) == XFS_DINODE_FMT_EXTENTS || in xfs_bmap_first_unused()
1490 XFS_IFORK_FORMAT(ip, whichfork) == XFS_DINODE_FMT_LOCAL); in xfs_bmap_first_unused()
1491 if (XFS_IFORK_FORMAT(ip, whichfork) == XFS_DINODE_FMT_LOCAL) { in xfs_bmap_first_unused()
1495 ifp = XFS_IFORK_PTR(ip, whichfork); in xfs_bmap_first_unused()
1497 (error = xfs_iread_extents(tp, ip, whichfork))) in xfs_bmap_first_unused()
1527 xfs_inode_t *ip, /* incore inode */ in xfs_bmap_last_before() argument
1540 if (XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_BTREE && in xfs_bmap_last_before()
1541 XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_EXTENTS && in xfs_bmap_last_before()
1542 XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_LOCAL) in xfs_bmap_last_before()
1544 if (XFS_IFORK_FORMAT(ip, whichfork) == XFS_DINODE_FMT_LOCAL) { in xfs_bmap_last_before()
1548 ifp = XFS_IFORK_PTR(ip, whichfork); in xfs_bmap_last_before()
1550 (error = xfs_iread_extents(tp, ip, whichfork))) in xfs_bmap_last_before()
1553 ep = xfs_bmap_search_extents(ip, bno, whichfork, &eof, &lastx, &got, in xfs_bmap_last_before()
1570 struct xfs_inode *ip, in xfs_bmap_last_extent() argument
1575 struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, whichfork); in xfs_bmap_last_extent()
1580 error = xfs_iread_extents(tp, ip, whichfork); in xfs_bmap_last_extent()
1615 error = xfs_bmap_last_extent(NULL, bma->ip, whichfork, &rec, in xfs_bmap_isaeof()
1642 struct xfs_inode *ip, in xfs_bmap_last_offset() argument
1652 if (XFS_IFORK_FORMAT(ip, whichfork) == XFS_DINODE_FMT_LOCAL) in xfs_bmap_last_offset()
1655 if (XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_BTREE && in xfs_bmap_last_offset()
1656 XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_EXTENTS) in xfs_bmap_last_offset()
1659 error = xfs_bmap_last_extent(NULL, ip, whichfork, &rec, &is_empty); in xfs_bmap_last_offset()
1674 xfs_inode_t *ip, /* incore inode */ in xfs_bmap_one_block() argument
1684 return XFS_ISIZE(ip) == ip->i_mount->m_sb.sb_blocksize; in xfs_bmap_one_block()
1686 if (XFS_IFORK_NEXTENTS(ip, whichfork) != 1) in xfs_bmap_one_block()
1688 if (XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_EXTENTS) in xfs_bmap_one_block()
1690 ifp = XFS_IFORK_PTR(ip, whichfork); in xfs_bmap_one_block()
1696 ASSERT(XFS_ISIZE(ip) == ip->i_mount->m_sb.sb_blocksize); in xfs_bmap_one_block()
1730 ifp = XFS_IFORK_PTR(bma->ip, XFS_DATA_FORK); in xfs_bmap_add_extent_delay_real()
1789 if (bma->idx < bma->ip->i_df.if_bytes / (uint)sizeof(xfs_bmbt_rec_t) - 1) { in xfs_bmap_add_extent_delay_real()
1823 trace_xfs_bmap_pre_update(bma->ip, bma->idx, state, _THIS_IP_); in xfs_bmap_add_extent_delay_real()
1827 trace_xfs_bmap_post_update(bma->ip, bma->idx, state, _THIS_IP_); in xfs_bmap_add_extent_delay_real()
1829 xfs_iext_remove(bma->ip, bma->idx + 1, 2, state); in xfs_bmap_add_extent_delay_real()
1830 bma->ip->i_d.di_nextents--; in xfs_bmap_add_extent_delay_real()
1866 trace_xfs_bmap_pre_update(bma->ip, bma->idx, state, _THIS_IP_); in xfs_bmap_add_extent_delay_real()
1869 trace_xfs_bmap_post_update(bma->ip, bma->idx, state, _THIS_IP_); in xfs_bmap_add_extent_delay_real()
1871 xfs_iext_remove(bma->ip, bma->idx + 1, 1, state); in xfs_bmap_add_extent_delay_real()
1896 trace_xfs_bmap_pre_update(bma->ip, bma->idx, state, _THIS_IP_); in xfs_bmap_add_extent_delay_real()
1900 trace_xfs_bmap_post_update(bma->ip, bma->idx, state, _THIS_IP_); in xfs_bmap_add_extent_delay_real()
1902 xfs_iext_remove(bma->ip, bma->idx + 1, 1, state); in xfs_bmap_add_extent_delay_real()
1928 trace_xfs_bmap_pre_update(bma->ip, bma->idx, state, _THIS_IP_); in xfs_bmap_add_extent_delay_real()
1930 trace_xfs_bmap_post_update(bma->ip, bma->idx, state, _THIS_IP_); in xfs_bmap_add_extent_delay_real()
1932 bma->ip->i_d.di_nextents++; in xfs_bmap_add_extent_delay_real()
1956 trace_xfs_bmap_pre_update(bma->ip, bma->idx - 1, state, _THIS_IP_); in xfs_bmap_add_extent_delay_real()
1961 trace_xfs_bmap_post_update(bma->ip, bma->idx - 1, state, _THIS_IP_); in xfs_bmap_add_extent_delay_real()
1964 trace_xfs_bmap_pre_update(bma->ip, bma->idx, state, _THIS_IP_); in xfs_bmap_add_extent_delay_real()
1984 da_new = XFS_FILBLKS_MIN(xfs_bmap_worst_indlen(bma->ip, temp), in xfs_bmap_add_extent_delay_real()
1987 trace_xfs_bmap_post_update(bma->ip, bma->idx, state, _THIS_IP_); in xfs_bmap_add_extent_delay_real()
1997 trace_xfs_bmap_pre_update(bma->ip, bma->idx, state, _THIS_IP_); in xfs_bmap_add_extent_delay_real()
2001 xfs_iext_insert(bma->ip, bma->idx, 1, new, state); in xfs_bmap_add_extent_delay_real()
2002 bma->ip->i_d.di_nextents++; in xfs_bmap_add_extent_delay_real()
2020 if (xfs_bmap_needs_btree(bma->ip, XFS_DATA_FORK)) { in xfs_bmap_add_extent_delay_real()
2021 error = xfs_bmap_extents_to_btree(bma->tp, bma->ip, in xfs_bmap_add_extent_delay_real()
2028 da_new = XFS_FILBLKS_MIN(xfs_bmap_worst_indlen(bma->ip, temp), in xfs_bmap_add_extent_delay_real()
2033 trace_xfs_bmap_post_update(bma->ip, bma->idx + 1, state, _THIS_IP_); in xfs_bmap_add_extent_delay_real()
2042 trace_xfs_bmap_pre_update(bma->ip, bma->idx + 1, state, _THIS_IP_); in xfs_bmap_add_extent_delay_real()
2048 trace_xfs_bmap_post_update(bma->ip, bma->idx + 1, state, _THIS_IP_); in xfs_bmap_add_extent_delay_real()
2068 da_new = XFS_FILBLKS_MIN(xfs_bmap_worst_indlen(bma->ip, temp), in xfs_bmap_add_extent_delay_real()
2070 trace_xfs_bmap_pre_update(bma->ip, bma->idx, state, _THIS_IP_); in xfs_bmap_add_extent_delay_real()
2072 trace_xfs_bmap_post_update(bma->ip, bma->idx, state, _THIS_IP_); in xfs_bmap_add_extent_delay_real()
2083 trace_xfs_bmap_pre_update(bma->ip, bma->idx, state, _THIS_IP_); in xfs_bmap_add_extent_delay_real()
2085 xfs_iext_insert(bma->ip, bma->idx + 1, 1, new, state); in xfs_bmap_add_extent_delay_real()
2086 bma->ip->i_d.di_nextents++; in xfs_bmap_add_extent_delay_real()
2104 if (xfs_bmap_needs_btree(bma->ip, XFS_DATA_FORK)) { in xfs_bmap_add_extent_delay_real()
2105 error = xfs_bmap_extents_to_btree(bma->tp, bma->ip, in xfs_bmap_add_extent_delay_real()
2112 da_new = XFS_FILBLKS_MIN(xfs_bmap_worst_indlen(bma->ip, temp), in xfs_bmap_add_extent_delay_real()
2117 trace_xfs_bmap_post_update(bma->ip, bma->idx, state, _THIS_IP_); in xfs_bmap_add_extent_delay_real()
2145 trace_xfs_bmap_pre_update(bma->ip, bma->idx, 0, _THIS_IP_); in xfs_bmap_add_extent_delay_real()
2150 (int)xfs_bmap_worst_indlen(bma->ip, temp2)); in xfs_bmap_add_extent_delay_real()
2154 xfs_iext_insert(bma->ip, bma->idx + 1, 2, &LEFT, state); in xfs_bmap_add_extent_delay_real()
2155 bma->ip->i_d.di_nextents++; in xfs_bmap_add_extent_delay_real()
2173 if (xfs_bmap_needs_btree(bma->ip, XFS_DATA_FORK)) { in xfs_bmap_add_extent_delay_real()
2174 error = xfs_bmap_extents_to_btree(bma->tp, bma->ip, in xfs_bmap_add_extent_delay_real()
2181 temp = xfs_bmap_worst_indlen(bma->ip, temp); in xfs_bmap_add_extent_delay_real()
2182 temp2 = xfs_bmap_worst_indlen(bma->ip, temp2); in xfs_bmap_add_extent_delay_real()
2186 error = xfs_mod_fdblocks(bma->ip->i_mount, in xfs_bmap_add_extent_delay_real()
2195 trace_xfs_bmap_post_update(bma->ip, bma->idx, state, _THIS_IP_); in xfs_bmap_add_extent_delay_real()
2196 trace_xfs_bmap_pre_update(bma->ip, bma->idx + 2, state, _THIS_IP_); in xfs_bmap_add_extent_delay_real()
2199 trace_xfs_bmap_post_update(bma->ip, bma->idx + 2, state, _THIS_IP_); in xfs_bmap_add_extent_delay_real()
2219 if (xfs_bmap_needs_btree(bma->ip, XFS_DATA_FORK)) { in xfs_bmap_add_extent_delay_real()
2223 error = xfs_bmap_extents_to_btree(bma->tp, bma->ip, in xfs_bmap_add_extent_delay_real()
2238 xfs_mod_fdblocks(bma->ip->i_mount, in xfs_bmap_add_extent_delay_real()
2246 xfs_bmap_check_leaf_extents(bma->cur, bma->ip, XFS_DATA_FORK); in xfs_bmap_add_extent_delay_real()
2261 xfs_inode_t *ip, /* incore inode pointer */ in xfs_bmap_add_extent_unwritten_real() argument
2286 ifp = XFS_IFORK_PTR(ip, XFS_DATA_FORK); in xfs_bmap_add_extent_unwritten_real()
2345 if (*idx < ip->i_df.if_bytes / (uint)sizeof(xfs_bmbt_rec_t) - 1) { in xfs_bmap_add_extent_unwritten_real()
2378 trace_xfs_bmap_pre_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_add_extent_unwritten_real()
2382 trace_xfs_bmap_post_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_add_extent_unwritten_real()
2384 xfs_iext_remove(ip, *idx + 1, 2, state); in xfs_bmap_add_extent_unwritten_real()
2385 ip->i_d.di_nextents -= 2; in xfs_bmap_add_extent_unwritten_real()
2422 trace_xfs_bmap_pre_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_add_extent_unwritten_real()
2425 trace_xfs_bmap_post_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_add_extent_unwritten_real()
2427 xfs_iext_remove(ip, *idx + 1, 1, state); in xfs_bmap_add_extent_unwritten_real()
2428 ip->i_d.di_nextents--; in xfs_bmap_add_extent_unwritten_real()
2457 trace_xfs_bmap_pre_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_add_extent_unwritten_real()
2461 trace_xfs_bmap_post_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_add_extent_unwritten_real()
2462 xfs_iext_remove(ip, *idx + 1, 1, state); in xfs_bmap_add_extent_unwritten_real()
2463 ip->i_d.di_nextents--; in xfs_bmap_add_extent_unwritten_real()
2493 trace_xfs_bmap_pre_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_add_extent_unwritten_real()
2495 trace_xfs_bmap_post_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_add_extent_unwritten_real()
2518 trace_xfs_bmap_pre_update(ip, *idx - 1, state, _THIS_IP_); in xfs_bmap_add_extent_unwritten_real()
2523 trace_xfs_bmap_post_update(ip, *idx - 1, state, _THIS_IP_); in xfs_bmap_add_extent_unwritten_real()
2525 trace_xfs_bmap_pre_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_add_extent_unwritten_real()
2530 trace_xfs_bmap_post_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_add_extent_unwritten_real()
2565 trace_xfs_bmap_pre_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_add_extent_unwritten_real()
2572 trace_xfs_bmap_post_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_add_extent_unwritten_real()
2574 xfs_iext_insert(ip, *idx, 1, new, state); in xfs_bmap_add_extent_unwritten_real()
2575 ip->i_d.di_nextents++; in xfs_bmap_add_extent_unwritten_real()
2603 trace_xfs_bmap_pre_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_add_extent_unwritten_real()
2606 trace_xfs_bmap_post_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_add_extent_unwritten_real()
2610 trace_xfs_bmap_pre_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_add_extent_unwritten_real()
2614 trace_xfs_bmap_post_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_add_extent_unwritten_real()
2645 trace_xfs_bmap_pre_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_add_extent_unwritten_real()
2648 trace_xfs_bmap_post_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_add_extent_unwritten_real()
2651 xfs_iext_insert(ip, *idx, 1, new, state); in xfs_bmap_add_extent_unwritten_real()
2653 ip->i_d.di_nextents++; in xfs_bmap_add_extent_unwritten_real()
2686 trace_xfs_bmap_pre_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_add_extent_unwritten_real()
2689 trace_xfs_bmap_post_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_add_extent_unwritten_real()
2699 xfs_iext_insert(ip, *idx, 2, &r[0], state); in xfs_bmap_add_extent_unwritten_real()
2701 ip->i_d.di_nextents += 2; in xfs_bmap_add_extent_unwritten_real()
2755 if (xfs_bmap_needs_btree(ip, XFS_DATA_FORK)) { in xfs_bmap_add_extent_unwritten_real()
2759 error = xfs_bmap_extents_to_btree(tp, ip, first, flist, &cur, in xfs_bmap_add_extent_unwritten_real()
2772 xfs_bmap_check_leaf_extents(*curp, ip, XFS_DATA_FORK); in xfs_bmap_add_extent_unwritten_real()
2786 xfs_inode_t *ip, /* incore inode pointer */ in xfs_bmap_add_extent_hole_delay() argument
2798 ifp = XFS_IFORK_PTR(ip, XFS_DATA_FORK); in xfs_bmap_add_extent_hole_delay()
2817 if (*idx < ip->i_df.if_bytes / (uint)sizeof(xfs_bmbt_rec_t)) { in xfs_bmap_add_extent_hole_delay()
2856 trace_xfs_bmap_pre_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_add_extent_hole_delay()
2861 newlen = xfs_bmap_worst_indlen(ip, temp); in xfs_bmap_add_extent_hole_delay()
2864 trace_xfs_bmap_post_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_add_extent_hole_delay()
2866 xfs_iext_remove(ip, *idx + 1, 1, state); in xfs_bmap_add_extent_hole_delay()
2878 trace_xfs_bmap_pre_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_add_extent_hole_delay()
2882 newlen = xfs_bmap_worst_indlen(ip, temp); in xfs_bmap_add_extent_hole_delay()
2885 trace_xfs_bmap_post_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_add_extent_hole_delay()
2894 trace_xfs_bmap_pre_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_add_extent_hole_delay()
2898 newlen = xfs_bmap_worst_indlen(ip, temp); in xfs_bmap_add_extent_hole_delay()
2902 trace_xfs_bmap_post_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_add_extent_hole_delay()
2912 xfs_iext_insert(ip, *idx, 1, new, state); in xfs_bmap_add_extent_hole_delay()
2917 xfs_mod_fdblocks(ip->i_mount, (int64_t)(oldlen - newlen), in xfs_bmap_add_extent_hole_delay()
2944 ifp = XFS_IFORK_PTR(bma->ip, whichfork); in xfs_bmap_add_extent_hole_real()
3012 trace_xfs_bmap_pre_update(bma->ip, bma->idx, state, _THIS_IP_); in xfs_bmap_add_extent_hole_real()
3016 trace_xfs_bmap_post_update(bma->ip, bma->idx, state, _THIS_IP_); in xfs_bmap_add_extent_hole_real()
3018 xfs_iext_remove(bma->ip, bma->idx + 1, 1, state); in xfs_bmap_add_extent_hole_real()
3020 XFS_IFORK_NEXT_SET(bma->ip, whichfork, in xfs_bmap_add_extent_hole_real()
3021 XFS_IFORK_NEXTENTS(bma->ip, whichfork) - 1); in xfs_bmap_add_extent_hole_real()
3058 trace_xfs_bmap_pre_update(bma->ip, bma->idx, state, _THIS_IP_); in xfs_bmap_add_extent_hole_real()
3061 trace_xfs_bmap_post_update(bma->ip, bma->idx, state, _THIS_IP_); in xfs_bmap_add_extent_hole_real()
3089 trace_xfs_bmap_pre_update(bma->ip, bma->idx, state, _THIS_IP_); in xfs_bmap_add_extent_hole_real()
3094 trace_xfs_bmap_post_update(bma->ip, bma->idx, state, _THIS_IP_); in xfs_bmap_add_extent_hole_real()
3123 xfs_iext_insert(bma->ip, bma->idx, 1, new, state); in xfs_bmap_add_extent_hole_real()
3124 XFS_IFORK_NEXT_SET(bma->ip, whichfork, in xfs_bmap_add_extent_hole_real()
3125 XFS_IFORK_NEXTENTS(bma->ip, whichfork) + 1); in xfs_bmap_add_extent_hole_real()
3147 if (xfs_bmap_needs_btree(bma->ip, whichfork)) { in xfs_bmap_add_extent_hole_real()
3151 error = xfs_bmap_extents_to_btree(bma->tp, bma->ip, in xfs_bmap_add_extent_hole_real()
3163 xfs_bmap_check_leaf_extents(bma->cur, bma->ip, whichfork); in xfs_bmap_add_extent_hole_real()
3369 mp = ap->ip->i_mount; in xfs_bmap_adjacent()
3371 rt = XFS_IS_REALTIME_INODE(ap->ip) && ap->userdata; in xfs_bmap_adjacent()
3567 struct xfs_mount *mp = ap->ip->i_mount; in xfs_bmap_btalloc_nullfb()
3601 struct xfs_mount *mp = ap->ip->i_mount; in xfs_bmap_btalloc_filestreams()
3659 mp = ap->ip->i_mount; in xfs_bmap_btalloc()
3668 align = ap->userdata ? xfs_get_extsz_hint(ap->ip) : 0; in xfs_bmap_btalloc()
3681 if (ap->userdata && xfs_inode_is_filestream(ap->ip)) { in xfs_bmap_btalloc()
3682 ag = xfs_filestream_lookup_ag(ap->ip); in xfs_bmap_btalloc()
3686 ap->blkno = XFS_INO_TO_FSB(mp, ap->ip->i_ino); in xfs_bmap_btalloc()
3720 if (ap->userdata && xfs_inode_is_filestream(ap->ip)) in xfs_bmap_btalloc()
3727 if (xfs_inode_is_filestream(ap->ip)) in xfs_bmap_btalloc()
3867 ap->ip->i_d.di_nblocks += args.len; in xfs_bmap_btalloc()
3868 xfs_trans_log_inode(ap->tp, ap->ip, XFS_ILOG_CORE); in xfs_bmap_btalloc()
3870 ap->ip->i_delayed_blks -= args.len; in xfs_bmap_btalloc()
3875 xfs_trans_mod_dquot_byino(ap->tp, ap->ip, in xfs_bmap_btalloc()
3894 if (XFS_IS_REALTIME_INODE(ap->ip) && ap->userdata) in xfs_bmap_alloc()
4005 struct xfs_inode *ip, in xfs_bmapi_read() argument
4012 struct xfs_mount *mp = ip->i_mount; in xfs_bmapi_read()
4028 ASSERT(xfs_isilocked(ip, XFS_ILOCK_SHARED|XFS_ILOCK_EXCL)); in xfs_bmapi_read()
4031 (XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_EXTENTS && in xfs_bmapi_read()
4032 XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_BTREE), in xfs_bmapi_read()
4043 ifp = XFS_IFORK_PTR(ip, whichfork); in xfs_bmapi_read()
4046 error = xfs_iread_extents(NULL, ip, whichfork); in xfs_bmapi_read()
4051 xfs_bmap_search_extents(ip, bno, whichfork, &eof, &lastx, &got, &prev); in xfs_bmapi_read()
4093 struct xfs_inode *ip, in xfs_bmapi_reserve_delalloc() argument
4101 struct xfs_mount *mp = ip->i_mount; in xfs_bmapi_reserve_delalloc()
4102 struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, XFS_DATA_FORK); in xfs_bmapi_reserve_delalloc()
4105 char rt = XFS_IS_REALTIME_INODE(ip); in xfs_bmapi_reserve_delalloc()
4114 extsz = xfs_get_extsz_hint(ip); in xfs_bmapi_reserve_delalloc()
4129 error = xfs_trans_reserve_quota_nblks(NULL, ip, (long)alen, 0, in xfs_bmapi_reserve_delalloc()
4138 indlen = (xfs_extlen_t)xfs_bmap_worst_indlen(ip, alen); in xfs_bmapi_reserve_delalloc()
4155 ip->i_delayed_blks += alen; in xfs_bmapi_reserve_delalloc()
4161 xfs_bmap_add_extent_hole_delay(ip, lastx, got); in xfs_bmapi_reserve_delalloc()
4182 xfs_trans_unreserve_quota_nblks(NULL, ip, (long)alen, 0, rt ? in xfs_bmapi_reserve_delalloc()
4192 struct xfs_inode *ip, /* incore inode */ in xfs_bmapi_delay() argument
4199 struct xfs_mount *mp = ip->i_mount; in xfs_bmapi_delay()
4200 struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, XFS_DATA_FORK); in xfs_bmapi_delay()
4213 ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); in xfs_bmapi_delay()
4216 (XFS_IFORK_FORMAT(ip, XFS_DATA_FORK) != XFS_DINODE_FMT_EXTENTS && in xfs_bmapi_delay()
4217 XFS_IFORK_FORMAT(ip, XFS_DATA_FORK) != XFS_DINODE_FMT_BTREE), in xfs_bmapi_delay()
4229 error = xfs_iread_extents(NULL, ip, XFS_DATA_FORK); in xfs_bmapi_delay()
4234 xfs_bmap_search_extents(ip, bno, XFS_DATA_FORK, &eof, &lastx, &got, &prev); in xfs_bmapi_delay()
4240 error = xfs_bmapi_reserve_delalloc(ip, bno, len, &got, in xfs_bmapi_delay()
4276 struct xfs_mount *mp = bma->ip->i_mount; in xfs_bmapi_allocate()
4279 struct xfs_ifork *ifp = XFS_IFORK_PTR(bma->ip, whichfork); in xfs_bmapi_allocate()
4336 bma->cur = xfs_bmbt_init_cursor(mp, bma->tp, bma->ip, whichfork); in xfs_bmapi_allocate()
4396 struct xfs_ifork *ifp = XFS_IFORK_PTR(bma->ip, whichfork); in xfs_bmapi_convert_unwritten()
4416 bma->cur = xfs_bmbt_init_cursor(bma->ip->i_mount, bma->tp, in xfs_bmapi_convert_unwritten()
4417 bma->ip, whichfork); in xfs_bmapi_convert_unwritten()
4424 error = xfs_bmap_add_extent_unwritten_real(bma->tp, bma->ip, &bma->idx, in xfs_bmapi_convert_unwritten()
4462 struct xfs_inode *ip, /* incore inode */ in xfs_bmapi_write() argument
4473 struct xfs_mount *mp = ip->i_mount; in xfs_bmapi_write()
4506 ASSERT(XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_LOCAL); in xfs_bmapi_write()
4507 ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); in xfs_bmapi_write()
4510 (XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_EXTENTS && in xfs_bmapi_write()
4511 XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_BTREE), in xfs_bmapi_write()
4520 ifp = XFS_IFORK_PTR(ip, whichfork); in xfs_bmapi_write()
4525 if (XFS_IFORK_FORMAT(ip, whichfork) == XFS_DINODE_FMT_BTREE) in xfs_bmapi_write()
4534 error = xfs_iread_extents(tp, ip, whichfork); in xfs_bmapi_write()
4539 xfs_bmap_search_extents(ip, bno, whichfork, &eof, &bma.idx, &bma.got, in xfs_bmapi_write()
4546 bma.ip = ip; in xfs_bmapi_write()
4623 if (xfs_bmap_wants_extents(ip, whichfork)) { in xfs_bmapi_write()
4627 error = xfs_bmap_btree_to_extents(tp, ip, bma.cur, in xfs_bmapi_write()
4634 ASSERT(XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_BTREE || in xfs_bmapi_write()
4635 XFS_IFORK_NEXTENTS(ip, whichfork) > in xfs_bmapi_write()
4636 XFS_IFORK_MAXEXT(ip, whichfork)); in xfs_bmapi_write()
4644 XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_EXTENTS) in xfs_bmapi_write()
4647 XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_BTREE) in xfs_bmapi_write()
4655 xfs_trans_log_inode(tp, ip, bma.logflags); in xfs_bmapi_write()
4684 xfs_inode_t *ip, /* incore inode pointer */ in xfs_bmap_del_extent() argument
4720 mp = ip->i_mount; in xfs_bmap_del_extent()
4721 ifp = XFS_IFORK_PTR(ip, whichfork); in xfs_bmap_del_extent()
4744 if (whichfork == XFS_DATA_FORK && XFS_IS_REALTIME_INODE(ip)) { in xfs_bmap_del_extent()
4799 xfs_iext_remove(ip, *idx, 1, in xfs_bmap_del_extent()
4805 XFS_IFORK_NEXT_SET(ip, whichfork, in xfs_bmap_del_extent()
4806 XFS_IFORK_NEXTENTS(ip, whichfork) - 1); in xfs_bmap_del_extent()
4821 trace_xfs_bmap_pre_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_del_extent()
4826 temp = XFS_FILBLKS_MIN(xfs_bmap_worst_indlen(ip, temp), in xfs_bmap_del_extent()
4829 trace_xfs_bmap_post_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_del_extent()
4834 trace_xfs_bmap_post_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_del_extent()
4850 trace_xfs_bmap_pre_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_del_extent()
4853 temp = XFS_FILBLKS_MIN(xfs_bmap_worst_indlen(ip, temp), in xfs_bmap_del_extent()
4856 trace_xfs_bmap_post_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_del_extent()
4860 trace_xfs_bmap_post_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_del_extent()
4877 trace_xfs_bmap_pre_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_del_extent()
4939 XFS_IFORK_NEXT_SET(ip, whichfork, in xfs_bmap_del_extent()
4940 XFS_IFORK_NEXTENTS(ip, whichfork) + 1); in xfs_bmap_del_extent()
4943 temp = xfs_bmap_worst_indlen(ip, temp); in xfs_bmap_del_extent()
4945 temp2 = xfs_bmap_worst_indlen(ip, temp2); in xfs_bmap_del_extent()
4965 trace_xfs_bmap_post_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_del_extent()
4966 xfs_iext_insert(ip, *idx + 1, 1, &new, state); in xfs_bmap_del_extent()
4980 ip->i_d.di_nblocks -= nblks; in xfs_bmap_del_extent()
4985 xfs_trans_mod_dquot_byino(tp, ip, qfield, (long)-nblks); in xfs_bmap_del_extent()
5008 struct xfs_inode *ip, /* incore inode */ in xfs_bunmapi() argument
5039 trace_xfs_bunmap(ip, bno, len, flags, _RET_IP_); in xfs_bunmapi()
5043 ifp = XFS_IFORK_PTR(ip, whichfork); in xfs_bunmapi()
5045 XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_EXTENTS && in xfs_bunmapi()
5046 XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_BTREE)) { in xfs_bunmapi()
5048 ip->i_mount); in xfs_bunmapi()
5051 mp = ip->i_mount; in xfs_bunmapi()
5055 ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); in xfs_bunmapi()
5060 (error = xfs_iread_extents(tp, ip, whichfork))) in xfs_bunmapi()
5068 isrt = (whichfork == XFS_DATA_FORK) && XFS_IS_REALTIME_INODE(ip); in xfs_bunmapi()
5071 ep = xfs_bmap_search_extents(ip, bno, whichfork, &eof, &lastx, &got, in xfs_bunmapi()
5085 ASSERT(XFS_IFORK_FORMAT(ip, whichfork) == XFS_DINODE_FMT_BTREE); in xfs_bunmapi()
5086 cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork); in xfs_bunmapi()
5179 error = xfs_bmap_add_extent_unwritten_real(tp, ip, in xfs_bunmapi()
5238 ip, &lastx, &cur, &prev, in xfs_bunmapi()
5247 ip, &lastx, &cur, &del, in xfs_bunmapi()
5264 ip, -((long)del.br_blockcount), 0, in xfs_bunmapi()
5270 ip, -((long)del.br_blockcount), 0, in xfs_bunmapi()
5273 ip->i_delayed_blks -= del.br_blockcount; in xfs_bunmapi()
5291 XFS_IFORK_FORMAT(ip, whichfork) == XFS_DINODE_FMT_EXTENTS && in xfs_bunmapi()
5292 XFS_IFORK_NEXTENTS(ip, whichfork) >= /* Note the >= */ in xfs_bunmapi()
5293 XFS_IFORK_MAXEXT(ip, whichfork) && in xfs_bunmapi()
5300 error = xfs_bmap_del_extent(ip, tp, &lastx, flist, cur, &del, in xfs_bunmapi()
5328 if (xfs_bmap_needs_btree(ip, whichfork)) { in xfs_bunmapi()
5330 error = xfs_bmap_extents_to_btree(tp, ip, firstblock, flist, in xfs_bunmapi()
5339 else if (xfs_bmap_wants_extents(ip, whichfork)) { in xfs_bunmapi()
5341 error = xfs_bmap_btree_to_extents(tp, ip, cur, &tmp_logflags, in xfs_bunmapi()
5357 XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_EXTENTS) in xfs_bunmapi()
5360 XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_BTREE) in xfs_bunmapi()
5367 xfs_trans_log_inode(tp, ip, logflags); in xfs_bunmapi()
5417 struct xfs_inode *ip, in xfs_bmse_merge() argument
5430 struct xfs_mount *mp = ip->i_mount; in xfs_bmse_merge()
5436 ASSERT(xfs_isilocked(ip, XFS_IOLOCK_EXCL)); in xfs_bmse_merge()
5437 ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); in xfs_bmse_merge()
5446 xfs_iext_remove(ip, current_ext, 1, 0); in xfs_bmse_merge()
5452 XFS_IFORK_NEXT_SET(ip, whichfork, in xfs_bmse_merge()
5453 XFS_IFORK_NEXTENTS(ip, whichfork) - 1); in xfs_bmse_merge()
5490 struct xfs_inode *ip, in xfs_bmse_shift_one() argument
5509 mp = ip->i_mount; in xfs_bmse_shift_one()
5510 ifp = XFS_IFORK_PTR(ip, whichfork); in xfs_bmse_shift_one()
5545 return xfs_bmse_merge(ip, whichfork, offset_shift_fsb, in xfs_bmse_shift_one()
5613 struct xfs_inode *ip, in xfs_bmap_shift_extents() argument
5626 struct xfs_mount *mp = ip->i_mount; in xfs_bmap_shift_extents()
5637 (XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_EXTENTS && in xfs_bmap_shift_extents()
5638 XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_BTREE), in xfs_bmap_shift_extents()
5648 ASSERT(xfs_isilocked(ip, XFS_IOLOCK_EXCL)); in xfs_bmap_shift_extents()
5649 ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); in xfs_bmap_shift_extents()
5653 ifp = XFS_IFORK_PTR(ip, whichfork); in xfs_bmap_shift_extents()
5656 error = xfs_iread_extents(tp, ip, whichfork); in xfs_bmap_shift_extents()
5662 cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork); in xfs_bmap_shift_extents()
5723 error = xfs_bmse_shift_one(ip, whichfork, offset_shift_fsb, in xfs_bmap_shift_extents()
5756 xfs_trans_log_inode(tp, ip, logflags); in xfs_bmap_shift_extents()
5770 struct xfs_inode *ip, in xfs_bmap_split_extent_at() argument
5780 struct xfs_mount *mp = ip->i_mount; in xfs_bmap_split_extent_at()
5789 (XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_EXTENTS && in xfs_bmap_split_extent_at()
5790 XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_BTREE), in xfs_bmap_split_extent_at()
5800 ifp = XFS_IFORK_PTR(ip, whichfork); in xfs_bmap_split_extent_at()
5803 error = xfs_iread_extents(tp, ip, whichfork); in xfs_bmap_split_extent_at()
5833 cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork); in xfs_bmap_split_extent_at()
5862 xfs_iext_insert(ip, current_ext, 1, &new, 0); in xfs_bmap_split_extent_at()
5863 XFS_IFORK_NEXT_SET(ip, whichfork, in xfs_bmap_split_extent_at()
5864 XFS_IFORK_NEXTENTS(ip, whichfork) + 1); in xfs_bmap_split_extent_at()
5884 if (xfs_bmap_needs_btree(ip, whichfork)) { in xfs_bmap_split_extent_at()
5888 error = xfs_bmap_extents_to_btree(tp, ip, firstfsb, free_list, in xfs_bmap_split_extent_at()
5901 xfs_trans_log_inode(tp, ip, logflags); in xfs_bmap_split_extent_at()
5907 struct xfs_inode *ip, in xfs_bmap_split_extent() argument
5910 struct xfs_mount *mp = ip->i_mount; in xfs_bmap_split_extent()
5925 xfs_ilock(ip, XFS_ILOCK_EXCL); in xfs_bmap_split_extent()
5926 xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL); in xfs_bmap_split_extent()
5930 error = xfs_bmap_split_extent_at(tp, ip, split_fsb, in xfs_bmap_split_extent()