From patchwork Sat Feb 18 00:33:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Van Hensbergen X-Patchwork-Id: 58864 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp148953wrn; Fri, 17 Feb 2023 16:51:28 -0800 (PST) X-Google-Smtp-Source: AK7set9dKCiP7NjbTEeKEunf/sB7zo0AWfEQpxCFNUZEBqArN0dgqUkA2oGT7vQH8FXOuwgfoA5v X-Received: by 2002:aa7:96a1:0:b0:5a9:ea47:cd00 with SMTP id g1-20020aa796a1000000b005a9ea47cd00mr4240560pfk.17.1676681488127; Fri, 17 Feb 2023 16:51:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676681488; cv=none; d=google.com; s=arc-20160816; b=plLahgkSVSbiKy8Uicce701gsS0FGLpGfAFThmK4jiIrNekV3D8+iTE+oB3fiukdj9 3Ts9l4sLncfkxj0XxH9Fv98UEf1i1fTdApE2spp/zwjW0tlfHULfLNWwHjrtKTtmfVHV CWCezUTmHqyUzXVnJK052oKLcv5G5/rffXCETfVdAOg6gDar5lavcuryBBbWbemT19pS 8wllnm8XgztZOzolAgGjUurVFB6EvGpoJviHAc2DoC9rBvkvP8MmFt2PSirUlBc5c1Lq Q6Ey3Rov1BKlpN9mfLo3mglYOJHLuZ676qRZpbXdHMribGMcBdN9x4kKuQMGfnaycQix pA5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Y2tqT6fwp6T5QHm0N3zU6Kii1Y4H4eg32RlXAYJ9LZA=; b=YJzVZwjBLTHOKn5ahsfGu3APRz/1NN4RIMVu4or+dq4fFz2cRefUqnqCB0qcNj9yQP qg/VxqLfqSKcRvDFIeuvbx8zBzjV2rx2ZEJo1NchFYu1l5oVDxrdGC3uA3oD6jC0Orz+ 66lw0MPwk5qFZb17EBbtIX5uAPi7bgQVvMwN3X6wr4EA4NXIk9mHW1wIcIqwgT6Qwpwp /H9fEzJO7kA61QkEDLgiZgEUPvpfQKssxrGydHrwDq+bglyN6pFnxFHaVczPsof60xgn YNcWAXVUp4NNlViueM7xnleGJpcPVT9okAA3i8CvlC+clIu8WorPwRYwJ2sU/qMPhrLE gPaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=k2zvKVLY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d12-20020a056a00198c00b005a7ea9c6d7csi6411835pfl.41.2023.02.17.16.51.16; Fri, 17 Feb 2023 16:51:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=k2zvKVLY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229712AbjBRApV (ORCPT + 99 others); Fri, 17 Feb 2023 19:45:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230175AbjBRApI (ORCPT ); Fri, 17 Feb 2023 19:45:08 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B2D56E67E; Fri, 17 Feb 2023 16:44:36 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 856D6B82EDB; Sat, 18 Feb 2023 00:34:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 61CB8C4339E; Sat, 18 Feb 2023 00:34:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1676680442; bh=KENVm6Mybvc2iHuCzsErqi8WG1g+ScHvDff49cLzyDQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k2zvKVLYQRYHVPCHNW4CkVsb+xtQmWFci14aAHMmH5MuhKOi5lq8QRlpLTzVC7jcv +eKBBcUB1xn7Q8YXHws7r0KqMU64v+Hi78jLoj4GRyIfUsAFqRsGXYacyVThPsKL7N Y7p2mn4y024cFomTPs83Gt2ARvuZAqJ/fwgVKQiCtYM95oCIhecekSRfR9jXd863Ht 77GpUmI/2rEgtZAJD0ZIhaSB8mx1SbPlR2DAPqNt2fhJZF+tB56mq8rV+jXxKQux+1 aXAjJvGX0vsSjDqF3W1R2BABHde2pKPUvB7UU3gXu/FR9oXlQb4LnLXTnTe3sTMhvt TkZX5pCShykFQ== From: Eric Van Hensbergen To: v9fs-developer@lists.sourceforge.net, asmadeus@codewreck.org, rminnich@gmail.com, lucho@ionkov.net Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux_oss@crudebyte.com, Eric Van Hensbergen Subject: [PATCH v4 08/11] fs/9p: Add new mount modes Date: Sat, 18 Feb 2023 00:33:20 +0000 Message-Id: <20230218003323.2322580-9-ericvh@kernel.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230218003323.2322580-1-ericvh@kernel.org> References: <20230124023834.106339-1-ericvh@kernel.org> <20230218003323.2322580-1-ericvh@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758127967956010874?= X-GMAIL-MSGID: =?utf-8?q?1758127967956010874?= Add some additional mount modes for cache management including specifying directio as a mount option and an option for ignore qid.version for determining whether or not a file is cacheable. Signed-off-by: Eric Van Hensbergen --- fs/9p/v9fs.c | 16 ++++++++++++++-- fs/9p/v9fs.h | 5 ++++- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/fs/9p/v9fs.c b/fs/9p/v9fs.c index f8e952c013f9..43d3806150a9 100644 --- a/fs/9p/v9fs.c +++ b/fs/9p/v9fs.c @@ -38,7 +38,7 @@ enum { /* String options */ Opt_uname, Opt_remotename, Opt_cache, Opt_cachetag, /* Options that take no arguments */ - Opt_nodevmap, Opt_noxattr, + Opt_nodevmap, Opt_noxattr, Opt_directio, Opt_ignoreqv, /* Access options */ Opt_access, Opt_posixacl, /* Lock timeout option */ @@ -56,6 +56,8 @@ static const match_table_t tokens = { {Opt_remotename, "aname=%s"}, {Opt_nodevmap, "nodevmap"}, {Opt_noxattr, "noxattr"}, + {Opt_directio, "directio"}, + {Opt_ignoreqv, "ignoreqv"}, {Opt_cache, "cache=%s"}, {Opt_cachetag, "cachetag=%s"}, {Opt_access, "access=%s"}, @@ -125,7 +127,7 @@ int v9fs_show_options(struct seq_file *m, struct dentry *root) if (v9ses->nodev) seq_puts(m, ",nodevmap"); if (v9ses->cache) - seq_printf(m, ",%s", v9fs_cache_modes[v9ses->cache]); + seq_printf(m, ",cache=%s", v9fs_cache_modes[v9ses->cache]); #ifdef CONFIG_9P_FSCACHE if (v9ses->cachetag && v9ses->cache == CACHE_FSCACHE) seq_printf(m, ",cachetag=%s", v9ses->cachetag); @@ -147,6 +149,10 @@ int v9fs_show_options(struct seq_file *m, struct dentry *root) break; } + if (v9ses->flags & V9FS_IGNORE_QV) + seq_puts(m, ",ignoreqv"); + if (v9ses->flags & V9FS_DIRECT_IO) + seq_puts(m, ",directio"); if (v9ses->flags & V9FS_POSIX_ACL) seq_puts(m, ",posixacl"); @@ -276,6 +282,12 @@ static int v9fs_parse_options(struct v9fs_session_info *v9ses, char *opts) case Opt_noxattr: v9ses->flags |= V9FS_NO_XATTR; break; + case Opt_directio: + v9ses->flags |= V9FS_DIRECT_IO; + break; + case Opt_ignoreqv: + v9ses->flags |= V9FS_IGNORE_QV; + break; case Opt_cachetag: #ifdef CONFIG_9P_FSCACHE kfree(v9ses->cachetag); diff --git a/fs/9p/v9fs.h b/fs/9p/v9fs.h index d90141d25d0d..48c7614c9333 100644 --- a/fs/9p/v9fs.h +++ b/fs/9p/v9fs.h @@ -37,7 +37,10 @@ enum p9_session_flags { V9FS_ACCESS_USER = 0x08, V9FS_ACCESS_CLIENT = 0x10, V9FS_POSIX_ACL = 0x20, - V9FS_NO_XATTR = 0x40 + V9FS_NO_XATTR = 0x40, + V9FS_IGNORE_QV = 0x80, + V9FS_DIRECT_IO = 0x100, + V9FS_SYNC = 0x200 }; /* possible values of ->cache */