]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs: create a separate cow extent size hint for the allocator
authorDarrick J. Wong <darrick.wong@oracle.com>
Tue, 25 Oct 2016 01:43:42 +0000 (12:43 +1100)
committerDave Chinner <david@fromorbit.com>
Tue, 25 Oct 2016 01:43:42 +0000 (12:43 +1100)
commit104609946adcf6fd931c2482e6847b2f7b425e20
treefa04ab1f4a38ef2a8172b9cd78a7b0922c468b2e
parent464e5807ebc606a902ffb36c52101cbc6f0cea30
xfs: create a separate cow extent size hint for the allocator

Source kernel commit: f7ca35227253dc8244fd908140b06010e67a31e5

Create a per-inode extent size allocator hint for copy-on-write.  This
hint is separate from the existing extent size hint so that CoW can
take advantage of the fragmentation-reducing properties of extent size
hints without disabling delalloc for regular writes.

The extent size hint that's fed to the allocator during a copy on
write operation is the greater of the cowextsize and regular extsize
hint.

During reflink, if we're sharing the entire source file to the entire
destination file and the destination file doesn't already have a
cowextsize hint, propagate the source file's cowextsize hint to the
destination file.

Furthermore, zero the bulkstat buffer prior to setting the fields
so that we don't copy kernel memory contents into userspace.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
libxfs/libxfs_priv.h
libxfs/xfs_bmap.c
libxfs/xfs_format.h
libxfs/xfs_fs.h
libxfs/xfs_inode_buf.c
libxfs/xfs_inode_buf.h
libxfs/xfs_log_format.h