Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/puffs/mount_9p mount_9p: don't cache path names by ...



details:   https://anonhg.NetBSD.org/src/rev/70cff387bf45
branches:  trunk
changeset: 361110:70cff387bf45
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Thu Feb 10 09:29:39 2022 +0000

description:
mount_9p: don't cache path names by default

Caching path names doesn't handle file changes by host, which is
not expected for normal usages.  So turn it off by default.

Instead, -C option is added to turn it on.

Patch from k-goda@IIJ with my tweaks

diffstat:

 usr.sbin/puffs/mount_9p/ninepuffs.c |  13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diffs (55 lines):

diff -r 21449caae11f -r 70cff387bf45 usr.sbin/puffs/mount_9p/ninepuffs.c
--- a/usr.sbin/puffs/mount_9p/ninepuffs.c       Wed Feb 09 22:30:26 2022 +0000
+++ b/usr.sbin/puffs/mount_9p/ninepuffs.c       Thu Feb 10 09:29:39 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ninepuffs.c,v 1.33 2020/06/14 00:30:20 uwe Exp $       */
+/*     $NetBSD: ninepuffs.c,v 1.34 2022/02/10 09:29:39 ozaki-r Exp $   */
 
 /*
  * Copyright (c) 2007  Antti Kantee.  All Rights Reserved.
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: ninepuffs.c,v 1.33 2020/06/14 00:30:20 uwe Exp $");
+__RCSID("$NetBSD: ninepuffs.c,v 1.34 2022/02/10 09:29:39 ozaki-r Exp $");
 #endif /* !lint */
 
 #include <sys/types.h>
@@ -149,6 +149,7 @@
        int detach;
        int protover;
        int server;
+       bool cachename = false;
 
        setprogname(argv[0]);
 
@@ -166,7 +167,7 @@
        protover = P9PROTO_VERSION;
        server = P9P_SERVER_TCP;
 
-       while ((ch = getopt(argc, argv, "46co:p:su")) != -1) {
+       while ((ch = getopt(argc, argv, "46cCo:p:su")) != -1) {
                switch (ch) {
                case '4':
                        family = AF_INET;
@@ -183,6 +184,9 @@
                case 'c':
                        server = P9P_SERVER_CDEV;
                        break;
+               case 'C':
+                       cachename = true;
+                       break;
                case 'o':
                        mp = getmntopts(optarg, puffsmopts, &mntflags, &pflags);
                        if (mp == NULL)
@@ -213,6 +217,9 @@
                detach = 0;
        pflags |= PUFFS_KFLAG_WTCACHE | PUFFS_KFLAG_IAONDEMAND;
 
+       if (!cachename)
+               pflags |= PUFFS_KFLAG_NOCACHE_NAME;
+
        PUFFSOP_INIT(pops);
 
        PUFFSOP_SET(pops, puffs9p, fs, unmount);



Home | Main Index | Thread Index | Old Index