aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fuse/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/fuse/inode.c')
-rw-r--r--fs/fuse/inode.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index f91ccc4a189d..9aa6f46d0c32 100644
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -32,6 +32,12 @@ DEFINE_MUTEX(fuse_mutex);
32 32
33#define FUSE_DEFAULT_BLKSIZE 512 33#define FUSE_DEFAULT_BLKSIZE 512
34 34
35/** Maximum number of outstanding background requests */
36#define FUSE_DEFAULT_MAX_BACKGROUND 12
37
38/** Congestion starts at 75% of maximum */
39#define FUSE_DEFAULT_CONGESTION_THRESHOLD (FUSE_DEFAULT_MAX_BACKGROUND * 3 / 4)
40
35struct fuse_mount_data { 41struct fuse_mount_data {
36 int fd; 42 int fd;
37 unsigned rootmode; 43 unsigned rootmode;
@@ -517,6 +523,8 @@ void fuse_conn_init(struct fuse_conn *fc)
517 INIT_LIST_HEAD(&fc->bg_queue); 523 INIT_LIST_HEAD(&fc->bg_queue);
518 INIT_LIST_HEAD(&fc->entry); 524 INIT_LIST_HEAD(&fc->entry);
519 atomic_set(&fc->num_waiting, 0); 525 atomic_set(&fc->num_waiting, 0);
526 fc->max_background = FUSE_DEFAULT_MAX_BACKGROUND;
527 fc->congestion_threshold = FUSE_DEFAULT_CONGESTION_THRESHOLD;
520 fc->khctr = 0; 528 fc->khctr = 0;
521 fc->polled_files = RB_ROOT; 529 fc->polled_files = RB_ROOT;
522 fc->reqctr = 0; 530 fc->reqctr = 0;
@@ -736,6 +744,12 @@ static void process_init_reply(struct fuse_conn *fc, struct fuse_req *req)
736 else { 744 else {
737 unsigned long ra_pages; 745 unsigned long ra_pages;
738 746
747 if (arg->minor >= 13) {
748 if (arg->max_background)
749 fc->max_background = arg->max_background;
750 if (arg->congestion_threshold)
751 fc->congestion_threshold = arg->congestion_threshold;
752 }
739 if (arg->minor >= 6) { 753 if (arg->minor >= 6) {
740 ra_pages = arg->max_readahead / PAGE_CACHE_SIZE; 754 ra_pages = arg->max_readahead / PAGE_CACHE_SIZE;
741 if (arg->flags & FUSE_ASYNC_READ) 755 if (arg->flags & FUSE_ASYNC_READ)