fuse/fuse-2.9.7-buffer-size.patch
2018-11-09 12:03:33 +01:00

25 lines
896 B
Diff

diff -up libfuse-fuse-2.9.7/lib/fuse_kern_chan.c.buffer_size libfuse-fuse-2.9.7/lib/fuse_kern_chan.c
--- libfuse-fuse-2.9.7/lib/fuse_kern_chan.c.buffer_size 2016-06-20 21:55:12.000000000 +0200
+++ libfuse-fuse-2.9.7/lib/fuse_kern_chan.c 2018-11-09 11:58:18.942124327 +0100
@@ -83,7 +83,10 @@ static void fuse_kern_chan_destroy(struc
close(fd);
}
-#define MIN_BUFSIZE 0x21000
+#define KERNEL_BUF_PAGES 32
+
+/* room needed in buffer to accommodate header */
+#define HEADER_SIZE 0x1000
struct fuse_chan *fuse_kern_chan_new(int fd)
{
@@ -92,7 +95,6 @@ struct fuse_chan *fuse_kern_chan_new(int
.send = fuse_kern_chan_send,
.destroy = fuse_kern_chan_destroy,
};
- size_t bufsize = getpagesize() + 0x1000;
- bufsize = bufsize < MIN_BUFSIZE ? MIN_BUFSIZE : bufsize;
+ size_t bufsize = KERNEL_BUF_PAGES * getpagesize() + HEADER_SIZE;
return fuse_chan_new(&op, fd, bufsize, NULL);
}