From nobody Thu Mar 07 15:31:03 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TrCtw0vlXz5DDXB; Thu, 7 Mar 2024 15:31:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TrCtw0RSKz45cf; Thu, 7 Mar 2024 15:31:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1709825464; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DwKvq1EzoAhJ3vJoU9WHg8Ufi/v9ujx2EbAS3DSc888=; b=D/6si/AxQr4a/SQQ9lP4lqgFgetWONOG1KaNsGbORcuGTFlA8sg4B9ZhUB0A7/bcvX/FmC 5602fnC3VH3+KjZbSLFLkVyHZkf5w3AsgZNAHJBDFPlvhnyYA5SzSfNclMZFM9B96lgcVQ AMAhVAeJCzyX3CrpQ/XryCBuM9F/gOabzXF6CxNROAXaQh/n2B4NvkgJbv3txJbvpfwey8 3LCXDxNrP2lblsPXfTYi2iEZI5yFWPyBay9/y7VpIh+xRl15w5M8ReczuqNexG+u4CqxiE NazN3pqlLx6HnBm26sKl/l4a3ApW80Pyw01yZ1l/PEiS7N0VAJHeRx5uHopxWw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1709825464; a=rsa-sha256; cv=none; b=qR4YNLsE+m0ZT1zZHuMVqQmbdBt7+0n7GkxIoLVz6s9XOhr3aGI4aYFUQgJppbEVJpM18W N5FQ1gTaH21OBczFuwWs8XYQQvcAOdlVAwkz9fQHndqLgBpy9Dxll+oqdniuDvqlisswNs fVNKzFPVlViblF0Tpn48ESLjjRY3xX4QY6g5D1jIFhxzylPMPQmJKETnbJONq6k/+n4gUy ql6QGlLMryffIV/gtPBrciGeTYERh049EvHL8Nij3QHWzwz+404xHmfkzVqxYvlPo5JJIL yQ2QaCdSN1hxXSTOJK+RgMg6vA7igLZZI3yabjNJiaEXJKf46VjXxa5ocEeo2w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1709825464; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DwKvq1EzoAhJ3vJoU9WHg8Ufi/v9ujx2EbAS3DSc888=; b=bc6duL58+od1rNeAzer48fRNruOLroIjvFtiZES5TUbufKCzYDYm9DzhiAQFqXF3DE64hh JItJ7PY16Dr1tA2LXNMysZSDuMOFSJSR7Epjyd5jYmZ8NxfphdnyuRoAdCp+/b3mY5ksGP 5pJHV+IIUa9WVgAro5tmcMyFjy/eVFcvJLIOD50Br674Fylsre/l3C4UEaTjtw2WTACxTn nDWoIVF2TwDojw64aS3J6e4j+NglzXf9zsmqC3gn6mQpvqu2cfI0R4Fr4Ubjsp9l/C1mh/ dGD1nAk2Bh1oRoodXOWRHhFYDCB74sqs88Gu/9f16CF9K9KnywcI9hOufj/c1w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TrCtw02yYzgK7; Thu, 7 Mar 2024 15:31:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 427FV3ju069902; Thu, 7 Mar 2024 15:31:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 427FV3JI069899; Thu, 7 Mar 2024 15:31:03 GMT (envelope-from git) Date: Thu, 7 Mar 2024 15:31:03 GMT Message-Id: <202403071531.427FV3JI069899@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: c849eb8f1925 - main - nullfs: Add the vfs.nullfs.cache_nodes sysctl to control nocache default List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c849eb8f1925f95ebfb8dbbe00672d902486a973 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c849eb8f1925f95ebfb8dbbe00672d902486a973 commit c849eb8f1925f95ebfb8dbbe00672d902486a973 Author: Seigo Tanimura AuthorDate: 2024-03-04 13:50:25 +0000 Commit: Konstantin Belousov CommitDate: 2024-03-07 15:19:18 +0000 nullfs: Add the vfs.nullfs.cache_nodes sysctl to control nocache default Differential revision: https://reviews.freebsd.org/D44217 MFC after: 1 week --- sys/fs/nullfs/null_vfsops.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/sys/fs/nullfs/null_vfsops.c b/sys/fs/nullfs/null_vfsops.c index 2fa592ebbe9c..04a3817a828d 100644 --- a/sys/fs/nullfs/null_vfsops.c +++ b/sys/fs/nullfs/null_vfsops.c @@ -46,6 +46,7 @@ #include #include #include +#include #include #include @@ -63,6 +64,13 @@ static vfs_unmount_t nullfs_unmount; static vfs_vget_t nullfs_vget; static vfs_extattrctl_t nullfs_extattrctl; +SYSCTL_NODE(_vfs, OID_AUTO, nullfs, CTLFLAG_RW, 0, "nullfs"); + +static bool null_cache_vnodes = true; +SYSCTL_BOOL(_vfs_nullfs, OID_AUTO, cache_vnodes, CTLFLAG_RWTUN, + &null_cache_vnodes, 0, + "cache free nullfs vnodes"); + /* * Mount null layer */ @@ -198,7 +206,8 @@ nullfs_mount(struct mount *mp) } xmp->nullm_flags |= NULLM_CACHE; - if (vfs_getopt(mp->mnt_optnew, "nocache", NULL, NULL) == 0 || + if (!null_cache_vnodes || + vfs_getopt(mp->mnt_optnew, "nocache", NULL, NULL) == 0 || (xmp->nullm_vfs->mnt_kern_flag & MNTK_NULL_NOCACHE) != 0) xmp->nullm_flags &= ~NULLM_CACHE;