From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: David Sterba <dsterba@suse.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 02/10] btrfs: remove uptodate parameter from btrfs_dec_test_first_ordered_pending
Date: Mon, 26 Jul 2021 20:24:38 +0800 [thread overview]
Message-ID: <18e1ac39-480e-7d2c-0dbd-dd35dd55baf8@gmx.com> (raw)
In-Reply-To: <2b01784d09b77a3209dda4284887271e1f8d434b.1627300614.git.dsterba@suse.com>
On 2021/7/26 下午8:15, David Sterba wrote:
> In commit e65f152e4348 ("btrfs: refactor how we finish ordered extent io
> for endio functions") there was last caller not using 1 for the uptodate
> parameter. Now there's only one, passing 1, so we can remove it and
> simplify the code.
I should have noticed that...
>
> Signed-off-by: David Sterba <dsterba@suse.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Thanks,
Qu
> ---
> fs/btrfs/inode.c | 2 +-
> fs/btrfs/ordered-data.c | 5 +----
> fs/btrfs/ordered-data.h | 2 +-
> 3 files changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
> index 43b1393eec67..ba0bba9f5505 100644
> --- a/fs/btrfs/inode.c
> +++ b/fs/btrfs/inode.c
> @@ -8554,7 +8554,7 @@ static void btrfs_invalidatepage(struct page *page, unsigned int offset,
> spin_unlock_irq(&inode->ordered_tree.lock);
>
> if (btrfs_dec_test_ordered_pending(inode, &ordered,
> - cur, range_end + 1 - cur, 1)) {
> + cur, range_end + 1 - cur)) {
> btrfs_finish_ordered_io(ordered);
> /*
> * The ordered extent has finished, now we're again
> diff --git a/fs/btrfs/ordered-data.c b/fs/btrfs/ordered-data.c
> index 5c0f8481e25e..edb65abf0393 100644
> --- a/fs/btrfs/ordered-data.c
> +++ b/fs/btrfs/ordered-data.c
> @@ -446,7 +446,6 @@ void btrfs_mark_ordered_io_finished(struct btrfs_inode *inode,
> * Will be also used to store the finished ordered extent.
> * @file_offset: File offset for the finished IO
> * @io_size: Length of the finish IO range
> - * @uptodate: If the IO finishes without problem
> *
> * Return true if the ordered extent is finished in the range, and update
> * @cached.
> @@ -457,7 +456,7 @@ void btrfs_mark_ordered_io_finished(struct btrfs_inode *inode,
> */
> bool btrfs_dec_test_ordered_pending(struct btrfs_inode *inode,
> struct btrfs_ordered_extent **cached,
> - u64 file_offset, u64 io_size, int uptodate)
> + u64 file_offset, u64 io_size)
> {
> struct btrfs_ordered_inode_tree *tree = &inode->ordered_tree;
> struct rb_node *node;
> @@ -486,8 +485,6 @@ bool btrfs_dec_test_ordered_pending(struct btrfs_inode *inode,
> entry->bytes_left, io_size);
>
> entry->bytes_left -= io_size;
> - if (!uptodate)
> - set_bit(BTRFS_ORDERED_IOERR, &entry->flags);
>
> if (entry->bytes_left == 0) {
> /*
> diff --git a/fs/btrfs/ordered-data.h b/fs/btrfs/ordered-data.h
> index b2d88aba8420..4194e960ff61 100644
> --- a/fs/btrfs/ordered-data.h
> +++ b/fs/btrfs/ordered-data.h
> @@ -177,7 +177,7 @@ void btrfs_mark_ordered_io_finished(struct btrfs_inode *inode,
> bool uptodate);
> bool btrfs_dec_test_ordered_pending(struct btrfs_inode *inode,
> struct btrfs_ordered_extent **cached,
> - u64 file_offset, u64 io_size, int uptodate);
> + u64 file_offset, u64 io_size);
> int btrfs_add_ordered_extent(struct btrfs_inode *inode, u64 file_offset,
> u64 disk_bytenr, u64 num_bytes, u64 disk_num_bytes,
> int type);
>
next prev parent reply other threads:[~2021-07-26 12:24 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-26 12:15 [PATCH 00/10] Misc small cleanups David Sterba
2021-07-26 12:15 ` [PATCH 01/10] btrfs: switch uptodate to bool in btrfs_writepage_endio_finish_ordered David Sterba
2021-07-26 12:23 ` Qu Wenruo
2021-07-26 12:15 ` [PATCH 02/10] btrfs: remove uptodate parameter from btrfs_dec_test_first_ordered_pending David Sterba
2021-07-26 12:24 ` Qu Wenruo [this message]
2021-07-26 12:15 ` [PATCH 03/10] btrfs: make btrfs_next_leaf static inline David Sterba
2021-07-26 12:25 ` Qu Wenruo
2021-07-26 12:15 ` [PATCH 04/10] btrfs: tree-checker: use table values for stripe checks David Sterba
2021-07-26 12:29 ` Qu Wenruo
2021-07-26 14:47 ` David Sterba
2021-07-26 12:15 ` [PATCH 05/10] btrfs: tree-checker: add missing stripe checks for raid1c3/4 profiles David Sterba
2021-07-26 12:29 ` Qu Wenruo
2021-07-26 12:15 ` [PATCH 06/10] btrfs: uninline btrfs_bg_flags_to_raid_index David Sterba
2021-07-26 12:34 ` Qu Wenruo
2021-07-26 15:06 ` David Sterba
2021-07-26 12:15 ` [PATCH 07/10] btrfs: merge alloc_device helpers David Sterba
2021-07-26 12:35 ` Qu Wenruo
2021-07-26 12:15 ` [PATCH 08/10] btrfs: simplify data stripe calculation helpers David Sterba
2021-07-26 12:38 ` Qu Wenruo
2021-07-26 15:06 ` David Sterba
2021-07-26 22:23 ` Qu Wenruo
2021-07-27 8:39 ` David Sterba
2021-07-27 9:32 ` Qu Wenruo
2021-07-26 12:15 ` [PATCH 09/10] btrfs: constify and cleanup variables comparators David Sterba
2021-07-26 12:15 ` [PATCH 10/10] btrfs: add and use simple page/bio to inode/fs_info helpers David Sterba
2021-07-26 12:41 ` Qu Wenruo
2021-07-26 15:09 ` David Sterba
2021-07-26 22:26 ` Qu Wenruo
2021-07-27 8:45 ` David Sterba
2021-07-27 9:42 ` Qu Wenruo
2021-07-27 14:44 ` David Sterba
2021-07-27 15:03 ` [PATCH v2 " David Sterba
2021-07-28 0:12 ` Qu Wenruo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=18e1ac39-480e-7d2c-0dbd-dd35dd55baf8@gmx.com \
--to=quwenruo.btrfs@gmx.com \
--cc=dsterba@suse.com \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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 NNTP newsgroup(s).