提交 f311d771 编写于 作者: C Christoph Hellwig 提交者: Darrick J. Wong

xfs: clean up bufsize alignment in xfs_ioc_attr_list

Use the round_down macro, and use the size of the uint32 type we
use in the callback that fills the buffer to make the code a little
more clear - the size of it is always the same as int for platforms
that Linux runs on.
Suggested-by: NDave Chinner <dchinner@redhat.com>
Reviewed-by: NDave Chinner <dchinner@redhat.com>
Signed-off-by: NChristoph Hellwig <hch@lst.de>
Reviewed-by: NDarrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: NDarrick J. Wong <darrick.wong@oracle.com>
上级 e3a19cde
...@@ -415,7 +415,7 @@ xfs_ioc_attr_list( ...@@ -415,7 +415,7 @@ xfs_ioc_attr_list(
context.resynch = 1; context.resynch = 1;
context.attr_filter = xfs_attr_filter(flags); context.attr_filter = xfs_attr_filter(flags);
context.buffer = buffer; context.buffer = buffer;
context.bufsize = (bufsize & ~(sizeof(int)-1)); /* align */ context.bufsize = round_down(bufsize, sizeof(uint32_t));
context.firstu = context.bufsize; context.firstu = context.bufsize;
context.put_listent = xfs_ioc_attr_put_listent; context.put_listent = xfs_ioc_attr_put_listent;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册