From nobody Sun Feb 8 20:59:07 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 32A26EB64DB for ; Tue, 20 Jun 2023 15:14:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233749AbjFTPOp (ORCPT ); Tue, 20 Jun 2023 11:14:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233688AbjFTPO2 (ORCPT ); Tue, 20 Jun 2023 11:14:28 -0400 Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 168A81FDB for ; Tue, 20 Jun 2023 08:14:04 -0700 (PDT) Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-1b512309d18so23986405ad.3 for ; Tue, 20 Jun 2023 08:14:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1687274040; x=1689866040; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=lRb96LJgR72xVeW8oewPH/vIoAVz/LQLwg+4m06vZkc=; b=XKfp2wc7nAI8DCwXu8AhLAR5wD/2txHmlVMHGvKvNUaTw24+5WQRKQY0Xhr4S6HgiZ GRTW4OLWcisOfwkiy06oWmwYPHjfI2rB+H0ltRtxXHomXz841Ao/7ERSbBkQk1WNDx8L RqeqommVxKAl1E0YcwBImX9LSeUv3JGSoYIgQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687274040; x=1689866040; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lRb96LJgR72xVeW8oewPH/vIoAVz/LQLwg+4m06vZkc=; b=IeT8Nqf0oAKuYp40YjuXwPdswO7CzQjUrdoBjvnxaCmatuGpnFO3bVEU6jOH2jwCrX W5G+o4J/NE5yU6grMorvxmemrSBrbtEJ46FSOKeJNBfji5tuDnPsspCxIKbYCf1mJTCk XVIMNftb6ag47wOkLR4IDpmwkXLEDe+97Ar3NuF9S8Kio7u2OoeGl+MU0T/YaOSf1mMQ Xk2TUjWWEKtdAs350oAUehplPy0GEWkfjCKhNzdTSHWKPem83RpGOJ8p/tDJL/0Gr4Ra /QDb4yS8orLIpiDenbUITjmGIKVFzEqTfNY6lZvDBTRLkaKlCkH6HYq5ud/FwCkC+GvM BP/w== X-Gm-Message-State: AC+VfDyWp+K8sLSeBISz+cp3xuZVrRYEyDi5uCj8vypxRjwRdbqAQRhn pQVN1gGrr2lV0OFFiN83kafSgWTH9XtdSQ0JAJw= X-Google-Smtp-Source: ACHHUZ7vDNz9Cx5BItNVohrwafUr0euSnM4MHgJv4ESsQf5sFBe9OMU343gsncNkMmM7BVjOusovJA== X-Received: by 2002:a17:902:ecc2:b0:1b5:561a:5c9a with SMTP id a2-20020a170902ecc200b001b5561a5c9amr4465646plh.39.1687274040118; Tue, 20 Jun 2023 08:14:00 -0700 (PDT) Received: from keiichiw1.tok.corp.google.com ([2401:fa00:8f:203:e87e:41e3:d762:f8a8]) by smtp.gmail.com with ESMTPSA id x9-20020a170902ec8900b001aaf370b1c7sm1731872plg.278.2023.06.20.08.13.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Jun 2023 08:13:59 -0700 (PDT) From: Keiichi Watanabe To: LKML Cc: mhiramat@google.com, takayas@chromium.org, drosen@google.com, sarthakkukreti@google.com, uekawa@chromium.org, Keiichi Watanabe , Jonathan Corbet , Miklos Szeredi , Stefan Hajnoczi , Vivek Goyal , linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org, virtualization@lists.linux-foundation.org Subject: [PATCH 1/3] docs: virtiofs: Fix descriptions about virtiofs mount option Date: Wed, 21 Jun 2023 00:13:14 +0900 Message-ID: <20230620151328.1637569-2-keiichiw@chromium.org> X-Mailer: git-send-email 2.41.0.185.g7c58973941-goog In-Reply-To: <20230620151328.1637569-1-keiichiw@chromium.org> References: <20230620151328.1637569-1-keiichiw@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Since virtiofs and FUSE don't share mount options, fixes the description. Also, explains DAX option as the only virtiofs-specific option so far. Signed-off-by: Keiichi Watanabe --- Documentation/filesystems/dax.rst | 1 + Documentation/filesystems/virtiofs.rst | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Documentation/filesystems/dax.rst b/Documentation/filesystems/= dax.rst index c04609d8ee24..77c5d4550ecd 100644 --- a/Documentation/filesystems/dax.rst +++ b/Documentation/filesystems/dax.rst @@ -167,6 +167,7 @@ Setting the `FS_XFLAG_DAX` flag (specifically or throug= h inheritance) occurs eve if the underlying media does not support dax and/or the filesystem is overridden with a mount option. =20 +.. _virtiofs-dax: =20 Enabling DAX on virtiofs ---------------------------- diff --git a/Documentation/filesystems/virtiofs.rst b/Documentation/filesys= tems/virtiofs.rst index fd4d2484e949..fdec5a7840f7 100644 --- a/Documentation/filesystems/virtiofs.rst +++ b/Documentation/filesystems/virtiofs.rst @@ -43,7 +43,10 @@ Mount options ------------- =20 virtiofs supports general VFS mount options, for example, remount, -ro, rw, context, etc. It also supports FUSE mount options. +ro, rw, context, etc. Also, virtiofs has its own options. + +dax[=3Dalways,never,inode] + Enable direct access for files. See :ref:`virtiofs-dax`. =20 atime behavior ^^^^^^^^^^^^^^ --=20 2.41.0.185.g7c58973941-goog From nobody Sun Feb 8 20:59:07 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 72D2FEB64D8 for ; Tue, 20 Jun 2023 15:15:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233720AbjFTPPX (ORCPT ); Tue, 20 Jun 2023 11:15:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233691AbjFTPOb (ORCPT ); Tue, 20 Jun 2023 11:14:31 -0400 Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49124198B for ; Tue, 20 Jun 2023 08:14:07 -0700 (PDT) Received: by mail-pg1-x52b.google.com with SMTP id 41be03b00d2f7-54f71fa7e41so2620434a12.3 for ; Tue, 20 Jun 2023 08:14:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1687274044; x=1689866044; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ppeagV3dNvGBs5uOwHPj/yNTFpUx3d1G45VnXlncaYU=; b=D2L1KmqNoXZJPq6HVKSi5pdK+8tDdkQ+kzrfoahOQuTG05P1VjhC+j9kjjGROjvFcF 61q96uQMMZjvbkUiZUCIpV+Lrk7ZckOeQuwnOANgw6dGtMr/9Hfs5YtZ/+Y1d4GbNQd+ 3QGwCRfySrq4tSrRx8JUtX5czk7VhZdJ5Jvvg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687274044; x=1689866044; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ppeagV3dNvGBs5uOwHPj/yNTFpUx3d1G45VnXlncaYU=; b=lEPAjyxIenrItjeEMN3ZE7eYimWVO2wcFGabNn40OqmBqXiqlSWX5CRadkOb8Y9i0C PgXgHvDczUkvFPZonPaIllE3FNuU76Rj+BIFmN+ogxYmkH9GUytdZZbyc3B54oEFDx+Z sMGoSkn41nFDvQMFikoX+o5+cnLAEp+WMBITi8CTIVmK8DO/1ktI9PEJYqev/EWz8/Rz 5AnNI13HamN2idcEWqWh0hW8GqrghQlDNGO53QauMQBDNTAIpdAWkNU5V/y1IZWWM0xE KGEeu+fpi9koA8X976aR2ovQBQ3lzgx3c6/oDLTyfaLMS80ik3pgu6Xha1Gg4lFlY2NT eKbw== X-Gm-Message-State: AC+VfDxa6ueERd/SKvUQaF1gaCiCCSQMY9GPhnbuSye4dOUfsf6Hc5c9 6NEH1QAG1HHhhy4wn6I5o+tzuqWFrwjw3yGmbwU= X-Google-Smtp-Source: ACHHUZ472Lh9kVZoNfWFhDKNBtH5Zr9VanhcaUoOkG9ECCzmzQe/bcTVtQiaub20jl/H6Nd4WRfGdg== X-Received: by 2002:a17:902:dac9:b0:1b6:822e:2bd4 with SMTP id q9-20020a170902dac900b001b6822e2bd4mr1697133plx.60.1687274044292; Tue, 20 Jun 2023 08:14:04 -0700 (PDT) Received: from keiichiw1.tok.corp.google.com ([2401:fa00:8f:203:e87e:41e3:d762:f8a8]) by smtp.gmail.com with ESMTPSA id x9-20020a170902ec8900b001aaf370b1c7sm1731872plg.278.2023.06.20.08.14.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Jun 2023 08:14:03 -0700 (PDT) From: Keiichi Watanabe To: LKML Cc: mhiramat@google.com, takayas@chromium.org, drosen@google.com, sarthakkukreti@google.com, uekawa@chromium.org, Keiichi Watanabe , Jonathan Corbet , Miklos Szeredi , linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: [PATCH 2/3] fuse: Add negative_dentry_timeout option Date: Wed, 21 Jun 2023 00:13:15 +0900 Message-ID: <20230620151328.1637569-3-keiichiw@chromium.org> X-Mailer: git-send-email 2.41.0.185.g7c58973941-goog In-Reply-To: <20230620151328.1637569-1-keiichiw@chromium.org> References: <20230620151328.1637569-1-keiichiw@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Add `negative_dentry_timeout` mount option for FUSE to cache negative dentries for the specified duration. With this option enabled, second and subsequent lookups to non-existent files can be omitted. A user needs to specify how often each negative_dentry cache should be refreshed. This is because the kernel has no idea when a FUSE server creates or deletes files, unlike normal filesystems such as ext4 where all of file operations are managed by the kernel. The appropriate timeout duration should be determined by considering how often a FUSE server update file paths and the amount of memory the kernel can use the cache. Signed-off-by: Keiichi Watanabe --- Documentation/filesystems/fuse.rst | 6 ++++++ fs/fuse/dir.c | 3 ++- fs/fuse/fuse_i.h | 4 ++++ fs/fuse/inode.c | 12 +++++++++++- 4 files changed, 23 insertions(+), 2 deletions(-) diff --git a/Documentation/filesystems/fuse.rst b/Documentation/filesystems= /fuse.rst index 1e31e87aee68..6d3b55476504 100644 --- a/Documentation/filesystems/fuse.rst +++ b/Documentation/filesystems/fuse.rst @@ -103,6 +103,12 @@ blksize=3DN Set the block size for the filesystem. The default is 512. This option is only valid for 'fuseblk' type mounts. =20 +negative_dentry_timeout=3DN + Set the time in seconds to keep negative dentry cache. If a lookup for + a path fails, the kernel won't do another lookup for this period of + time. The default value is 0, which means that negative dentries are not + cached. + Control filesystem =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index 35bc174f9ba2..21ff395467ab 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c @@ -453,7 +453,8 @@ static struct dentry *fuse_lookup(struct inode *dir, st= ruct dentry *entry, if (outarg_valid) fuse_change_entry_timeout(entry, &outarg); else - fuse_invalidate_entry_cache(entry); + fuse_dentry_settime(entry, + time_to_jiffies(get_fuse_mount(dir)->negative_dentry_timeout, 0)); =20 if (inode) fuse_advise_use_readdirplus(dir); diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h index 9b7fc7d3c7f1..bbfe53635329 100644 --- a/fs/fuse/fuse_i.h +++ b/fs/fuse/fuse_i.h @@ -516,6 +516,7 @@ struct fuse_fs_context { unsigned int max_read; unsigned int blksize; const char *subtype; + unsigned int negative_dentry_timeout; =20 /* DAX device, may be NULL */ struct dax_device *dax_dev; @@ -860,6 +861,9 @@ struct fuse_mount { */ struct super_block *sb; =20 + /* Timeout on negative denty caches in seconds */ + u32 negative_dentry_timeout; + /* Entry on fc->mounts */ struct list_head fc_entry; }; diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c index d66070af145d..45ed0c52f8a6 100644 --- a/fs/fuse/inode.c +++ b/fs/fuse/inode.c @@ -654,7 +654,8 @@ enum { OPT_ALLOW_OTHER, OPT_MAX_READ, OPT_BLKSIZE, - OPT_ERR + OPT_ERR, + OPT_NEGATIVE_DENTRY_TIMEOUT }; =20 static const struct fs_parameter_spec fuse_fs_parameters[] =3D { @@ -668,6 +669,7 @@ static const struct fs_parameter_spec fuse_fs_parameter= s[] =3D { fsparam_u32 ("max_read", OPT_MAX_READ), fsparam_u32 ("blksize", OPT_BLKSIZE), fsparam_string ("subtype", OPT_SUBTYPE), + fsparam_u32 ("negative_dentry_timeout", OPT_NEGATIVE_DENTRY_TIMEOUT), {} }; =20 @@ -751,6 +753,10 @@ static int fuse_parse_param(struct fs_context *fsc, st= ruct fs_parameter *param) ctx->blksize =3D result.uint_32; break; =20 + case OPT_NEGATIVE_DENTRY_TIMEOUT: + ctx->negative_dentry_timeout =3D result.uint_32; + break; + default: return -EINVAL; } @@ -1482,6 +1488,10 @@ static int fuse_get_tree_submount(struct fs_context = *fsc) return -ENOMEM; =20 fm->fc =3D fuse_conn_get(fc); + fm->negative_dentry_timeout =3D + ((struct fuse_fs_context *)fsc->fs_private) + ->negative_dentry_timeout; + fsc->s_fs_info =3D fm; sb =3D sget_fc(fsc, NULL, set_anon_super_fc); if (fsc->s_fs_info) --=20 2.41.0.185.g7c58973941-goog From nobody Sun Feb 8 20:59:07 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 40CEBEB64D8 for ; Tue, 20 Jun 2023 15:15:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233743AbjFTPP2 (ORCPT ); Tue, 20 Jun 2023 11:15:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233704AbjFTPOg (ORCPT ); Tue, 20 Jun 2023 11:14:36 -0400 Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A0C01997 for ; Tue, 20 Jun 2023 08:14:12 -0700 (PDT) Received: by mail-pg1-x52a.google.com with SMTP id 41be03b00d2f7-54fd6aa3b0dso2501859a12.2 for ; Tue, 20 Jun 2023 08:14:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1687274049; x=1689866049; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=h4+x+nHT/B45E7UNnOquSwSO/h9YI0Q8rRdwe69B63Q=; b=RqtNAe1RFUQMvzoORbX6DkZQi3UCv6ODu+PrzEzpYSbBftvYU2zYVD47PcImmkCIe7 BKQM7uPqi2PLFoKjz6oKM07HnmCNSiGOM9BPK6LGvIHrdADRMqW3EA7bHIQlaSA4aCaH K4ZagfAuaP18sbIGdxUoH2jYTicucMLlHh5Hc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687274049; x=1689866049; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=h4+x+nHT/B45E7UNnOquSwSO/h9YI0Q8rRdwe69B63Q=; b=SZROvFgdAqlOg8/DNIdiquQrtReH3PVkRuZaWDT2Ypub4y/5CpbR68tRQlJWl/McRk KAfR5rZ/B6lTjYGIvY0bpGjI8xQhLUbOxPKeCUalDrsbnzXOo1NtvoT4dThR1tIciTPC DWIc/pY8gLfaqTit49rJ8rF/3mlmqkladt1065nLad/XLHB1f7ux/tEx7GfDr+Me4azs W9ergNXFhpi9fU9QNli1CQW9aC74pM4mlLSbvR5/ovIh6UX+6K/N9beDzhdO6aWCLvPn WgnRWC3/B5KsIbMmSbSYVZ/DAgx93sVWcJ62ocXM5bsj+5GKepS+55ScWGSqOTDcDGsg iHwA== X-Gm-Message-State: AC+VfDwwjzIvXl9hblbX8WFHSEaMYlS1A5xe2IxGMEsKqIlNJJLBnfl9 zWoLyyxQ60QfSmiyFU81GrFZh8+bdzWt7qdT8Ss= X-Google-Smtp-Source: ACHHUZ7Rq928JI13B91Bwvj3KipWu3jBQaQgSh0KVxwME+Q4LkNUZdGe807jnxk5uiZldi6heglgvQ== X-Received: by 2002:a17:903:124e:b0:1b1:dfbd:a18c with SMTP id u14-20020a170903124e00b001b1dfbda18cmr8932980plh.39.1687274048672; Tue, 20 Jun 2023 08:14:08 -0700 (PDT) Received: from keiichiw1.tok.corp.google.com ([2401:fa00:8f:203:e87e:41e3:d762:f8a8]) by smtp.gmail.com with ESMTPSA id x9-20020a170902ec8900b001aaf370b1c7sm1731872plg.278.2023.06.20.08.14.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Jun 2023 08:14:08 -0700 (PDT) From: Keiichi Watanabe To: LKML Cc: mhiramat@google.com, takayas@chromium.org, drosen@google.com, sarthakkukreti@google.com, uekawa@chromium.org, Keiichi Watanabe , Jonathan Corbet , Miklos Szeredi , Stefan Hajnoczi , Vivek Goyal , linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org, virtualization@lists.linux-foundation.org Subject: [PATCH 3/3] virtiofs: Add negative_dentry_timeout option Date: Wed, 21 Jun 2023 00:13:16 +0900 Message-ID: <20230620151328.1637569-4-keiichiw@chromium.org> X-Mailer: git-send-email 2.41.0.185.g7c58973941-goog In-Reply-To: <20230620151328.1637569-1-keiichiw@chromium.org> References: <20230620151328.1637569-1-keiichiw@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Add negative_dentry_timeout mount option to virtiofs to caching negative dentry on the guest side. When the host virito-fs device has an exclusive access to the file system and the machine has enough memory, one can specify a long time as the timeout. This option saves ~1 second per 10,000 stat request for non-existing paths. Signed-off-by: Keiichi Watanabe --- Documentation/filesystems/virtiofs.rst | 4 ++++ fs/fuse/virtio_fs.c | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/Documentation/filesystems/virtiofs.rst b/Documentation/filesys= tems/virtiofs.rst index fdec5a7840f7..b045ef2223de 100644 --- a/Documentation/filesystems/virtiofs.rst +++ b/Documentation/filesystems/virtiofs.rst @@ -48,6 +48,10 @@ ro, rw, context, etc. Also, virtiofs has its own options. dax[=3Dalways,never,inode] Enable direct access for files. See :ref:`virtiofs-dax`. =20 +negative_dentry_timeout=3DN + Set the time in seconds to keep negative dentry cache. Same as the FUSE's + mount option. + atime behavior ^^^^^^^^^^^^^^ =20 diff --git a/fs/fuse/virtio_fs.c b/fs/fuse/virtio_fs.c index 4d8d4f16c727..bbbd840510f9 100644 --- a/fs/fuse/virtio_fs.c +++ b/fs/fuse/virtio_fs.c @@ -99,11 +99,13 @@ static const struct constant_table dax_param_enums[] = =3D { enum { OPT_DAX, OPT_DAX_ENUM, + OPT_NEGATIVE_DENTRY_TIMEOUT, }; =20 static const struct fs_parameter_spec virtio_fs_parameters[] =3D { fsparam_flag("dax", OPT_DAX), fsparam_enum("dax", OPT_DAX_ENUM, dax_param_enums), + fsparam_u32 ("negative_dentry_timeout", OPT_NEGATIVE_DENTRY_TIMEOUT), {} }; =20 @@ -125,6 +127,9 @@ static int virtio_fs_parse_param(struct fs_context *fsc, case OPT_DAX_ENUM: ctx->dax_mode =3D result.uint_32; break; + case OPT_NEGATIVE_DENTRY_TIMEOUT: + ctx->negative_dentry_timeout =3D result.uint_32; + break; default: return -EINVAL; } @@ -1416,6 +1421,7 @@ static int virtio_fs_get_tree(struct fs_context *fsc) struct super_block *sb; struct fuse_conn *fc =3D NULL; struct fuse_mount *fm; + struct fuse_fs_context *ffc; unsigned int virtqueue_size; int err =3D -EIO; =20 @@ -1468,6 +1474,8 @@ static int virtio_fs_get_tree(struct fs_context *fsc) =20 sb->s_flags |=3D SB_ACTIVE; } + ffc =3D fsc->fs_private; + fm->negative_dentry_timeout =3D ffc->negative_dentry_timeout; =20 WARN_ON(fsc->root); fsc->root =3D dget(sb->s_root); --=20 2.41.0.185.g7c58973941-goog