Skip to contentSkip to conversation

btrfs: add macro BTRFS_SEND_BUF_SIZE_V2

PATCH In review Wang Yugui 2 participants 2 messages Oct 19, 2022 Btrfs file system

lore
Share & tools
lore

Wang Yugui

author
#0 lore raw

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.

---
 fs/btrfs/send.c | 2 +-
 fs/btrfs/send.h | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)
fs/btrfs/send.c +1 -1
index ec6e1752af2c..d7eabff2c0b7 100644
@@ -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
index f7585cfa7e52..22f055256408 100644
@@ -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
#1 lore raw
Quoted 6 lines · Wang Yugui

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.

Added to misc-next, thanks.