@@ -5154,6 +5154,14 @@ fuse_init(xlator_t *this, fuse_in_header_t *finh, void *msg,
5154
5154
fino .max_readahead = 1 << 17 ;
5155
5155
fino .max_write = 1 << 17 ;
5156
5156
fino .flags = FUSE_ASYNC_READ | FUSE_POSIX_LOCKS ;
5157
+ #if FUSE_KERNEL_MINOR_VERSION >= 28
5158
+ if (fini -> minor >= 28 ) {
5159
+ fino .max_write = priv -> fuse_max_write ;
5160
+ fino .max_pages = priv -> fuse_max_write / sysconf (_SC_PAGESIZE );
5161
+ if (fino .max_pages == FUSE_MAX_MAX_PAGES )
5162
+ fino .flags |= FUSE_MAX_PAGES ;
5163
+ }
5164
+ #endif
5157
5165
#if FUSE_KERNEL_MINOR_VERSION >= 17
5158
5166
if (fini -> minor >= 17 )
5159
5167
fino .flags |= FUSE_FLOCK_LOCKS ;
@@ -6090,14 +6098,12 @@ fuse_thread_proc(void *data)
6090
6098
struct pollfd pfd [2 ] = {{
6091
6099
0 ,
6092
6100
}};
6093
- uint32_t psize ;
6094
6101
6095
6102
this = data ;
6096
6103
priv = this -> private ;
6097
6104
6098
6105
THIS = this ;
6099
6106
6100
- psize = ((struct iobuf_pool * )this -> ctx -> iobuf_pool )-> default_page_size ;
6101
6107
priv -> msg0_len_p = & msg0_size ;
6102
6108
6103
6109
for (;;) {
@@ -6153,7 +6159,7 @@ fuse_thread_proc(void *data)
6153
6159
size from 'fuse', which is as of today 128KB. If we bring in
6154
6160
support for higher block sizes support, then we should be
6155
6161
changing this one too */
6156
- iobuf = iobuf_get (this -> ctx -> iobuf_pool );
6162
+ iobuf = iobuf_get2 (this -> ctx -> iobuf_pool , priv -> fuse_max_write );
6157
6163
6158
6164
/* Add extra 512 byte to the first iov so that it can
6159
6165
* accommodate "ordinary" non-write requests. It's not
@@ -6177,7 +6183,7 @@ fuse_thread_proc(void *data)
6177
6183
iov_in [1 ].iov_base = iobuf -> ptr ;
6178
6184
6179
6185
iov_in [0 ].iov_len = msg0_size ;
6180
- iov_in [1 ].iov_len = psize ;
6186
+ iov_in [1 ].iov_len = priv -> fuse_max_write ;
6181
6187
6182
6188
res = sys_readv (priv -> fd , iov_in , 2 );
6183
6189
@@ -6910,6 +6916,9 @@ init(xlator_t *this_xl)
6910
6916
GF_OPTION_INIT ("fuse-dev-eperm-ratelimit-ns" ,
6911
6917
priv -> fuse_dev_eperm_ratelimit_ns , uint32 , cleanup_exit );
6912
6918
6919
+ GF_OPTION_INIT ("fuse-max-write" , priv -> fuse_max_write , uint32 ,
6920
+ cleanup_exit );
6921
+
6913
6922
/* user has set only background-qlen, not congestion-threshold,
6914
6923
use the fuse kernel driver formula to set congestion. ie, 75% */
6915
6924
if (dict_get (this_xl -> options , "background-qlen" ) &&
@@ -7198,6 +7207,14 @@ struct volume_options options[] = {
7198
7207
.max = 64 ,
7199
7208
.description = "Sets fuse reader thread count." ,
7200
7209
},
7210
+ {
7211
+ .key = {"fuse-max-write" },
7212
+ .type = GF_OPTION_TYPE_INT ,
7213
+ .default_value = "131072" ,
7214
+ .min = 4096 ,
7215
+ .max = 1048576 ,
7216
+ .description = "Sets fuse max-write bytes." ,
7217
+ },
7201
7218
{
7202
7219
.key = {"kernel-writeback-cache" },
7203
7220
.type = GF_OPTION_TYPE_BOOL ,
0 commit comments