Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ext4: fix the comment of ext4_map_blocks()/ext4_ext_map_blocks()

this comment of ext4_map_blocks()/ext4_ext_map_blocks() need
update after commit c21770573319("ext4: Define a new set of
flags for ext4_get_blocks()").

Signed-off-by: Cheng Nie <niecheng1@uniontech.com>
Link: https://lore.kernel.org/r/20240118062511.28276-1-niecheng1@uniontech.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>

authored by

Cheng Nie and committed by
Theodore Ts'o
547e64bd 4b55d343

+8 -8
+3 -3
fs/ext4/extents.c
··· 4111 4111 * 4112 4112 * Need to be called with 4113 4113 * down_read(&EXT4_I(inode)->i_data_sem) if not allocating file system block 4114 - * (ie, create is zero). Otherwise down_write(&EXT4_I(inode)->i_data_sem) 4114 + * (ie, flags is zero). Otherwise down_write(&EXT4_I(inode)->i_data_sem) 4115 4115 * 4116 4116 * return > 0, number of blocks already mapped/allocated 4117 - * if create == 0 and these are pre-allocated blocks 4117 + * if flags doesn't contain EXT4_GET_BLOCKS_CREATE and these are pre-allocated blocks 4118 4118 * buffer head is unmapped 4119 4119 * otherwise blocks are mapped 4120 4120 * ··· 4218 4218 4219 4219 /* 4220 4220 * requested block isn't allocated yet; 4221 - * we couldn't try to create block if create flag is zero 4221 + * we couldn't try to create block if flags doesn't contain EXT4_GET_BLOCKS_CREATE 4222 4222 */ 4223 4223 if ((flags & EXT4_GET_BLOCKS_CREATE) == 0) { 4224 4224 ext4_lblk_t len;
+5 -5
fs/ext4/inode.c
··· 465 465 * Otherwise, call with ext4_ind_map_blocks() to handle indirect mapping 466 466 * based files 467 467 * 468 - * On success, it returns the number of blocks being mapped or allocated. if 469 - * create==0 and the blocks are pre-allocated and unwritten, the resulting @map 470 - * is marked as unwritten. If the create == 1, it will mark @map as mapped. 468 + * On success, it returns the number of blocks being mapped or allocated. 469 + * If flags doesn't contain EXT4_GET_BLOCKS_CREATE the blocks are 470 + * pre-allocated and unwritten, the resulting @map is marked as unwritten. 471 + * If the flags contain EXT4_GET_BLOCKS_CREATE, it will mark @map as mapped. 471 472 * 472 473 * It returns 0 if plain look up failed (blocks have not been allocated), in 473 474 * that case, @map is returned as unmapped but we still do fill map->m_len to ··· 590 589 * Returns if the blocks have already allocated 591 590 * 592 591 * Note that if blocks have been preallocated 593 - * ext4_ext_get_block() returns the create = 0 594 - * with buffer head unmapped. 592 + * ext4_ext_map_blocks() returns with buffer head unmapped 595 593 */ 596 594 if (retval > 0 && map->m_flags & EXT4_MAP_MAPPED) 597 595 /*