Commit da8c7fec authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jaegeuk Kim

f2fs: rename F2FS_MAP_UNWRITTEN to F2FS_MAP_DELALLOC

NEW_ADDR blocks are purely in-memory preallocated blocks, and thus
equivalent to what the core FS code calls delayed allocations, and not
unwritten extents which do have on-disk blocks allocated from which
reads always return zeroes until they are converted to written status.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarChao Yu <chao@kernel.org>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 62a134bd
...@@ -1660,9 +1660,9 @@ int f2fs_map_blocks(struct inode *inode, struct f2fs_map_blocks *map, ...@@ -1660,9 +1660,9 @@ int f2fs_map_blocks(struct inode *inode, struct f2fs_map_blocks *map,
bidx = f2fs_target_device_index(sbi, blkaddr); bidx = f2fs_target_device_index(sbi, blkaddr);
if (map->m_len == 0) { if (map->m_len == 0) {
/* preallocated unwritten block should be mapped for fiemap. */ /* reserved delalloc block should be mapped for fiemap. */
if (blkaddr == NEW_ADDR) if (blkaddr == NEW_ADDR)
map->m_flags |= F2FS_MAP_UNWRITTEN; map->m_flags |= F2FS_MAP_DELALLOC;
map->m_flags |= F2FS_MAP_MAPPED; map->m_flags |= F2FS_MAP_MAPPED;
map->m_pblk = blkaddr; map->m_pblk = blkaddr;
...@@ -1984,7 +1984,7 @@ int f2fs_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, ...@@ -1984,7 +1984,7 @@ int f2fs_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
compr_appended = false; compr_appended = false;
/* In a case of compressed cluster, append this to the last extent */ /* In a case of compressed cluster, append this to the last extent */
if (compr_cluster && ((map.m_flags & F2FS_MAP_UNWRITTEN) || if (compr_cluster && ((map.m_flags & F2FS_MAP_DELALLOC) ||
!(map.m_flags & F2FS_MAP_FLAGS))) { !(map.m_flags & F2FS_MAP_FLAGS))) {
compr_appended = true; compr_appended = true;
goto skip_fill; goto skip_fill;
...@@ -2030,7 +2030,7 @@ int f2fs_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, ...@@ -2030,7 +2030,7 @@ int f2fs_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
compr_cluster = false; compr_cluster = false;
size += blks_to_bytes(inode, 1); size += blks_to_bytes(inode, 1);
} }
} else if (map.m_flags & F2FS_MAP_UNWRITTEN) { } else if (map.m_flags & F2FS_MAP_DELALLOC) {
flags = FIEMAP_EXTENT_UNWRITTEN; flags = FIEMAP_EXTENT_UNWRITTEN;
} }
......
...@@ -696,9 +696,9 @@ struct extent_tree_info { ...@@ -696,9 +696,9 @@ struct extent_tree_info {
*/ */
#define F2FS_MAP_NEW (1U << 0) #define F2FS_MAP_NEW (1U << 0)
#define F2FS_MAP_MAPPED (1U << 1) #define F2FS_MAP_MAPPED (1U << 1)
#define F2FS_MAP_UNWRITTEN (1U << 2) #define F2FS_MAP_DELALLOC (1U << 2)
#define F2FS_MAP_FLAGS (F2FS_MAP_NEW | F2FS_MAP_MAPPED |\ #define F2FS_MAP_FLAGS (F2FS_MAP_NEW | F2FS_MAP_MAPPED |\
F2FS_MAP_UNWRITTEN) F2FS_MAP_DELALLOC)
struct f2fs_map_blocks { struct f2fs_map_blocks {
struct block_device *m_bdev; /* for multi-device dio */ struct block_device *m_bdev; /* for multi-device dio */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment