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

xfs: ignore extent size hints for always COW inodes

There is no point in applying extent size hints for always COW inodes,
as we would just have to COW any extra allocation beyond the data
actually written.
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>
上级 e5e63404
...@@ -55,6 +55,12 @@ xfs_extlen_t ...@@ -55,6 +55,12 @@ xfs_extlen_t
xfs_get_extsz_hint( xfs_get_extsz_hint(
struct xfs_inode *ip) struct xfs_inode *ip)
{ {
/*
* No point in aligning allocations if we need to COW to actually
* write to them.
*/
if (xfs_is_always_cow_inode(ip))
return 0;
if ((ip->i_d.di_flags & XFS_DIFLAG_EXTSIZE) && ip->i_d.di_extsize) if ((ip->i_d.di_flags & XFS_DIFLAG_EXTSIZE) && ip->i_d.di_extsize)
return ip->i_d.di_extsize; return ip->i_d.di_extsize;
if (XFS_IS_REALTIME_INODE(ip)) if (XFS_IS_REALTIME_INODE(ip))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册