From: Nikolay Borisov <nborisov@suse.com>
To: linux-btrfs@vger.kernel.org
Cc: Nikolay Borisov <nborisov@suse.com>
Subject: [PATCH 1/5] btrfs: Re-arrange statements in setup_items_for_insert
Date: Tue, 1 Sep 2020 17:39:57 +0300 [thread overview]
Message-ID: <20200901144001.4265-2-nborisov@suse.com> (raw)
In-Reply-To: <20200901144001.4265-1-nborisov@suse.com>
Rearrange statements calculating the offset of the newly added items so
that the calculation has to be done only once. No functional change.
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
fs/btrfs/ctree.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
index 31e356240fce..0f325aaa5c1c 100644
--- a/fs/btrfs/ctree.c
+++ b/fs/btrfs/ctree.c
@@ -4823,8 +4823,8 @@ void setup_items_for_insert(struct btrfs_root *root, struct btrfs_path *path,
btrfs_cpu_key_to_disk(&disk_key, cpu_key + i);
btrfs_set_item_key(leaf, &disk_key, slot + i);
item = btrfs_item_nr(slot + i);
- btrfs_set_token_item_offset(&token, item, data_end - data_size[i]);
data_end -= data_size[i];
+ btrfs_set_token_item_offset(&token, item, data_end);
btrfs_set_token_item_size(&token, item, data_size[i]);
}
--
2.17.1
next prev parent reply other threads:[~2020-09-01 14:40 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-01 14:39 [PATCH 0/5] Improve setup_items_for_insert Nikolay Borisov
2020-09-01 14:39 ` Nikolay Borisov [this message]
2020-09-01 19:13 ` [PATCH 1/5] btrfs: Re-arrange statements in setup_items_for_insert Josef Bacik
2020-09-01 14:39 ` [PATCH 2/5] btrfs: Eliminate total_size parameter from setup_items_for_insert Nikolay Borisov
2020-09-01 19:18 ` Josef Bacik
2020-09-01 14:39 ` [PATCH 3/5] btrfs: Sink total_data parameter in setup_items_for_insert Nikolay Borisov
2020-09-01 19:21 ` Josef Bacik
2020-09-01 14:40 ` [PATCH 4/5] btrfs: Add kerneldoc for setup_items_for_insert Nikolay Borisov
2020-09-01 19:22 ` Josef Bacik
2020-09-01 14:40 ` [PATCH 5/5] btrfs: improve error message in setup_items_for_insert Nikolay Borisov
2020-09-01 19:23 ` Josef Bacik
2020-09-10 16:14 ` David Sterba
2020-09-11 14:50 ` David Sterba
2020-09-02 10:39 ` [PATCH 0/5] Improve setup_items_for_insert Johannes Thumshirn
2020-09-10 16:16 ` David Sterba
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=20200901144001.4265-2-nborisov@suse.com \
--to=nborisov@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