]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: add in-memory iunlink log item
authorDave Chinner <dchinner@redhat.com>
Thu, 14 Jul 2022 01:47:42 +0000 (11:47 +1000)
committerDave Chinner <david@fromorbit.com>
Thu, 14 Jul 2022 01:47:42 +0000 (11:47 +1000)
commita31968997fcf7fea74fa70327848cc995234dfa1
tree48b06d793931162a0272160c918b9699784b1f3b
parent1c8fde45ba8d53b53a7ec5388e3571b467c4c005
xfs: add in-memory iunlink log item

Now that we have a clean operation to update the di_next_unlinked
field of inode cluster buffers, we can easily defer this operation
to transaction commit time so we can order the inode cluster buffer
locking consistently.

To do this, we introduce a new in-memory log item to track the
unlinked list item modification that we are going to make. This
follows the same observations as the in-memory double linked list
used to track unlinked inodes in that the inodes on the list are
pinned in memory and cannot go away, and hence we can simply
reference them for the duration of the transaction without needing
to take active references or pin them or look them up.

This allows us to pass the xfs_inode to the transaction commit code
along with the modification to be made, and then order the logged
modifications via the ->iop_sort and ->iop_precommit operations
for the new log item type. As this is an in-memory log item, it
doesn't have formatting, CIL or AIL operational hooks - it exists
purely to run the inode unlink modifications and is then removed
from the transaction item list and freed once the precommit
operation has run.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/xfs/Makefile
fs/xfs/xfs_inode.c
fs/xfs/xfs_iunlink_item.c [new file with mode: 0644]
fs/xfs/xfs_iunlink_item.h [new file with mode: 0644]
fs/xfs/xfs_super.c