diff options
author | John Garry <john.g.garry@oracle.com> | 2024-11-04 16:14:02 -0800 |
---|---|---|
committer | Darrick J. Wong <djwong@djwong.org> | 2024-11-04 16:14:02 -0800 |
commit | 9e0933c21c128d6d8ac4d8aae0babaf9a43100b8 (patch) | |
tree | f3a3326ccb80dac6d4049ae3445e24abd6ddb8cc /Documentation | |
parent | a570bad16b9f5252db2f342622bd71febb39a19c (diff) | |
download | linux-stable-9e0933c21c128d6d8ac4d8aae0babaf9a43100b8.tar.gz linux-stable-9e0933c21c128d6d8ac4d8aae0babaf9a43100b8.tar.bz2 linux-stable-9e0933c21c128d6d8ac4d8aae0babaf9a43100b8.zip |
fs: iomap: Atomic write support
Support direct I/O atomic writes by producing a single bio with REQ_ATOMIC
flag set.
Initially FSes (XFS) should only support writing a single FS block
atomically.
As with any atomic write, we should produce a single bio which covers the
complete write length.
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Signed-off-by: John Garry <john.g.garry@oracle.com>
Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
[djwong: clarify a couple of things in the docs]
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/filesystems/iomap/operations.rst | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Documentation/filesystems/iomap/operations.rst b/Documentation/filesystems/iomap/operations.rst index 8e6c721d2330..ee790f843cfa 100644 --- a/Documentation/filesystems/iomap/operations.rst +++ b/Documentation/filesystems/iomap/operations.rst @@ -513,6 +513,21 @@ IOMAP_WRITE`` with any combination of the following enhancements: if the mapping is unwritten and the filesystem cannot handle zeroing the unaligned regions without exposing stale contents. + * ``IOMAP_ATOMIC``: This write is being issued with torn-write + protection. + Only a single bio can be created for the write, and the write must + not be split into multiple I/O requests, i.e. flag REQ_ATOMIC must be + set. + The file range to write must be aligned to satisfy the requirements + of both the filesystem and the underlying block device's atomic + commit capabilities. + If filesystem metadata updates are required (e.g. unwritten extent + conversion or copy on write), all updates for the entire file range + must be committed atomically as well. + Only one space mapping is allowed per untorn write. + Untorn writes must be aligned to, and must not be longer than, a + single file block. + Callers commonly hold ``i_rwsem`` in shared or exclusive mode before calling this function. |