btrfs: add macro BTRFS_SEND_BUF_SIZE_V2
PATCH 1/1 btrfs: add macro BTRFS_SEND_BUF_SIZE_V2
Add a macro BTRFS_SEND_BUF_SIZE_V2 and save it just after BTRFS_SEND_BUF_SIZE_V1.
This is a refactor without any function change.
Signed-off-by Wang Yugui <[email protected]>
--- fs/btrfs/send.c | 2 +- fs/btrfs/send.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-)
fs/btrfs/send.c +1 -1
@@ -7877,7 +7877,7 @@ long btrfs_ioctl_send(struct inode *inode, struct btrfs_ioctl_send_args *arg)if (sctx->proto >=2 ) {u32 send_buf_num_pages; - sctx->send_max_size =ALIGN (SZ_16K +BTRFS_MAX_COMPRESSED ,PAGE_SIZE ); + sctx->send_max_size =BTRFS_SEND_BUF_SIZE_V2 ; sctx->send_buf =vmalloc (sctx->send_max_size);if (!sctx->send_buf) { ret = -ENOMEM ;
fs/btrfs/send.h +2 -1
@@ -21,7 +21,8 @@* In send stream v1, no command is larger than 64K. In send stream v2, no limit * should be assumed. */ -#define BTRFS_SEND_BUF_SIZE_V1 SZ_64K +#define BTRFS_SEND_BUF_SIZE_V1 SZ_64K +#define BTRFS_SEND_BUF_SIZE_V2 ALIGN(SZ_16K + BTRFS_MAX_COMPRESSED, PAGE_SIZE)struct inode ;struct btrfs_ioctl_send_args ;
Signature · 1 line
2.36.2
Quoted 6 lines · Wang Yugui
Add a macro
BTRFS_SEND_BUF_SIZE_V2and save it just afterBTRFS_SEND_BUF_SIZE_V1.This is a refactor without any function change.
Signed-off-by Wang Yugui <[email protected]>
Added to misc-next, thanks.