Commit 3791a053 authored by Darrick J. Wong's avatar Darrick J. Wong

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: default avatarDarrick J. Wong <djwong@kernel.org>
Reviewed-by: default avatarAndrey Albershteyn <aalbersh@redhat.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
parent 204a26aa
...@@ -56,19 +56,19 @@ xfs_attr3_rmt_buf_space( ...@@ -56,19 +56,19 @@ xfs_attr3_rmt_buf_space(
return blocksize; return blocksize;
} }
/* /* Compute number of fsblocks needed to store a remote attr value */
* Each contiguous block has a header, so it is not just a simple attribute
* length to FSB conversion.
*/
unsigned int unsigned int
xfs_attr3_rmt_blocks( xfs_attr3_rmt_blocks(
struct xfs_mount *mp, struct xfs_mount *mp,
unsigned int attrlen) unsigned int attrlen)
{ {
if (xfs_has_crc(mp)) { /*
unsigned int buflen = xfs_attr3_rmt_buf_space(mp); * Each contiguous block has a header, so it is not just a simple
return (attrlen + buflen - 1) / buflen; * attribute length to FSB conversion.
} */
if (xfs_has_crc(mp))
return howmany(attrlen, xfs_attr3_rmt_buf_space(mp));
return XFS_B_TO_FSB(mp, attrlen); return XFS_B_TO_FSB(mp, attrlen);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment