From 074cab8ee76badd41c5e8977878debb340cc61eb Mon Sep 17 00:00:00 2001 From: cem Date: Thu, 7 Mar 2019 00:55:49 +0000 Subject: [PATCH] fuse: switch from DFLTPHYS/MAXBSIZE to maxcachebuf On GENERIC kernels with empty loader.conf, there is no functional change. DFLTPHYS and MAXBSIZE are both 64kB at the moment. This change allows larger bufcache block sizes to be used when either MAXBSIZE (custom kernel) or the loader.conf tunable vfs.maxbcachebuf (GENERIC) is adjusted higher than the default. Suggested by: ken@ --- sys/fs/fuse/fuse_io.c | 2 +- sys/fs/fuse/fuse_vfsops.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/fs/fuse/fuse_io.c b/sys/fs/fuse/fuse_io.c index eb89db22177..8d6c52ade9c 100644 --- a/sys/fs/fuse/fuse_io.c +++ b/sys/fs/fuse/fuse_io.c @@ -198,7 +198,7 @@ fuse_read_biobackend(struct vnode *vp, struct uio *uio, if (uio->uio_offset < 0) return (EINVAL); - bcount = MIN(MAXBSIZE, biosize); + bcount = biosize; filesize = VTOFUD(vp)->filesize; do { diff --git a/sys/fs/fuse/fuse_vfsops.c b/sys/fs/fuse/fuse_vfsops.c index 8ae82cca3c6..0b3c4db7daf 100644 --- a/sys/fs/fuse/fuse_vfsops.c +++ b/sys/fs/fuse/fuse_vfsops.c @@ -58,11 +58,11 @@ #include __FBSDID("$FreeBSD$"); -#include +#include +#include #include #include #include -#include #include #include #include @@ -338,7 +338,7 @@ fuse_vfsop_mount(struct mount *mp) mp->mnt_kern_flag |= MNTK_USES_BCACHE; MNT_IUNLOCK(mp); /* We need this here as this slot is used by getnewvnode() */ - mp->mnt_stat.f_iosize = MIN(DFLTPHYS, MAXBSIZE); + mp->mnt_stat.f_iosize = maxbcachebuf; if (subtype) { strlcat(mp->mnt_stat.f_fstypename, ".", MFSNAMELEN); strlcat(mp->mnt_stat.f_fstypename, subtype, MFSNAMELEN); -- 2.45.0