]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
xfs: refactor buffer logging into buffer dirtying helper
authorBrian Foster <bfoster@redhat.com>
Sun, 17 Sep 2017 21:06:21 +0000 (14:06 -0700)
committerSeth Forshee <seth.forshee@canonical.com>
Wed, 20 Sep 2017 12:32:00 +0000 (07:32 -0500)
commit0845234f11a868fe31079342d6f08e7c5877609a
treec39dcbe50e03200a2cf28f9914baf855e9be34a5
parent409b30aa18086415c69112be084b067e828696e9
xfs: refactor buffer logging into buffer dirtying helper

BugLink: http://bugs.launchpad.net/bugs/1718412
commit 9684010d38eccda733b61106765e9357cf436f65 upstream.

xfs_trans_log_buf() is responsible for logging the dirty segments of
a buffer along with setting all of the necessary state on the
transaction, buffer, bli, etc., to ensure that the associated items
are marked as dirty and prepared for I/O. We have a couple use cases
that need to to dirty a buffer in a transaction without actually
logging dirty ranges of the buffer.  One existing use case is
ordered buffers, which are currently logged with arbitrary ranges to
accomplish this even though the content of ordered buffers is never
written to the log. Another pending use case is to relog an already
dirty buffer across rolled transactions within the deferred
operations infrastructure. This is required to prevent a held
(XFS_BLI_HOLD) buffer from pinning the tail of the log.

Refactor xfs_trans_log_buf() into a new function that contains all
of the logic responsible to dirty the transaction, lidp, buffer and
bli. This new function can be used in the future for the use cases
outlined above. This patch does not introduce functional changes.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
fs/xfs/xfs_trans.h
fs/xfs/xfs_trans_buf.c