mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 12:43:29 +02:00
btrfs: send add define for v2 buffer size
Add a define for the data buffer size (though the maximum size is not limited by it) BTRFS_SEND_BUF_SIZE_V2 so it's more visible. Signed-off-by: Wang Yugui <wangyugui@e16-tech.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
@@ -7901,7 +7901,7 @@ long btrfs_ioctl_send(struct inode *inode, struct btrfs_ioctl_send_args *arg)
|
|||||||
if (sctx->proto >= 2) {
|
if (sctx->proto >= 2) {
|
||||||
u32 send_buf_num_pages;
|
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);
|
sctx->send_buf = vmalloc(sctx->send_max_size);
|
||||||
if (!sctx->send_buf) {
|
if (!sctx->send_buf) {
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
|
@@ -18,10 +18,12 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* In send stream v1, no command is larger than 64K. In send stream v2, no limit
|
* In send stream v1, no command is larger than 64K. In send stream v2, no
|
||||||
* should be assumed.
|
* limit should be assumed, the buffer size is set to be a header with
|
||||||
|
* compressed extent size.
|
||||||
*/
|
*/
|
||||||
#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 inode;
|
||||||
struct btrfs_ioctl_send_args;
|
struct btrfs_ioctl_send_args;
|
||||||
|
Reference in New Issue
Block a user