From nobody Fri Mar 08 18:44:52 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 4Trw850mDjz5Dckx; Fri, 8 Mar 2024 18:44:53 +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 4Trw844swSz51YD; Fri, 8 Mar 2024 18:44:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1709923492; 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=uk522Dw6oeOtIATYuR0Y5coUk9wced281fKZMNO5Idw=; b=EYjCx3E914dZL2UlNe3AKSIZrYkItMbWkhZzTE0aZgHi3h+zgmi/WYGziOxuFp3VWtjsxa iTkps6RbI1quO9KFCjlS1UnWOy+v9nxoutSvoNwEGHUrhCW+2lFz/hYxoHO1Fx4LpTJnMD 402bt+Jc0P/4jb6WY2zuuiNGNr1CY7j18LvZy8/nOU0vdlDLsLP2TmBKz/Bu1QUJGCe4gr D18RQHfZgVjsjuctde3JwHXiWp6oE08Ho/8/oCLfsrik03ZT9hF66JTri9CnQvWezIt01j /on8VNc8ehxUNTv8I29006Ra8/2lIDFZC7EID/fvaKJ4J9G9Q5bvq7PDrjVarA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1709923492; a=rsa-sha256; cv=none; b=ucSZOpozP+MPUcaO62NfVDOG2/JGzbfC5AEf0vxsbiMe3ADVOygnx8C8Yb1RBYdSien5P0 s2WAmOsxLIKg9xLaZgBaPq6uS39E0/oQZvX7BNQbqndeCKXUn7ShTa8MjwzGwBS/tEgCdb whvEqNcZ0YiHHBlMCguooM/5PDMasfrUE1GCCs1QQCSg40lvtF9x0bx09rrcjx9+S0npAH zHYk7yl+UKsJypOPp421z5yXohinVvDXHopbzglv0//+FRtmy84VjPB3rGwrPlUCeKISx3 T86NaSLijMH4JATpJPvwdsNifzcOCTaNW8hyOClvIAr31q3f9c5fUW7kGa71Fw== 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=1709923492; 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=uk522Dw6oeOtIATYuR0Y5coUk9wced281fKZMNO5Idw=; b=DGHKAv+GbuwIsqjCfyiaNgmyqk2W/juXo2TmmTaY3FoCZyzkdaCNPmMvMz/T4axVW+RmuZ 5DSmucpXWsbE/ufLucCaxkg/s9yQkvtGPgaEDEWwTwhrd5Nwy0d3x3lQVRkqCYMTQjGdN4 wpaGwLpxBYuhhkrOIAaH02h9FWLFOWfizI+Sp7SUPUtuz/+qKWkW+3YkGqQqGyr4mLob4e a6kjHdijjWsyiCx3XVHUd41ep0wjBh9DKz8JAIt+zpCV7YDS6rDXWdRs1yrTiQCllDs0Sw Qm2DrsjqwF8D3J7cdEGPI6DVPBOWposVRctSOdOkJFGRjjiWGxmE6zRHRsVqUw== 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 4Trw844QcSzTrl; Fri, 8 Mar 2024 18:44:52 +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 428IiqEE025213; Fri, 8 Mar 2024 18:44:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 428Iiqjk025210; Fri, 8 Mar 2024 18:44:52 GMT (envelope-from git) Date: Fri, 8 Mar 2024 18:44:52 GMT Message-Id: <202403081844.428Iiqjk025210@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: 8921216dbee6 - main - nullfs: add -o cache 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: 8921216dbee6884532e22d5347cff4d9ed23e782 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=8921216dbee6884532e22d5347cff4d9ed23e782 commit 8921216dbee6884532e22d5347cff4d9ed23e782 Author: Konstantin Belousov AuthorDate: 2024-03-08 18:26:02 +0000 Commit: Konstantin Belousov CommitDate: 2024-03-08 18:44:21 +0000 nullfs: add -o cache to allow overwrite global default if needed. Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/fs/nullfs/null_vfsops.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/sys/fs/nullfs/null_vfsops.c b/sys/fs/nullfs/null_vfsops.c index 7ee6ce53fbde..63bdcd4788d9 100644 --- a/sys/fs/nullfs/null_vfsops.c +++ b/sys/fs/nullfs/null_vfsops.c @@ -205,12 +205,15 @@ nullfs_mount(struct mount *mp) MNT_IUNLOCK(mp); } - xmp->nullm_flags |= NULLM_CACHE; - 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; - + if (vfs_getopt(mp->mnt_optnew, "cache", NULL, NULL) == 0) { + xmp->nullm_flags |= NULLM_CACHE; + } else if (vfs_getopt(mp->mnt_optnew, "nocache", NULL, NULL) == 0) { + ; + } else if (null_cache_vnodes && + (xmp->nullm_vfs->mnt_kern_flag & MNTK_NULL_NOCACHE) == 0) { + xmp->nullm_flags |= NULLM_CACHE; + } + if ((xmp->nullm_flags & NULLM_CACHE) != 0) { vfs_register_for_notification(xmp->nullm_vfs, mp, &xmp->notify_node);