Skip to content

Commit 3791a05

Browse files
author
Darrick J. Wong
committed
xfs: minor cleanups of xfs_attr3_rmt_blocks
Clean up the type signature of this function since we don't have negative attr lengths or block counts. Signed-off-by: Darrick J. Wong <[email protected]> Reviewed-by: Andrey Albershteyn <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]>
1 parent 204a26a commit 3791a05

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

fs/xfs/libxfs/xfs_attr_remote.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,19 +56,19 @@ xfs_attr3_rmt_buf_space(
5656
return blocksize;
5757
}
5858

59-
/*
60-
* Each contiguous block has a header, so it is not just a simple attribute
61-
* length to FSB conversion.
62-
*/
59+
/* Compute number of fsblocks needed to store a remote attr value */
6360
unsigned int
6461
xfs_attr3_rmt_blocks(
6562
struct xfs_mount *mp,
6663
unsigned int attrlen)
6764
{
68-
if (xfs_has_crc(mp)) {
69-
unsigned int buflen = xfs_attr3_rmt_buf_space(mp);
70-
return (attrlen + buflen - 1) / buflen;
71-
}
65+
/*
66+
* Each contiguous block has a header, so it is not just a simple
67+
* attribute length to FSB conversion.
68+
*/
69+
if (xfs_has_crc(mp))
70+
return howmany(attrlen, xfs_attr3_rmt_buf_space(mp));
71+
7272
return XFS_B_TO_FSB(mp, attrlen);
7373
}
7474

0 commit comments

Comments
 (0)