@@ -1063,7 +1063,7 @@ xfs_attr_set(
rmt_blks = xfs_attr3_rmt_blocks(mp, args->valuelen);
} else {
XFS_STATS_INC(mp, xs_attr_remove);
- rmt_blks = xfs_attr3_rmt_blocks(mp, XFS_XATTR_SIZE_MAX);
+ rmt_blks = xfs_attr3_max_rmt_blocks(mp);
}
/*
@@ -1228,7 +1228,7 @@ xfs_attr_removename(
ASSERT(!args->trans);
rmt_extents = XFS_IEXT_ATTR_MANIP_CNT(
- xfs_attr3_rmt_blocks(mp, XFS_XATTR_SIZE_MAX));
+ xfs_attr3_max_rmt_blocks(mp));
xfs_init_attr_trans(args, &tres, &total);
error = xfs_trans_alloc_inode(dp, &tres, total, 0, rsvd, &args->trans);
@@ -8,6 +8,12 @@
unsigned int xfs_attr3_rmt_blocks(struct xfs_mount *mp, unsigned int attrlen);
+/* Number of rmt blocks needed to store the maximally sized attr value */
+static inline unsigned int xfs_attr3_max_rmt_blocks(struct xfs_mount *mp)
+{
+ return xfs_attr3_rmt_blocks(mp, XFS_XATTR_SIZE_MAX);
+}
+
int xfs_attr_rmtval_get(struct xfs_da_args *args);
int xfs_attr_rmtval_stale(struct xfs_inode *ip, struct xfs_bmbt_irec *map,
xfs_buf_flags_t incore_flags);
@@ -227,7 +227,7 @@ xrep_bufscan_max_sectors(
int max_fsbs;
/* Remote xattr values are the largest buffers that we support. */
- max_fsbs = xfs_attr3_rmt_blocks(mp, XFS_XATTR_SIZE_MAX);
+ max_fsbs = xfs_attr3_max_rmt_blocks(mp);
return XFS_FSB_TO_BB(mp, min_t(xfs_extlen_t, fsblocks, max_fsbs));
}
@@ -1070,7 +1070,7 @@ xreap_bmapi_binval(
* of the next hole.
*/
off = imap->br_startoff + imap->br_blockcount;
- max_off = off + xfs_attr3_rmt_blocks(mp, XFS_XATTR_SIZE_MAX);
+ max_off = off + xfs_attr3_max_rmt_blocks(mp);
while (off < max_off) {
struct xfs_bmbt_irec hmap;
int nhmaps = 1;