summaryrefslogtreecommitdiffstats
path: root/fs/9p
diff options
context:
space:
mode:
authorDominique Martinet <asmadeus@codewreck.org>2021-11-04 13:01:27 +0100
committerDominique Martinet <asmadeus@codewreck.org>2021-11-04 13:04:04 +0100
commitb1843d23854aeae95ce92a3432bc1bea4cdbb2e7 (patch)
tree9c97c1632d43c1b30054418e6f78ae746e64697c /fs/9p
parent9p p9mode2perm: remove useless strlcpy and check sscanf return code (diff)
downloadlinux-b1843d23854aeae95ce92a3432bc1bea4cdbb2e7.tar.xz
linux-b1843d23854aeae95ce92a3432bc1bea4cdbb2e7.zip
9p: set readahead and io size according to maxsize
having a readahead of 128k with a msize of 128k (with overhead) lead to reading 124+4k everytime, making two roundtrips needlessly. tune readahead according to msize when cache is enabled for better performance Link: http://lkml.kernel.org/r/20211104120323.2189376-1-asmadeus@codewreck.org Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
Diffstat (limited to 'fs/9p')
-rw-r--r--fs/9p/vfs_super.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/9p/vfs_super.c b/fs/9p/vfs_super.c
index c6028af51925..b0632f4e337f 100644
--- a/fs/9p/vfs_super.c
+++ b/fs/9p/vfs_super.c
@@ -79,6 +79,9 @@ v9fs_fill_super(struct super_block *sb, struct v9fs_session_info *v9ses,
if (!v9ses->cache) {
sb->s_bdi->ra_pages = 0;
sb->s_bdi->io_pages = 0;
+ } else {
+ sb->s_bdi->ra_pages = v9ses->maxdata >> PAGE_SHIFT;
+ sb->s_bdi->io_pages = v9ses->maxdata >> PAGE_SHIFT;
}
sb->s_flags |= SB_ACTIVE | SB_DIRSYNC;