From 71d4e7a4f9659ce030968a1a15ba577ddc6b4c16 Mon Sep 17 00:00:00 2001 From: asomers Date: Mon, 13 May 2019 20:31:10 +0000 Subject: [PATCH] fusefs: remove the vfs.fusefs.refresh_size sysctl This was added > 6.5 years ago with no evident reason why. It probably had something to do with the incomplete cached attribute implementation. But cache attributes work now. I see no reason to retain this sysctl. Sponsored by: The FreeBSD Foundation --- UPDATING | 7 ++++--- sys/fs/fuse/fuse_node.c | 14 ++++++-------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/UPDATING b/UPDATING index 99914f3837a..f2e41bd7280 100644 --- a/UPDATING +++ b/UPDATING @@ -37,9 +37,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: been removed from mount_fusefs(8). You can safely remove them from your scripts, because they had no effect. - The vfs.fusefs.fix_broken_io and vfs.fusefs.sync_resize sysctls have - been removed. If you felt the need to set either to a non-default - value, please tell asomers@FreeBSD.org why. + The vfs.fusefs.fix_broken_io, vfs.fusefs.sync_resize, and + vfs.fusefs.refresh_size sysctls have been removed. If you felt the + need to set any of them to a non-default value, please tell + asomers@FreeBSD.org why. 20190507: The IPSEC option has been removed from GENERIC. Users requiring diff --git a/sys/fs/fuse/fuse_node.c b/sys/fs/fuse/fuse_node.c index bc2c8f43101..eefc0cac376 100644 --- a/sys/fs/fuse/fuse_node.c +++ b/sys/fs/fuse/fuse_node.c @@ -128,13 +128,6 @@ SYSCTL_INT(_vfs_fusefs, OID_AUTO, mmap_enable, CTLFLAG_RW, "If non-zero, and data_cache_mode is also non-zero, enable mmap(2) of " "FUSE files"); -int fuse_refresh_size = 0; - -SYSCTL_INT(_vfs_fusefs, OID_AUTO, refresh_size, CTLFLAG_RW, - &fuse_refresh_size, 0, - "If non-zero, and no dirty file extension data is buffered, fetch file " - "size before write operations"); - static int sysctl_fuse_cache_mode(SYSCTL_HANDLER_ARGS) { @@ -409,9 +402,14 @@ fuse_vnode_refreshsize(struct vnode *vp, struct ucred *cred) if ((fvdat->flag & FN_SIZECHANGE) != 0 || fuse_data_cache_mode == FUSE_CACHE_UC || - (fuse_refresh_size == 0 && fvdat->filesize != 0)) + fvdat->filesize != 0) return 0; + /* + * TODO: replace VOP_GETATTR with fuse_internal_getattr to use the + * cached attributes. Better yet, replace fvdat->filesize with + * attrs->va_size + */ err = VOP_GETATTR(vp, &va, cred); SDT_PROBE2(fusefs, , node, trace, 1, "refreshed file size"); return err; -- 2.45.0