summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilipe Manana <fdmanana@suse.com>2024-09-19 13:32:06 +0300
committerDavid Sterba <dsterba@suse.com>2025-03-18 22:35:44 +0300
commit75dfc5d0cabb9dfb071583e1e30facee6a113227 (patch)
tree17a2703e4d44d895cbb8bacd91fbdc0a4745c7b5
parenta4bb776cbe4ce8ad5f71667a75d1a5bef53f399f (diff)
downloadlinux-75dfc5d0cabb9dfb071583e1e30facee6a113227.tar.xz
btrfs: send: remove duplicated logic from fs_path_reset()
There's duplicated logic in both branches of the if statement, so move it outside the branches. This also reduces the object code size. Before this change: $ size fs/btrfs/btrfs.ko text data bss dec hex filename 1746279 163600 16920 1926799 1d668f fs/btrfs/btrfs.ko After this change: $ size fs/btrfs/btrfs.ko text data bss dec hex filename 1746047 163592 16920 1926559 1d659f fs/btrfs/btrfs.ko Signed-off-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r--fs/btrfs/send.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c
index d513f7fd5fe8..8de561fb1390 100644
--- a/fs/btrfs/send.c
+++ b/fs/btrfs/send.c
@@ -424,15 +424,13 @@ static int need_send_hole(struct send_ctx *sctx)
static void fs_path_reset(struct fs_path *p)
{
- if (p->reversed) {
+ if (p->reversed)
p->start = p->buf + p->buf_len - 1;
- p->end = p->start;
- *p->start = 0;
- } else {
+ else
p->start = p->buf;
- p->end = p->start;
- *p->start = 0;
- }
+
+ p->end = p->start;
+ *p->start = 0;
}
static struct fs_path *fs_path_alloc(void)