Module Name:    src
Committed By:   ozaki-r
Date:           Thu Feb 10 09:29:39 UTC 2022

Modified Files:
        src/usr.sbin/puffs/mount_9p: ninepuffs.c

Log Message:
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


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/usr.sbin/puffs/mount_9p/ninepuffs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/puffs/mount_9p/ninepuffs.c
diff -u src/usr.sbin/puffs/mount_9p/ninepuffs.c:1.33 src/usr.sbin/puffs/mount_9p/ninepuffs.c:1.34
--- src/usr.sbin/puffs/mount_9p/ninepuffs.c:1.33	Sun Jun 14 00:30:20 2020
+++ src/usr.sbin/puffs/mount_9p/ninepuffs.c	Thu Feb 10 09:29:39 2022
@@ -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 @@ main(int argc, char *argv[])
 	int detach;
 	int protover;
 	int server;
+	bool cachename = false;
 
 	setprogname(argv[0]);
 
@@ -166,7 +167,7 @@ main(int argc, char *argv[])
 	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 @@ main(int argc, char *argv[])
 		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 @@ main(int argc, char *argv[])
 		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);

Reply via email to