Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci
Commits
bd997572
Commit
bd997572
authored
Sep 15, 2009
by
Stephen Rothwell
Browse files
Options
Browse Files
Download
Plain Diff
Merge commit 'fuse/for-next'
parents
c7063080
37d217f0
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
52 additions
and
13 deletions
+52
-13
fs/fuse/dev.c
fs/fuse/dev.c
+5
-5
fs/fuse/fuse_i.h
fs/fuse/fuse_i.h
+6
-6
fs/fuse/inode.c
fs/fuse/inode.c
+14
-0
include/linux/fuse.h
include/linux/fuse.h
+27
-2
No files found.
fs/fuse/dev.c
View file @
bd997572
...
...
@@ -250,7 +250,7 @@ static void queue_request(struct fuse_conn *fc, struct fuse_req *req)
static
void
flush_bg_queue
(
struct
fuse_conn
*
fc
)
{
while
(
fc
->
active_background
<
FUSE_MAX_BACKGROUND
&&
while
(
fc
->
active_background
<
fc
->
max_background
&&
!
list_empty
(
&
fc
->
bg_queue
))
{
struct
fuse_req
*
req
;
...
...
@@ -280,11 +280,11 @@ __releases(&fc->lock)
list_del
(
&
req
->
intr_entry
);
req
->
state
=
FUSE_REQ_FINISHED
;
if
(
req
->
background
)
{
if
(
fc
->
num_background
==
FUSE_MAX_BACKGROUND
)
{
if
(
fc
->
num_background
==
fc
->
max_background
)
{
fc
->
blocked
=
0
;
wake_up_all
(
&
fc
->
blocked_waitq
);
}
if
(
fc
->
num_background
==
FUSE_CONGESTION_THRESHOLD
&&
if
(
fc
->
num_background
==
fc
->
congestion_threshold
&&
fc
->
connected
&&
fc
->
bdi_initialized
)
{
clear_bdi_congested
(
&
fc
->
bdi
,
BLK_RW_SYNC
);
clear_bdi_congested
(
&
fc
->
bdi
,
BLK_RW_ASYNC
);
...
...
@@ -410,9 +410,9 @@ static void fuse_request_send_nowait_locked(struct fuse_conn *fc,
{
req
->
background
=
1
;
fc
->
num_background
++
;
if
(
fc
->
num_background
==
FUSE_MAX_BACKGROUND
)
if
(
fc
->
num_background
==
fc
->
max_background
)
fc
->
blocked
=
1
;
if
(
fc
->
num_background
==
FUSE_CONGESTION_THRESHOLD
&&
if
(
fc
->
num_background
==
fc
->
congestion_threshold
&&
fc
->
bdi_initialized
)
{
set_bdi_congested
(
&
fc
->
bdi
,
BLK_RW_SYNC
);
set_bdi_congested
(
&
fc
->
bdi
,
BLK_RW_ASYNC
);
...
...
fs/fuse/fuse_i.h
View file @
bd997572
...
...
@@ -25,12 +25,6 @@
/** Max number of pages that can be used in a single read request */
#define FUSE_MAX_PAGES_PER_REQ 32
/** Maximum number of outstanding background requests */
#define FUSE_MAX_BACKGROUND 12
/** Congestion starts at 75% of maximum */
#define FUSE_CONGESTION_THRESHOLD (FUSE_MAX_BACKGROUND * 75 / 100)
/** Bias for fi->writectr, meaning new writepages must not be sent */
#define FUSE_NOWRITE INT_MIN
...
...
@@ -349,6 +343,12 @@ struct fuse_conn {
/** rbtree of fuse_files waiting for poll events indexed by ph */
struct
rb_root
polled_files
;
/** Maximum number of outstanding background requests */
unsigned
max_background
;
/** Number of background requests at which congestion starts */
unsigned
congestion_threshold
;
/** Number of requests currently in the background */
unsigned
num_background
;
...
...
fs/fuse/inode.c
View file @
bd997572
...
...
@@ -32,6 +32,12 @@ DEFINE_MUTEX(fuse_mutex);
#define FUSE_DEFAULT_BLKSIZE 512
/** Maximum number of outstanding background requests */
#define FUSE_DEFAULT_MAX_BACKGROUND 12
/** Congestion starts at 75% of maximum */
#define FUSE_DEFAULT_CONGESTION_THRESHOLD (FUSE_DEFAULT_MAX_BACKGROUND * 3 / 4)
struct
fuse_mount_data
{
int
fd
;
unsigned
rootmode
;
...
...
@@ -517,6 +523,8 @@ void fuse_conn_init(struct fuse_conn *fc)
INIT_LIST_HEAD
(
&
fc
->
bg_queue
);
INIT_LIST_HEAD
(
&
fc
->
entry
);
atomic_set
(
&
fc
->
num_waiting
,
0
);
fc
->
max_background
=
FUSE_DEFAULT_MAX_BACKGROUND
;
fc
->
congestion_threshold
=
FUSE_DEFAULT_CONGESTION_THRESHOLD
;
fc
->
khctr
=
0
;
fc
->
polled_files
=
RB_ROOT
;
fc
->
reqctr
=
0
;
...
...
@@ -736,6 +744,12 @@ static void process_init_reply(struct fuse_conn *fc, struct fuse_req *req)
else
{
unsigned
long
ra_pages
;
if
(
arg
->
minor
>=
13
)
{
if
(
arg
->
max_background
)
fc
->
max_background
=
arg
->
max_background
;
if
(
arg
->
congestion_threshold
)
fc
->
congestion_threshold
=
arg
->
congestion_threshold
;
}
if
(
arg
->
minor
>=
6
)
{
ra_pages
=
arg
->
max_readahead
/
PAGE_CACHE_SIZE
;
if
(
arg
->
flags
&
FUSE_ASYNC_READ
)
...
...
include/linux/fuse.h
View file @
bd997572
...
...
@@ -30,6 +30,10 @@
* - add umask flag to input argument of open, mknod and mkdir
* - add notification messages for invalidation of inodes and
* directory entries
*
* 7.13
* - make max number of background requests and congestion threshold
* tunables
*/
#ifndef _LINUX_FUSE_H
...
...
@@ -37,11 +41,31 @@
#include <linux/types.h>
/*
* Version negotiation:
*
* Both the kernel and userspace send the version they support in the
* INIT request and reply respectively.
*
* If the major versions match then both shall use the smallest
* of the two minor versions for communication.
*
* If the kernel supports a larger major version, then userspace shall
* reply with the major version it supports, ignore the rest of the
* INIT message and expect a new INIT message from the kernel with a
* matching major version.
*
* If the library supports a larger major version, then it shall fall
* back to the major protocol version sent by the kernel for
* communication and reply with that major version (and an arbitrary
* supported minor version).
*/
/** Version number of this interface */
#define FUSE_KERNEL_VERSION 7
/** Minor version number of this interface */
#define FUSE_KERNEL_MINOR_VERSION 1
2
#define FUSE_KERNEL_MINOR_VERSION 1
3
/** The node ID of the root inode */
#define FUSE_ROOT_ID 1
...
...
@@ -427,7 +451,8 @@ struct fuse_init_out {
__u32
minor
;
__u32
max_readahead
;
__u32
flags
;
__u32
unused
;
__u16
max_background
;
__u16
congestion_threshold
;
__u32
max_write
;
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment