diff options
author | Zhang Yi <yi.zhang@huawei.com> | 2024-01-27 02:58:04 +0100 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2024-02-02 05:59:21 +0100 |
commit | 874eaba96d39334fe9c729ff631e65523616d4d8 (patch) | |
tree | 401e4a6a4340ae92b68473fb2f02a34a63f5829f /fs/ext4/inode.c | |
parent | ext4: add a hole extent entry in cache after punch (diff) | |
download | linux-874eaba96d39334fe9c729ff631e65523616d4d8.tar.xz linux-874eaba96d39334fe9c729ff631e65523616d4d8.zip |
ext4: make ext4_map_blocks() distinguish delalloc only extent
Add a new map flag EXT4_MAP_DELAYED to indicate the mapping range is a
delayed allocated only (not unwritten) one, and making
ext4_map_blocks() can distinguish it, no longer mixing it with holes.
Signed-off-by: Zhang Yi <yi.zhang@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20240127015825.1608160-6-yi.zhang@huaweicloud.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/inode.c')
-rw-r--r-- | fs/ext4/inode.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index af205b416794..60f0d2dc1c37 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -515,6 +515,8 @@ int ext4_map_blocks(handle_t *handle, struct inode *inode, map->m_len = retval; } else if (ext4_es_is_delayed(&es) || ext4_es_is_hole(&es)) { map->m_pblk = 0; + map->m_flags |= ext4_es_is_delayed(&es) ? + EXT4_MAP_DELAYED : 0; retval = es.es_len - (map->m_lblk - es.es_lblk); if (retval > map->m_len) retval = map->m_len; |