summaryrefslogtreecommitdiffstats
path: root/fs/ext4/ext4.h
diff options
context:
space:
mode:
authorZhang Yi <yi.zhang@huawei.com>2022-04-24 22:09:35 +0800
committerTheodore Ts'o <tytso@mit.edu>2022-05-17 14:17:40 -0400
commit9558cf14e8d2149a8df402b74041a99835801932 (patch)
tree248126608f619ff1c351c3c048560cfcd1ecc979 /fs/ext4/ext4.h
parente4e58e5df309d695799c494958962100a4c25039 (diff)
downloadlinux-stable-9558cf14e8d2149a8df402b74041a99835801932.tar.gz
linux-stable-9558cf14e8d2149a8df402b74041a99835801932.tar.bz2
linux-stable-9558cf14e8d2149a8df402b74041a99835801932.zip
ext4: add nowait mode for ext4_getblk()
Current ext4_getblk() might sleep if some resources are not valid or could be race with a concurrent extents modifing procedure. So we cannot call ext4_getblk() and ext4_map_blocks() to get map blocks in the atomic context in some fast path (e.g. the upcoming procedure of getting symlink external block in the RCU context), even if the map extents have already been check and cached. Signed-off-by: Zhang Yi <yi.zhang@huawei.com> Link: https://lore.kernel.org/r/20220424140936.1898920-2-yi.zhang@huawei.com
Diffstat (limited to 'fs/ext4/ext4.h')
-rw-r--r--fs/ext4/ext4.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index a743b1e3b89e..797bc572d6fb 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -673,6 +673,8 @@ enum {
/* Caller will submit data before dropping transaction handle. This
* allows jbd2 to avoid submitting data before commit. */
#define EXT4_GET_BLOCKS_IO_SUBMIT 0x0400
+ /* Caller is in the atomic contex, find extent if it has been cached */
+#define EXT4_GET_BLOCKS_CACHED_NOWAIT 0x0800
/*
* The bit position of these flags must not overlap with any of the