diff options
-rw-r--r-- | fs/fuse/dev.c | 8 | ||||
-rw-r--r-- | fs/fuse/fuse_i.h | 5 |
2 files changed, 12 insertions, 1 deletions
diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index 3ad22beb24c2..ebc36f525eee 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c | |||
@@ -224,6 +224,10 @@ static void request_end(struct fuse_conn *fc, struct fuse_req *req) | |||
224 | fc->blocked = 0; | 224 | fc->blocked = 0; |
225 | wake_up_all(&fc->blocked_waitq); | 225 | wake_up_all(&fc->blocked_waitq); |
226 | } | 226 | } |
227 | if (fc->num_background == FUSE_CONGESTION_THRESHOLD) { | ||
228 | clear_bdi_congested(&fc->bdi, READ); | ||
229 | clear_bdi_congested(&fc->bdi, WRITE); | ||
230 | } | ||
227 | fc->num_background--; | 231 | fc->num_background--; |
228 | } | 232 | } |
229 | spin_unlock(&fc->lock); | 233 | spin_unlock(&fc->lock); |
@@ -378,6 +382,10 @@ static void request_send_nowait(struct fuse_conn *fc, struct fuse_req *req) | |||
378 | fc->num_background++; | 382 | fc->num_background++; |
379 | if (fc->num_background == FUSE_MAX_BACKGROUND) | 383 | if (fc->num_background == FUSE_MAX_BACKGROUND) |
380 | fc->blocked = 1; | 384 | fc->blocked = 1; |
385 | if (fc->num_background == FUSE_CONGESTION_THRESHOLD) { | ||
386 | set_bdi_congested(&fc->bdi, READ); | ||
387 | set_bdi_congested(&fc->bdi, WRITE); | ||
388 | } | ||
381 | 389 | ||
382 | queue_request(fc, req); | 390 | queue_request(fc, req); |
383 | spin_unlock(&fc->lock); | 391 | spin_unlock(&fc->lock); |
diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h index 68ae87cbafab..9f4603beb9e8 100644 --- a/fs/fuse/fuse_i.h +++ b/fs/fuse/fuse_i.h | |||
@@ -20,7 +20,10 @@ | |||
20 | #define FUSE_MAX_PAGES_PER_REQ 32 | 20 | #define FUSE_MAX_PAGES_PER_REQ 32 |
21 | 21 | ||
22 | /** Maximum number of outstanding background requests */ | 22 | /** Maximum number of outstanding background requests */ |
23 | #define FUSE_MAX_BACKGROUND 10 | 23 | #define FUSE_MAX_BACKGROUND 12 |
24 | |||
25 | /** Congestion starts at 75% of maximum */ | ||
26 | #define FUSE_CONGESTION_THRESHOLD (FUSE_MAX_BACKGROUND * 75 / 100) | ||
24 | 27 | ||
25 | /** It could be as large as PATH_MAX, but would that have any uses? */ | 28 | /** It could be as large as PATH_MAX, but would that have any uses? */ |
26 | #define FUSE_NAME_MAX 1024 | 29 | #define FUSE_NAME_MAX 1024 |