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()
958 init_fn(tp, bp, ip, ifp); in xfs_bmap_local_to_extents()
961 xfs_idata_realloc(ip, -ifp->if_bytes, whichfork); in xfs_bmap_local_to_extents()
962 xfs_bmap_local_to_extents_empty(ip, whichfork); in xfs_bmap_local_to_extents()
968 trace_xfs_bmap_post_update(ip, 0, in xfs_bmap_local_to_extents()
971 XFS_IFORK_NEXT_SET(ip, whichfork, 1); in xfs_bmap_local_to_extents()
972 ip->i_d.di_nblocks = 1; in xfs_bmap_local_to_extents()
973 xfs_trans_mod_dquot_byino(tp, ip, in xfs_bmap_local_to_extents()
988 xfs_inode_t *ip, /* incore inode pointer */ in xfs_bmap_add_attrfork_btree() argument
998 mp = ip->i_mount; in xfs_bmap_add_attrfork_btree()
999 if (ip->i_df.if_broot_bytes <= XFS_IFORK_DSIZE(ip)) in xfs_bmap_add_attrfork_btree()
1002 cur = xfs_bmbt_init_cursor(mp, tp, ip, XFS_DATA_FORK); in xfs_bmap_add_attrfork_btree()
1031 xfs_inode_t *ip, /* incore inode pointer */ in xfs_bmap_add_attrfork_extents() argument
1039 if (ip->i_d.di_nextents * sizeof(xfs_bmbt_rec_t) <= XFS_IFORK_DSIZE(ip)) in xfs_bmap_add_attrfork_extents()
1042 error = xfs_bmap_extents_to_btree(tp, ip, firstblock, flist, &cur, 0, in xfs_bmap_add_attrfork_extents()
1066 xfs_inode_t *ip, /* incore inode pointer */ in xfs_bmap_add_attrfork_local() argument
1073 if (ip->i_df.if_bytes <= XFS_IFORK_DSIZE(ip)) in xfs_bmap_add_attrfork_local()
1076 if (S_ISDIR(ip->i_d.di_mode)) { in xfs_bmap_add_attrfork_local()
1078 dargs.geo = ip->i_mount->m_dir_geo; in xfs_bmap_add_attrfork_local()
1079 dargs.dp = ip; in xfs_bmap_add_attrfork_local()
1088 if (S_ISLNK(ip->i_d.di_mode)) in xfs_bmap_add_attrfork_local()
1089 return xfs_bmap_local_to_extents(tp, ip, firstblock, 1, in xfs_bmap_add_attrfork_local()
1104 xfs_inode_t *ip, /* incore inode pointer */ in xfs_bmap_add_attrfork() argument
1118 ASSERT(XFS_IFORK_Q(ip) == 0); in xfs_bmap_add_attrfork()
1120 mp = ip->i_mount; in xfs_bmap_add_attrfork()
1121 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()
1137 if (XFS_IFORK_Q(ip)) in xfs_bmap_add_attrfork()
1139 if (ip->i_d.di_aformat != XFS_DINODE_FMT_EXTENTS) { in xfs_bmap_add_attrfork()
1143 ASSERT(ip->i_d.di_aformat == 0); in xfs_bmap_add_attrfork()
1144 ip->i_d.di_aformat = XFS_DINODE_FMT_EXTENTS; in xfs_bmap_add_attrfork()
1146 ASSERT(ip->i_d.di_anextents == 0); in xfs_bmap_add_attrfork()
1148 xfs_trans_ijoin(tp, ip, 0); in xfs_bmap_add_attrfork()
1149 xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); in xfs_bmap_add_attrfork()
1151 switch (ip->i_d.di_format) { in xfs_bmap_add_attrfork()
1153 ip->i_d.di_forkoff = roundup(sizeof(xfs_dev_t), 8) >> 3; in xfs_bmap_add_attrfork()
1156 ip->i_d.di_forkoff = roundup(sizeof(uuid_t), 8) >> 3; in xfs_bmap_add_attrfork()
1161 ip->i_d.di_forkoff = xfs_attr_shortform_bytesfit(ip, size); in xfs_bmap_add_attrfork()
1162 if (!ip->i_d.di_forkoff) in xfs_bmap_add_attrfork()
1163 ip->i_d.di_forkoff = xfs_default_attroffset(ip) >> 3; in xfs_bmap_add_attrfork()
1173 ASSERT(ip->i_afp == NULL); in xfs_bmap_add_attrfork()
1174 ip->i_afp = kmem_zone_zalloc(xfs_ifork_zone, KM_SLEEP); in xfs_bmap_add_attrfork()
1175 ip->i_afp->if_flags = XFS_IFEXTENTS; in xfs_bmap_add_attrfork()
1178 switch (ip->i_d.di_format) { in xfs_bmap_add_attrfork()
1180 error = xfs_bmap_add_attrfork_local(tp, ip, &firstblock, &flist, in xfs_bmap_add_attrfork()
1184 error = xfs_bmap_add_attrfork_extents(tp, ip, &firstblock, in xfs_bmap_add_attrfork()
1188 error = xfs_bmap_add_attrfork_btree(tp, ip, &firstblock, &flist, in xfs_bmap_add_attrfork()
1196 xfs_trans_log_inode(tp, ip, logflags); in xfs_bmap_add_attrfork()
1221 xfs_iunlock(ip, XFS_ILOCK_EXCL); in xfs_bmap_add_attrfork()
1228 xfs_iunlock(ip, XFS_ILOCK_EXCL); in xfs_bmap_add_attrfork()
1245 xfs_inode_t *ip, /* incore inode */ in xfs_bmap_read_extents() argument
1262 mp = ip->i_mount; in xfs_bmap_read_extents()
1263 ifp = XFS_IFORK_PTR(ip, whichfork); in xfs_bmap_read_extents()
1265 XFS_EXTFMT_INODE(ip); in xfs_bmap_read_extents()
1312 xfs_warn(ip->i_mount, in xfs_bmap_read_extents()
1314 (unsigned long long) ip->i_ino); in xfs_bmap_read_extents()
1316 XFS_ERRLEVEL_LOW, ip->i_mount, block); in xfs_bmap_read_extents()
1346 ip->i_mount); in xfs_bmap_read_extents()
1364 ASSERT(i == XFS_IFORK_NEXTENTS(ip, whichfork)); in xfs_bmap_read_extents()
1365 XFS_BMAP_TRACE_EXLIST(ip, i, whichfork); in xfs_bmap_read_extents()
1429 xfs_inode_t *ip, /* incore inode pointer */ in xfs_bmap_search_extents() argument
1440 XFS_STATS_INC(ip->i_mount, xs_look_exlist); in xfs_bmap_search_extents()
1441 ifp = XFS_IFORK_PTR(ip, fork); in xfs_bmap_search_extents()
1446 !(XFS_IS_REALTIME_INODE(ip) && fork == XFS_DATA_FORK))) { in xfs_bmap_search_extents()
1447 xfs_alert_tag(ip->i_mount, XFS_PTAG_FSBLOCK_ZERO, in xfs_bmap_search_extents()
1451 (unsigned long long)ip->i_ino, in xfs_bmap_search_extents()
1473 xfs_inode_t *ip, /* incore inode */ in xfs_bmap_first_unused() argument
1487 ASSERT(XFS_IFORK_FORMAT(ip, whichfork) == XFS_DINODE_FMT_BTREE || in xfs_bmap_first_unused()
1488 XFS_IFORK_FORMAT(ip, whichfork) == XFS_DINODE_FMT_EXTENTS || in xfs_bmap_first_unused()
1489 XFS_IFORK_FORMAT(ip, whichfork) == XFS_DINODE_FMT_LOCAL); in xfs_bmap_first_unused()
1490 if (XFS_IFORK_FORMAT(ip, whichfork) == XFS_DINODE_FMT_LOCAL) { in xfs_bmap_first_unused()
1494 ifp = XFS_IFORK_PTR(ip, whichfork); in xfs_bmap_first_unused()
1496 (error = xfs_iread_extents(tp, ip, whichfork))) in xfs_bmap_first_unused()
1526 xfs_inode_t *ip, /* incore inode */ in xfs_bmap_last_before() argument
1539 if (XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_BTREE && in xfs_bmap_last_before()
1540 XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_EXTENTS && in xfs_bmap_last_before()
1541 XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_LOCAL) in xfs_bmap_last_before()
1543 if (XFS_IFORK_FORMAT(ip, whichfork) == XFS_DINODE_FMT_LOCAL) { in xfs_bmap_last_before()
1547 ifp = XFS_IFORK_PTR(ip, whichfork); in xfs_bmap_last_before()
1549 (error = xfs_iread_extents(tp, ip, whichfork))) in xfs_bmap_last_before()
1552 ep = xfs_bmap_search_extents(ip, bno, whichfork, &eof, &lastx, &got, in xfs_bmap_last_before()
1569 struct xfs_inode *ip, in xfs_bmap_last_extent() argument
1574 struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, whichfork); in xfs_bmap_last_extent()
1579 error = xfs_iread_extents(tp, ip, whichfork); in xfs_bmap_last_extent()
1614 error = xfs_bmap_last_extent(NULL, bma->ip, whichfork, &rec, in xfs_bmap_isaeof()
1641 struct xfs_inode *ip, in xfs_bmap_last_offset() argument
1651 if (XFS_IFORK_FORMAT(ip, whichfork) == XFS_DINODE_FMT_LOCAL) in xfs_bmap_last_offset()
1654 if (XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_BTREE && in xfs_bmap_last_offset()
1655 XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_EXTENTS) in xfs_bmap_last_offset()
1658 error = xfs_bmap_last_extent(NULL, ip, whichfork, &rec, &is_empty); in xfs_bmap_last_offset()
1673 xfs_inode_t *ip, /* incore inode */ in xfs_bmap_one_block() argument
1683 return XFS_ISIZE(ip) == ip->i_mount->m_sb.sb_blocksize; in xfs_bmap_one_block()
1685 if (XFS_IFORK_NEXTENTS(ip, whichfork) != 1) in xfs_bmap_one_block()
1687 if (XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_EXTENTS) in xfs_bmap_one_block()
1689 ifp = XFS_IFORK_PTR(ip, whichfork); in xfs_bmap_one_block()
1695 ASSERT(XFS_ISIZE(ip) == ip->i_mount->m_sb.sb_blocksize); in xfs_bmap_one_block()
1729 ifp = XFS_IFORK_PTR(bma->ip, XFS_DATA_FORK); in xfs_bmap_add_extent_delay_real()
1788 if (bma->idx < bma->ip->i_df.if_bytes / (uint)sizeof(xfs_bmbt_rec_t) - 1) { in xfs_bmap_add_extent_delay_real()
1822 trace_xfs_bmap_pre_update(bma->ip, bma->idx, state, _THIS_IP_); in xfs_bmap_add_extent_delay_real()
1826 trace_xfs_bmap_post_update(bma->ip, bma->idx, state, _THIS_IP_); in xfs_bmap_add_extent_delay_real()
1828 xfs_iext_remove(bma->ip, bma->idx + 1, 2, state); in xfs_bmap_add_extent_delay_real()
1829 bma->ip->i_d.di_nextents--; in xfs_bmap_add_extent_delay_real()
1865 trace_xfs_bmap_pre_update(bma->ip, bma->idx, state, _THIS_IP_); in xfs_bmap_add_extent_delay_real()
1868 trace_xfs_bmap_post_update(bma->ip, bma->idx, state, _THIS_IP_); in xfs_bmap_add_extent_delay_real()
1870 xfs_iext_remove(bma->ip, bma->idx + 1, 1, state); in xfs_bmap_add_extent_delay_real()
1895 trace_xfs_bmap_pre_update(bma->ip, bma->idx, state, _THIS_IP_); in xfs_bmap_add_extent_delay_real()
1899 trace_xfs_bmap_post_update(bma->ip, bma->idx, state, _THIS_IP_); in xfs_bmap_add_extent_delay_real()
1901 xfs_iext_remove(bma->ip, bma->idx + 1, 1, state); in xfs_bmap_add_extent_delay_real()
1927 trace_xfs_bmap_pre_update(bma->ip, bma->idx, state, _THIS_IP_); in xfs_bmap_add_extent_delay_real()
1929 trace_xfs_bmap_post_update(bma->ip, bma->idx, state, _THIS_IP_); in xfs_bmap_add_extent_delay_real()
1931 bma->ip->i_d.di_nextents++; in xfs_bmap_add_extent_delay_real()
1955 trace_xfs_bmap_pre_update(bma->ip, bma->idx - 1, state, _THIS_IP_); in xfs_bmap_add_extent_delay_real()
1960 trace_xfs_bmap_post_update(bma->ip, bma->idx - 1, state, _THIS_IP_); in xfs_bmap_add_extent_delay_real()
1963 trace_xfs_bmap_pre_update(bma->ip, bma->idx, state, _THIS_IP_); in xfs_bmap_add_extent_delay_real()
1983 da_new = XFS_FILBLKS_MIN(xfs_bmap_worst_indlen(bma->ip, temp), in xfs_bmap_add_extent_delay_real()
1986 trace_xfs_bmap_post_update(bma->ip, bma->idx, state, _THIS_IP_); in xfs_bmap_add_extent_delay_real()
1996 trace_xfs_bmap_pre_update(bma->ip, bma->idx, state, _THIS_IP_); in xfs_bmap_add_extent_delay_real()
2000 xfs_iext_insert(bma->ip, bma->idx, 1, new, state); in xfs_bmap_add_extent_delay_real()
2001 bma->ip->i_d.di_nextents++; in xfs_bmap_add_extent_delay_real()
2019 if (xfs_bmap_needs_btree(bma->ip, XFS_DATA_FORK)) { in xfs_bmap_add_extent_delay_real()
2020 error = xfs_bmap_extents_to_btree(bma->tp, bma->ip, in xfs_bmap_add_extent_delay_real()
2027 da_new = XFS_FILBLKS_MIN(xfs_bmap_worst_indlen(bma->ip, temp), in xfs_bmap_add_extent_delay_real()
2032 trace_xfs_bmap_post_update(bma->ip, bma->idx + 1, state, _THIS_IP_); in xfs_bmap_add_extent_delay_real()
2041 trace_xfs_bmap_pre_update(bma->ip, bma->idx + 1, state, _THIS_IP_); in xfs_bmap_add_extent_delay_real()
2047 trace_xfs_bmap_post_update(bma->ip, bma->idx + 1, state, _THIS_IP_); in xfs_bmap_add_extent_delay_real()
2067 da_new = XFS_FILBLKS_MIN(xfs_bmap_worst_indlen(bma->ip, temp), in xfs_bmap_add_extent_delay_real()
2069 trace_xfs_bmap_pre_update(bma->ip, bma->idx, state, _THIS_IP_); in xfs_bmap_add_extent_delay_real()
2071 trace_xfs_bmap_post_update(bma->ip, bma->idx, state, _THIS_IP_); in xfs_bmap_add_extent_delay_real()
2082 trace_xfs_bmap_pre_update(bma->ip, bma->idx, state, _THIS_IP_); in xfs_bmap_add_extent_delay_real()
2084 xfs_iext_insert(bma->ip, bma->idx + 1, 1, new, state); in xfs_bmap_add_extent_delay_real()
2085 bma->ip->i_d.di_nextents++; in xfs_bmap_add_extent_delay_real()
2103 if (xfs_bmap_needs_btree(bma->ip, XFS_DATA_FORK)) { in xfs_bmap_add_extent_delay_real()
2104 error = xfs_bmap_extents_to_btree(bma->tp, bma->ip, in xfs_bmap_add_extent_delay_real()
2111 da_new = XFS_FILBLKS_MIN(xfs_bmap_worst_indlen(bma->ip, temp), in xfs_bmap_add_extent_delay_real()
2116 trace_xfs_bmap_post_update(bma->ip, bma->idx, state, _THIS_IP_); in xfs_bmap_add_extent_delay_real()
2144 trace_xfs_bmap_pre_update(bma->ip, bma->idx, 0, _THIS_IP_); in xfs_bmap_add_extent_delay_real()
2149 (int)xfs_bmap_worst_indlen(bma->ip, temp2)); in xfs_bmap_add_extent_delay_real()
2153 xfs_iext_insert(bma->ip, bma->idx + 1, 2, &LEFT, state); in xfs_bmap_add_extent_delay_real()
2154 bma->ip->i_d.di_nextents++; in xfs_bmap_add_extent_delay_real()
2172 if (xfs_bmap_needs_btree(bma->ip, XFS_DATA_FORK)) { in xfs_bmap_add_extent_delay_real()
2173 error = xfs_bmap_extents_to_btree(bma->tp, bma->ip, in xfs_bmap_add_extent_delay_real()
2180 temp = xfs_bmap_worst_indlen(bma->ip, temp); in xfs_bmap_add_extent_delay_real()
2181 temp2 = xfs_bmap_worst_indlen(bma->ip, temp2); in xfs_bmap_add_extent_delay_real()
2185 error = xfs_mod_fdblocks(bma->ip->i_mount, in xfs_bmap_add_extent_delay_real()
2194 trace_xfs_bmap_post_update(bma->ip, bma->idx, state, _THIS_IP_); in xfs_bmap_add_extent_delay_real()
2195 trace_xfs_bmap_pre_update(bma->ip, bma->idx + 2, state, _THIS_IP_); in xfs_bmap_add_extent_delay_real()
2198 trace_xfs_bmap_post_update(bma->ip, bma->idx + 2, state, _THIS_IP_); in xfs_bmap_add_extent_delay_real()
2218 if (xfs_bmap_needs_btree(bma->ip, XFS_DATA_FORK)) { in xfs_bmap_add_extent_delay_real()
2222 error = xfs_bmap_extents_to_btree(bma->tp, bma->ip, in xfs_bmap_add_extent_delay_real()
2237 xfs_mod_fdblocks(bma->ip->i_mount, in xfs_bmap_add_extent_delay_real()
2245 xfs_bmap_check_leaf_extents(bma->cur, bma->ip, XFS_DATA_FORK); in xfs_bmap_add_extent_delay_real()
2260 xfs_inode_t *ip, /* incore inode pointer */ in xfs_bmap_add_extent_unwritten_real() argument
2285 ifp = XFS_IFORK_PTR(ip, XFS_DATA_FORK); in xfs_bmap_add_extent_unwritten_real()
2344 if (*idx < ip->i_df.if_bytes / (uint)sizeof(xfs_bmbt_rec_t) - 1) { in xfs_bmap_add_extent_unwritten_real()
2377 trace_xfs_bmap_pre_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_add_extent_unwritten_real()
2381 trace_xfs_bmap_post_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_add_extent_unwritten_real()
2383 xfs_iext_remove(ip, *idx + 1, 2, state); in xfs_bmap_add_extent_unwritten_real()
2384 ip->i_d.di_nextents -= 2; in xfs_bmap_add_extent_unwritten_real()
2421 trace_xfs_bmap_pre_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_add_extent_unwritten_real()
2424 trace_xfs_bmap_post_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_add_extent_unwritten_real()
2426 xfs_iext_remove(ip, *idx + 1, 1, state); in xfs_bmap_add_extent_unwritten_real()
2427 ip->i_d.di_nextents--; in xfs_bmap_add_extent_unwritten_real()
2456 trace_xfs_bmap_pre_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_add_extent_unwritten_real()
2460 trace_xfs_bmap_post_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_add_extent_unwritten_real()
2461 xfs_iext_remove(ip, *idx + 1, 1, state); in xfs_bmap_add_extent_unwritten_real()
2462 ip->i_d.di_nextents--; in xfs_bmap_add_extent_unwritten_real()
2492 trace_xfs_bmap_pre_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_add_extent_unwritten_real()
2494 trace_xfs_bmap_post_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_add_extent_unwritten_real()
2517 trace_xfs_bmap_pre_update(ip, *idx - 1, state, _THIS_IP_); in xfs_bmap_add_extent_unwritten_real()
2522 trace_xfs_bmap_post_update(ip, *idx - 1, state, _THIS_IP_); in xfs_bmap_add_extent_unwritten_real()
2524 trace_xfs_bmap_pre_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_add_extent_unwritten_real()
2529 trace_xfs_bmap_post_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_add_extent_unwritten_real()
2564 trace_xfs_bmap_pre_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_add_extent_unwritten_real()
2571 trace_xfs_bmap_post_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_add_extent_unwritten_real()
2573 xfs_iext_insert(ip, *idx, 1, new, state); in xfs_bmap_add_extent_unwritten_real()
2574 ip->i_d.di_nextents++; in xfs_bmap_add_extent_unwritten_real()
2602 trace_xfs_bmap_pre_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_add_extent_unwritten_real()
2605 trace_xfs_bmap_post_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_add_extent_unwritten_real()
2609 trace_xfs_bmap_pre_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_add_extent_unwritten_real()
2613 trace_xfs_bmap_post_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_add_extent_unwritten_real()
2644 trace_xfs_bmap_pre_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_add_extent_unwritten_real()
2647 trace_xfs_bmap_post_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_add_extent_unwritten_real()
2650 xfs_iext_insert(ip, *idx, 1, new, state); in xfs_bmap_add_extent_unwritten_real()
2652 ip->i_d.di_nextents++; in xfs_bmap_add_extent_unwritten_real()
2685 trace_xfs_bmap_pre_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_add_extent_unwritten_real()
2688 trace_xfs_bmap_post_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_add_extent_unwritten_real()
2698 xfs_iext_insert(ip, *idx, 2, &r[0], state); in xfs_bmap_add_extent_unwritten_real()
2700 ip->i_d.di_nextents += 2; in xfs_bmap_add_extent_unwritten_real()
2754 if (xfs_bmap_needs_btree(ip, XFS_DATA_FORK)) { in xfs_bmap_add_extent_unwritten_real()
2758 error = xfs_bmap_extents_to_btree(tp, ip, first, flist, &cur, in xfs_bmap_add_extent_unwritten_real()
2771 xfs_bmap_check_leaf_extents(*curp, ip, XFS_DATA_FORK); in xfs_bmap_add_extent_unwritten_real()
2785 xfs_inode_t *ip, /* incore inode pointer */ in xfs_bmap_add_extent_hole_delay() argument
2797 ifp = XFS_IFORK_PTR(ip, XFS_DATA_FORK); in xfs_bmap_add_extent_hole_delay()
2816 if (*idx < ip->i_df.if_bytes / (uint)sizeof(xfs_bmbt_rec_t)) { in xfs_bmap_add_extent_hole_delay()
2855 trace_xfs_bmap_pre_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_add_extent_hole_delay()
2860 newlen = xfs_bmap_worst_indlen(ip, temp); in xfs_bmap_add_extent_hole_delay()
2863 trace_xfs_bmap_post_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_add_extent_hole_delay()
2865 xfs_iext_remove(ip, *idx + 1, 1, state); in xfs_bmap_add_extent_hole_delay()
2877 trace_xfs_bmap_pre_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_add_extent_hole_delay()
2881 newlen = xfs_bmap_worst_indlen(ip, temp); in xfs_bmap_add_extent_hole_delay()
2884 trace_xfs_bmap_post_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_add_extent_hole_delay()
2893 trace_xfs_bmap_pre_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_add_extent_hole_delay()
2897 newlen = xfs_bmap_worst_indlen(ip, temp); in xfs_bmap_add_extent_hole_delay()
2901 trace_xfs_bmap_post_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_add_extent_hole_delay()
2911 xfs_iext_insert(ip, *idx, 1, new, state); in xfs_bmap_add_extent_hole_delay()
2916 xfs_mod_fdblocks(ip->i_mount, (int64_t)(oldlen - newlen), in xfs_bmap_add_extent_hole_delay()
2943 ifp = XFS_IFORK_PTR(bma->ip, whichfork); in xfs_bmap_add_extent_hole_real()
3011 trace_xfs_bmap_pre_update(bma->ip, bma->idx, state, _THIS_IP_); in xfs_bmap_add_extent_hole_real()
3015 trace_xfs_bmap_post_update(bma->ip, bma->idx, state, _THIS_IP_); in xfs_bmap_add_extent_hole_real()
3017 xfs_iext_remove(bma->ip, bma->idx + 1, 1, state); in xfs_bmap_add_extent_hole_real()
3019 XFS_IFORK_NEXT_SET(bma->ip, whichfork, in xfs_bmap_add_extent_hole_real()
3020 XFS_IFORK_NEXTENTS(bma->ip, whichfork) - 1); in xfs_bmap_add_extent_hole_real()
3057 trace_xfs_bmap_pre_update(bma->ip, bma->idx, state, _THIS_IP_); in xfs_bmap_add_extent_hole_real()
3060 trace_xfs_bmap_post_update(bma->ip, bma->idx, state, _THIS_IP_); in xfs_bmap_add_extent_hole_real()
3088 trace_xfs_bmap_pre_update(bma->ip, bma->idx, state, _THIS_IP_); in xfs_bmap_add_extent_hole_real()
3093 trace_xfs_bmap_post_update(bma->ip, bma->idx, state, _THIS_IP_); in xfs_bmap_add_extent_hole_real()
3122 xfs_iext_insert(bma->ip, bma->idx, 1, new, state); in xfs_bmap_add_extent_hole_real()
3123 XFS_IFORK_NEXT_SET(bma->ip, whichfork, in xfs_bmap_add_extent_hole_real()
3124 XFS_IFORK_NEXTENTS(bma->ip, whichfork) + 1); in xfs_bmap_add_extent_hole_real()
3146 if (xfs_bmap_needs_btree(bma->ip, whichfork)) { in xfs_bmap_add_extent_hole_real()
3150 error = xfs_bmap_extents_to_btree(bma->tp, bma->ip, in xfs_bmap_add_extent_hole_real()
3162 xfs_bmap_check_leaf_extents(bma->cur, bma->ip, whichfork); in xfs_bmap_add_extent_hole_real()
3368 mp = ap->ip->i_mount; in xfs_bmap_adjacent()
3370 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()
3806 args.ip = ap->ip; in xfs_bmap_btalloc()
3872 ap->ip->i_d.di_nblocks += args.len; in xfs_bmap_btalloc()
3873 xfs_trans_log_inode(ap->tp, ap->ip, XFS_ILOG_CORE); in xfs_bmap_btalloc()
3875 ap->ip->i_delayed_blks -= args.len; in xfs_bmap_btalloc()
3880 xfs_trans_mod_dquot_byino(ap->tp, ap->ip, in xfs_bmap_btalloc()
3899 if (XFS_IS_REALTIME_INODE(ap->ip) && ap->userdata) in xfs_bmap_alloc()
4010 struct xfs_inode *ip, in xfs_bmapi_read() argument
4017 struct xfs_mount *mp = ip->i_mount; in xfs_bmapi_read()
4033 ASSERT(xfs_isilocked(ip, XFS_ILOCK_SHARED|XFS_ILOCK_EXCL)); in xfs_bmapi_read()
4036 (XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_EXTENTS && in xfs_bmapi_read()
4037 XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_BTREE), in xfs_bmapi_read()
4048 ifp = XFS_IFORK_PTR(ip, whichfork); in xfs_bmapi_read()
4051 error = xfs_iread_extents(NULL, ip, whichfork); in xfs_bmapi_read()
4056 xfs_bmap_search_extents(ip, bno, whichfork, &eof, &lastx, &got, &prev); in xfs_bmapi_read()
4098 struct xfs_inode *ip, in xfs_bmapi_reserve_delalloc() argument
4106 struct xfs_mount *mp = ip->i_mount; in xfs_bmapi_reserve_delalloc()
4107 struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, XFS_DATA_FORK); in xfs_bmapi_reserve_delalloc()
4110 char rt = XFS_IS_REALTIME_INODE(ip); in xfs_bmapi_reserve_delalloc()
4119 extsz = xfs_get_extsz_hint(ip); in xfs_bmapi_reserve_delalloc()
4134 error = xfs_trans_reserve_quota_nblks(NULL, ip, (long)alen, 0, in xfs_bmapi_reserve_delalloc()
4143 indlen = (xfs_extlen_t)xfs_bmap_worst_indlen(ip, alen); in xfs_bmapi_reserve_delalloc()
4160 ip->i_delayed_blks += alen; in xfs_bmapi_reserve_delalloc()
4166 xfs_bmap_add_extent_hole_delay(ip, lastx, got); in xfs_bmapi_reserve_delalloc()
4187 xfs_trans_unreserve_quota_nblks(NULL, ip, (long)alen, 0, rt ? in xfs_bmapi_reserve_delalloc()
4197 struct xfs_inode *ip, /* incore inode */ in xfs_bmapi_delay() argument
4204 struct xfs_mount *mp = ip->i_mount; in xfs_bmapi_delay()
4205 struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, XFS_DATA_FORK); in xfs_bmapi_delay()
4218 ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); in xfs_bmapi_delay()
4221 (XFS_IFORK_FORMAT(ip, XFS_DATA_FORK) != XFS_DINODE_FMT_EXTENTS && in xfs_bmapi_delay()
4222 XFS_IFORK_FORMAT(ip, XFS_DATA_FORK) != XFS_DINODE_FMT_BTREE), in xfs_bmapi_delay()
4234 error = xfs_iread_extents(NULL, ip, XFS_DATA_FORK); in xfs_bmapi_delay()
4239 xfs_bmap_search_extents(ip, bno, XFS_DATA_FORK, &eof, &lastx, &got, &prev); in xfs_bmapi_delay()
4245 error = xfs_bmapi_reserve_delalloc(ip, bno, len, &got, in xfs_bmapi_delay()
4281 struct xfs_mount *mp = bma->ip->i_mount; in xfs_bmapi_allocate()
4284 struct xfs_ifork *ifp = XFS_IFORK_PTR(bma->ip, whichfork); in xfs_bmapi_allocate()
4344 bma->cur = xfs_bmbt_init_cursor(mp, bma->tp, bma->ip, whichfork); in xfs_bmapi_allocate()
4404 struct xfs_ifork *ifp = XFS_IFORK_PTR(bma->ip, whichfork); in xfs_bmapi_convert_unwritten()
4424 bma->cur = xfs_bmbt_init_cursor(bma->ip->i_mount, bma->tp, in xfs_bmapi_convert_unwritten()
4425 bma->ip, whichfork); in xfs_bmapi_convert_unwritten()
4437 error = xfs_zero_extent(bma->ip, mval->br_startblock, in xfs_bmapi_convert_unwritten()
4443 error = xfs_bmap_add_extent_unwritten_real(bma->tp, bma->ip, &bma->idx, in xfs_bmapi_convert_unwritten()
4489 struct xfs_inode *ip, /* incore inode */ in xfs_bmapi_write() argument
4500 struct xfs_mount *mp = ip->i_mount; in xfs_bmapi_write()
4533 ASSERT(XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_LOCAL); in xfs_bmapi_write()
4534 ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); in xfs_bmapi_write()
4549 (XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_EXTENTS && in xfs_bmapi_write()
4550 XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_BTREE), in xfs_bmapi_write()
4559 ifp = XFS_IFORK_PTR(ip, whichfork); in xfs_bmapi_write()
4564 if (XFS_IFORK_FORMAT(ip, whichfork) == XFS_DINODE_FMT_BTREE) in xfs_bmapi_write()
4573 error = xfs_iread_extents(tp, ip, whichfork); in xfs_bmapi_write()
4578 xfs_bmap_search_extents(ip, bno, whichfork, &eof, &bma.idx, &bma.got, in xfs_bmapi_write()
4585 bma.ip = ip; in xfs_bmapi_write()
4662 if (xfs_bmap_wants_extents(ip, whichfork)) { in xfs_bmapi_write()
4666 error = xfs_bmap_btree_to_extents(tp, ip, bma.cur, in xfs_bmapi_write()
4673 ASSERT(XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_BTREE || in xfs_bmapi_write()
4674 XFS_IFORK_NEXTENTS(ip, whichfork) > in xfs_bmapi_write()
4675 XFS_IFORK_MAXEXT(ip, whichfork)); in xfs_bmapi_write()
4683 XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_EXTENTS) in xfs_bmapi_write()
4686 XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_BTREE) in xfs_bmapi_write()
4694 xfs_trans_log_inode(tp, ip, bma.logflags); in xfs_bmapi_write()
4723 xfs_inode_t *ip, /* incore inode pointer */ in xfs_bmap_del_extent() argument
4754 mp = ip->i_mount; in xfs_bmap_del_extent()
4760 ifp = XFS_IFORK_PTR(ip, whichfork); in xfs_bmap_del_extent()
4783 if (whichfork == XFS_DATA_FORK && XFS_IS_REALTIME_INODE(ip)) { in xfs_bmap_del_extent()
4838 xfs_iext_remove(ip, *idx, 1, in xfs_bmap_del_extent()
4844 XFS_IFORK_NEXT_SET(ip, whichfork, in xfs_bmap_del_extent()
4845 XFS_IFORK_NEXTENTS(ip, whichfork) - 1); in xfs_bmap_del_extent()
4860 trace_xfs_bmap_pre_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_del_extent()
4865 temp = XFS_FILBLKS_MIN(xfs_bmap_worst_indlen(ip, temp), in xfs_bmap_del_extent()
4868 trace_xfs_bmap_post_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_del_extent()
4873 trace_xfs_bmap_post_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_del_extent()
4889 trace_xfs_bmap_pre_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_del_extent()
4892 temp = XFS_FILBLKS_MIN(xfs_bmap_worst_indlen(ip, temp), in xfs_bmap_del_extent()
4895 trace_xfs_bmap_post_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_del_extent()
4899 trace_xfs_bmap_post_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_del_extent()
4916 trace_xfs_bmap_pre_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_del_extent()
4978 XFS_IFORK_NEXT_SET(ip, whichfork, in xfs_bmap_del_extent()
4979 XFS_IFORK_NEXTENTS(ip, whichfork) + 1); in xfs_bmap_del_extent()
4982 temp = xfs_bmap_worst_indlen(ip, temp); in xfs_bmap_del_extent()
4984 temp2 = xfs_bmap_worst_indlen(ip, temp2); in xfs_bmap_del_extent()
5004 trace_xfs_bmap_post_update(ip, *idx, state, _THIS_IP_); in xfs_bmap_del_extent()
5005 xfs_iext_insert(ip, *idx + 1, 1, &new, state); in xfs_bmap_del_extent()
5019 ip->i_d.di_nblocks -= nblks; in xfs_bmap_del_extent()
5024 xfs_trans_mod_dquot_byino(tp, ip, qfield, (long)-nblks); in xfs_bmap_del_extent()
5047 struct xfs_inode *ip, /* incore inode */ in xfs_bunmapi() argument
5078 trace_xfs_bunmap(ip, bno, len, flags, _RET_IP_); in xfs_bunmapi()
5082 ifp = XFS_IFORK_PTR(ip, whichfork); in xfs_bunmapi()
5084 XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_EXTENTS && in xfs_bunmapi()
5085 XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_BTREE)) { in xfs_bunmapi()
5087 ip->i_mount); in xfs_bunmapi()
5090 mp = ip->i_mount; in xfs_bunmapi()
5094 ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); in xfs_bunmapi()
5099 (error = xfs_iread_extents(tp, ip, whichfork))) in xfs_bunmapi()
5107 isrt = (whichfork == XFS_DATA_FORK) && XFS_IS_REALTIME_INODE(ip); in xfs_bunmapi()
5110 ep = xfs_bmap_search_extents(ip, bno, whichfork, &eof, &lastx, &got, in xfs_bunmapi()
5124 ASSERT(XFS_IFORK_FORMAT(ip, whichfork) == XFS_DINODE_FMT_BTREE); in xfs_bunmapi()
5125 cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork); in xfs_bunmapi()
5218 error = xfs_bmap_add_extent_unwritten_real(tp, ip, in xfs_bunmapi()
5277 ip, &lastx, &cur, &prev, in xfs_bunmapi()
5286 ip, &lastx, &cur, &del, in xfs_bunmapi()
5303 ip, -((long)del.br_blockcount), 0, in xfs_bunmapi()
5309 ip, -((long)del.br_blockcount), 0, in xfs_bunmapi()
5312 ip->i_delayed_blks -= del.br_blockcount; in xfs_bunmapi()
5330 XFS_IFORK_FORMAT(ip, whichfork) == XFS_DINODE_FMT_EXTENTS && in xfs_bunmapi()
5331 XFS_IFORK_NEXTENTS(ip, whichfork) >= /* Note the >= */ in xfs_bunmapi()
5332 XFS_IFORK_MAXEXT(ip, whichfork) && in xfs_bunmapi()
5339 error = xfs_bmap_del_extent(ip, tp, &lastx, flist, cur, &del, in xfs_bunmapi()
5367 if (xfs_bmap_needs_btree(ip, whichfork)) { in xfs_bunmapi()
5369 error = xfs_bmap_extents_to_btree(tp, ip, firstblock, flist, in xfs_bunmapi()
5378 else if (xfs_bmap_wants_extents(ip, whichfork)) { in xfs_bunmapi()
5380 error = xfs_bmap_btree_to_extents(tp, ip, cur, &tmp_logflags, in xfs_bunmapi()
5396 XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_EXTENTS) in xfs_bunmapi()
5399 XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_BTREE) in xfs_bunmapi()
5406 xfs_trans_log_inode(tp, ip, logflags); in xfs_bunmapi()
5456 struct xfs_inode *ip, in xfs_bmse_merge() argument
5469 struct xfs_mount *mp = ip->i_mount; in xfs_bmse_merge()
5475 ASSERT(xfs_isilocked(ip, XFS_IOLOCK_EXCL)); in xfs_bmse_merge()
5476 ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); in xfs_bmse_merge()
5485 xfs_iext_remove(ip, current_ext, 1, 0); in xfs_bmse_merge()
5491 XFS_IFORK_NEXT_SET(ip, whichfork, in xfs_bmse_merge()
5492 XFS_IFORK_NEXTENTS(ip, whichfork) - 1); in xfs_bmse_merge()
5529 struct xfs_inode *ip, in xfs_bmse_shift_one() argument
5548 mp = ip->i_mount; in xfs_bmse_shift_one()
5549 ifp = XFS_IFORK_PTR(ip, whichfork); in xfs_bmse_shift_one()
5584 return xfs_bmse_merge(ip, whichfork, offset_shift_fsb, in xfs_bmse_shift_one()
5652 struct xfs_inode *ip, in xfs_bmap_shift_extents() argument
5665 struct xfs_mount *mp = ip->i_mount; in xfs_bmap_shift_extents()
5676 (XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_EXTENTS && in xfs_bmap_shift_extents()
5677 XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_BTREE), in xfs_bmap_shift_extents()
5687 ASSERT(xfs_isilocked(ip, XFS_IOLOCK_EXCL)); in xfs_bmap_shift_extents()
5688 ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); in xfs_bmap_shift_extents()
5692 ifp = XFS_IFORK_PTR(ip, whichfork); in xfs_bmap_shift_extents()
5695 error = xfs_iread_extents(tp, ip, whichfork); in xfs_bmap_shift_extents()
5701 cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork); in xfs_bmap_shift_extents()
5762 error = xfs_bmse_shift_one(ip, whichfork, offset_shift_fsb, in xfs_bmap_shift_extents()
5795 xfs_trans_log_inode(tp, ip, logflags); in xfs_bmap_shift_extents()
5809 struct xfs_inode *ip, in xfs_bmap_split_extent_at() argument
5819 struct xfs_mount *mp = ip->i_mount; in xfs_bmap_split_extent_at()
5828 (XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_EXTENTS && in xfs_bmap_split_extent_at()
5829 XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_BTREE), in xfs_bmap_split_extent_at()
5839 ifp = XFS_IFORK_PTR(ip, whichfork); in xfs_bmap_split_extent_at()
5842 error = xfs_iread_extents(tp, ip, whichfork); in xfs_bmap_split_extent_at()
5872 cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork); in xfs_bmap_split_extent_at()
5901 xfs_iext_insert(ip, current_ext, 1, &new, 0); in xfs_bmap_split_extent_at()
5902 XFS_IFORK_NEXT_SET(ip, whichfork, in xfs_bmap_split_extent_at()
5903 XFS_IFORK_NEXTENTS(ip, whichfork) + 1); in xfs_bmap_split_extent_at()
5923 if (xfs_bmap_needs_btree(ip, whichfork)) { in xfs_bmap_split_extent_at()
5927 error = xfs_bmap_extents_to_btree(tp, ip, firstfsb, free_list, in xfs_bmap_split_extent_at()
5940 xfs_trans_log_inode(tp, ip, logflags); in xfs_bmap_split_extent_at()
5946 struct xfs_inode *ip, in xfs_bmap_split_extent() argument
5949 struct xfs_mount *mp = ip->i_mount; in xfs_bmap_split_extent()
5964 xfs_ilock(ip, XFS_ILOCK_EXCL); in xfs_bmap_split_extent()
5965 xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL); in xfs_bmap_split_extent()
5969 error = xfs_bmap_split_extent_at(tp, ip, split_fsb, in xfs_bmap_split_extent()