Commit 482a626
Brian Foster
iomap: move folio_unlock out of iomap_writeback_folio
JIRA: https://issues.redhat.com/browse/RHEL-121230
commit f8b6a94
Author: Joanne Koong <joannelkoong@gmail.com>
Date: Thu Jul 10 15:33:33 2025 +0200
iomap: move folio_unlock out of iomap_writeback_folio
Move unlocking the folio out of iomap_writeback_folio into the caller.
This means the end writeback machinery is now run with the folio locked
when no writeback happened, or writeback completed extremely fast.
Note that having the folio locked over the call to folio_end_writeback in
iomap_writeback_folio means that the dropbehind handling there will never
run because the trylock fails. The only way this can happen is if the
writepage either never wrote back any dirty data at all, in which case
the dropbehind handling isn't needed, or if all writeback finished
instantly, which is rather unlikely. Even in the latter case the
dropbehind handling is an optional optimization so skipping it will not
cause correctness issues.
This prepares for exporting iomap_writeback_folio for use in folio
laundering.
Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
[hch: split from a larger patch]
Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/20250710133343.399917-10-hch@lst.de
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Brian Foster <bfoster@redhat.com>1 parent 9ae0f92 commit 482a626
1 file changed
+4
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1651 | 1651 | | |
1652 | 1652 | | |
1653 | 1653 | | |
1654 | | - | |
1655 | | - | |
| 1654 | + | |
1656 | 1655 | | |
1657 | | - | |
1658 | 1656 | | |
1659 | 1657 | | |
1660 | 1658 | | |
| |||
1708 | 1706 | | |
1709 | 1707 | | |
1710 | 1708 | | |
1711 | | - | |
1712 | 1709 | | |
1713 | 1710 | | |
1714 | 1711 | | |
| |||
1735 | 1732 | | |
1736 | 1733 | | |
1737 | 1734 | | |
1738 | | - | |
| 1735 | + | |
1739 | 1736 | | |
| 1737 | + | |
| 1738 | + | |
1740 | 1739 | | |
1741 | 1740 | | |
1742 | 1741 | | |
| |||
0 commit comments