* [PATCH] ext4: fix the comment of ext4_map_blocks()/ext4_ext_map_blocks()
@ 2024-01-18 6:25 Cheng Nie
2024-02-22 15:54 ` Theodore Ts'o
0 siblings, 1 reply; 2+ messages in thread
From: Cheng Nie @ 2024-01-18 6:25 UTC (permalink / raw
To: tytso, adilger.kernel; +Cc: linux-ext4, linux-kernel, Cheng Nie
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>
---
fs/ext4/extents.c | 6 +++---
fs/ext4/inode.c | 10 +++++-----
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 01299b55a567..bb8fd760cc3c 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -4069,10 +4069,10 @@ static int get_implied_cluster_alloc(struct super_block *sb,
*
* Need to be called with
* down_read(&EXT4_I(inode)->i_data_sem) if not allocating file system block
- * (ie, create is zero). Otherwise down_write(&EXT4_I(inode)->i_data_sem)
+ * (ie, flags is zero). Otherwise down_write(&EXT4_I(inode)->i_data_sem)
*
* return > 0, number of blocks already mapped/allocated
- * if create == 0 and these are pre-allocated blocks
+ * if flags doesn't contain EXT4_GET_BLOCKS_CREATE and these are pre-allocated blocks
* buffer head is unmapped
* otherwise blocks are mapped
*
@@ -4176,7 +4176,7 @@ int ext4_ext_map_blocks(handle_t *handle, struct inode *inode,
/*
* requested block isn't allocated yet;
- * we couldn't try to create block if create flag is zero
+ * we couldn't try to create block if flags doesn't contain EXT4_GET_BLOCKS_CREATE
*/
if ((flags & EXT4_GET_BLOCKS_CREATE) == 0) {
ext4_lblk_t hole_start, hole_len;
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 5af1b0b8680e..89f0949ebcae 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -465,9 +465,10 @@ static void ext4_map_blocks_es_recheck(handle_t *handle,
* Otherwise, call with ext4_ind_map_blocks() to handle indirect mapping
* based files
*
- * On success, it returns the number of blocks being mapped or allocated. if
- * create==0 and the blocks are pre-allocated and unwritten, the resulting @map
- * is marked as unwritten. If the create == 1, it will mark @map as mapped.
+ * On success, it returns the number of blocks being mapped or allocated.
+ * If flags doesn't contain EXT4_GET_BLOCKS_CREATE the blocks are
+ * pre-allocated and unwritten, the resulting @map is marked as unwritten.
+ * If the flags contain EXT4_GET_BLOCKS_CREATE, it will mark @map as mapped.
*
* It returns 0 if plain look up failed (blocks have not been allocated), in
* that case, @map is returned as unmapped but we still do fill map->m_len to
@@ -587,8 +588,7 @@ int ext4_map_blocks(handle_t *handle, struct inode *inode,
* Returns if the blocks have already allocated
*
* Note that if blocks have been preallocated
- * ext4_ext_get_block() returns the create = 0
- * with buffer head unmapped.
+ * ext4_ext_map_blocks() returns with buffer head unmapped
*/
if (retval > 0 && map->m_flags & EXT4_MAP_MAPPED)
/*
--
2.20.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ext4: fix the comment of ext4_map_blocks()/ext4_ext_map_blocks()
2024-01-18 6:25 [PATCH] ext4: fix the comment of ext4_map_blocks()/ext4_ext_map_blocks() Cheng Nie
@ 2024-02-22 15:54 ` Theodore Ts'o
0 siblings, 0 replies; 2+ messages in thread
From: Theodore Ts'o @ 2024-02-22 15:54 UTC (permalink / raw
To: adilger.kernel, Cheng Nie; +Cc: Theodore Ts'o, linux-ext4, linux-kernel
On Thu, 18 Jan 2024 14:25:11 +0800, Cheng Nie wrote:
> 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()").
>
>
Applied, thanks!
[1/1] ext4: fix the comment of ext4_map_blocks()/ext4_ext_map_blocks()
commit: 547e64bda9c7bd6bda2d20a329bb0f60258fe19b
Best regards,
--
Theodore Ts'o <tytso@mit.edu>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-02-22 15:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-18 6:25 [PATCH] ext4: fix the comment of ext4_map_blocks()/ext4_ext_map_blocks() Cheng Nie
2024-02-22 15:54 ` Theodore Ts'o
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).