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>
This commit is contained in:
Filipe Manana
2024-09-19 11:32:06 +01:00
committed by David Sterba
parent a4bb776cbe
commit 75dfc5d0ca

View File

@@ -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)