* [PATCH] iomap: Minor code simplification in iomap_dio_bio_iter()
@ 2025-02-24 15:45 John Garry
2025-02-24 20:39 ` Darrick J. Wong
2025-02-25 10:55 ` Christian Brauner
0 siblings, 2 replies; 3+ messages in thread
From: John Garry @ 2025-02-24 15:45 UTC (permalink / raw)
To: brauner, djwong; +Cc: linux-xfs, linux-fsdevel, linux-kernel, John Garry
Combine 'else' and 'if' conditional statements onto a single line and drop
unrequired braces, as is standard coding style.
The code had been like this since commit c3b0e880bbfa ("iomap: support
REQ_OP_ZONE_APPEND").
Signed-off-by: John Garry <john.g.garry@oracle.com>
diff --git a/fs/iomap/direct-io.c b/fs/iomap/direct-io.c
index 138d246ec29d..cdcd5ff399c1 100644
--- a/fs/iomap/direct-io.c
+++ b/fs/iomap/direct-io.c
@@ -473,12 +473,10 @@ static loff_t iomap_dio_bio_iter(const struct iomap_iter *iter,
bio_put(bio);
goto zero_tail;
}
- if (dio->flags & IOMAP_DIO_WRITE) {
+ if (dio->flags & IOMAP_DIO_WRITE)
task_io_account_write(n);
- } else {
- if (dio->flags & IOMAP_DIO_DIRTY)
- bio_set_pages_dirty(bio);
- }
+ else if (dio->flags & IOMAP_DIO_DIRTY)
+ bio_set_pages_dirty(bio);
dio->size += n;
copied += n;
--
2.31.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] iomap: Minor code simplification in iomap_dio_bio_iter()
2025-02-24 15:45 [PATCH] iomap: Minor code simplification in iomap_dio_bio_iter() John Garry
@ 2025-02-24 20:39 ` Darrick J. Wong
2025-02-25 10:55 ` Christian Brauner
1 sibling, 0 replies; 3+ messages in thread
From: Darrick J. Wong @ 2025-02-24 20:39 UTC (permalink / raw)
To: John Garry; +Cc: brauner, linux-xfs, linux-fsdevel, linux-kernel
On Mon, Feb 24, 2025 at 03:45:38PM +0000, John Garry wrote:
> Combine 'else' and 'if' conditional statements onto a single line and drop
> unrequired braces, as is standard coding style.
>
> The code had been like this since commit c3b0e880bbfa ("iomap: support
> REQ_OP_ZONE_APPEND").
>
> Signed-off-by: John Garry <john.g.garry@oracle.com>
Looks fine to me,
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
--D
>
> diff --git a/fs/iomap/direct-io.c b/fs/iomap/direct-io.c
> index 138d246ec29d..cdcd5ff399c1 100644
> --- a/fs/iomap/direct-io.c
> +++ b/fs/iomap/direct-io.c
> @@ -473,12 +473,10 @@ static loff_t iomap_dio_bio_iter(const struct iomap_iter *iter,
> bio_put(bio);
> goto zero_tail;
> }
> - if (dio->flags & IOMAP_DIO_WRITE) {
> + if (dio->flags & IOMAP_DIO_WRITE)
> task_io_account_write(n);
> - } else {
> - if (dio->flags & IOMAP_DIO_DIRTY)
> - bio_set_pages_dirty(bio);
> - }
> + else if (dio->flags & IOMAP_DIO_DIRTY)
> + bio_set_pages_dirty(bio);
>
> dio->size += n;
> copied += n;
> --
> 2.31.1
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] iomap: Minor code simplification in iomap_dio_bio_iter()
2025-02-24 15:45 [PATCH] iomap: Minor code simplification in iomap_dio_bio_iter() John Garry
2025-02-24 20:39 ` Darrick J. Wong
@ 2025-02-25 10:55 ` Christian Brauner
1 sibling, 0 replies; 3+ messages in thread
From: Christian Brauner @ 2025-02-25 10:55 UTC (permalink / raw)
To: djwong, John Garry
Cc: Christian Brauner, linux-xfs, linux-fsdevel, linux-kernel
On Mon, 24 Feb 2025 15:45:38 +0000, John Garry wrote:
> Combine 'else' and 'if' conditional statements onto a single line and drop
> unrequired braces, as is standard coding style.
>
> The code had been like this since commit c3b0e880bbfa ("iomap: support
> REQ_OP_ZONE_APPEND").
>
>
> [...]
Applied to the vfs.fixes branch of the vfs/vfs.git tree.
Patches in the vfs.fixes branch should appear in linux-next soon.
Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.
It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.
Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs.fixes
[1/1] iomap: Minor code simplification in iomap_dio_bio_iter()
https://git.kernel.org/vfs/vfs/c/b5799106b44e
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-02-25 10:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-24 15:45 [PATCH] iomap: Minor code simplification in iomap_dio_bio_iter() John Garry
2025-02-24 20:39 ` Darrick J. Wong
2025-02-25 10:55 ` Christian Brauner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox