Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/fs/puffs When changing a directory content, update the c...
details: https://anonhg.NetBSD.org/src/rev/d1e546399348
branches: trunk
changeset: 332065:d1e546399348
user: manu <manu%NetBSD.org@localhost>
date: Fri Sep 05 15:39:18 2014 +0000
description:
When changing a directory content, update the ctime/mtime in kernel cache,
otherwise the updated ctime/mtime appears after the cached entry expire.
diffstat:
sys/fs/puffs/puffs_node.c | 6 ++++--
sys/fs/puffs/puffs_vnops.c | 19 ++++++++++++++++---
2 files changed, 20 insertions(+), 5 deletions(-)
diffs (89 lines):
diff -r 07e9bc1a7c62 -r d1e546399348 sys/fs/puffs/puffs_node.c
--- a/sys/fs/puffs/puffs_node.c Fri Sep 05 15:20:16 2014 +0000
+++ b/sys/fs/puffs/puffs_node.c Fri Sep 05 15:39:18 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: puffs_node.c,v 1.32 2014/08/28 08:29:50 hannken Exp $ */
+/* $NetBSD: puffs_node.c,v 1.33 2014/09/05 15:39:18 manu Exp $ */
/*
* Copyright (c) 2005, 2006, 2007 Antti Kantee. All Rights Reserved.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: puffs_node.c,v 1.32 2014/08/28 08:29:50 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: puffs_node.c,v 1.33 2014/09/05 15:39:18 manu Exp $");
#include <sys/param.h>
#include <sys/hash.h>
@@ -180,6 +180,8 @@
cache_enter(dvp, *vpp, cnp->cn_nameptr, cnp->cn_namelen,
cnp->cn_flags);
+ puffs_updatenode(VPTOPP(dvp), PUFFS_UPDATECTIME|PUFFS_UPDATEMTIME, 0);
+
return 0;
}
diff -r 07e9bc1a7c62 -r d1e546399348 sys/fs/puffs/puffs_vnops.c
--- a/sys/fs/puffs/puffs_vnops.c Fri Sep 05 15:20:16 2014 +0000
+++ b/sys/fs/puffs/puffs_vnops.c Fri Sep 05 15:39:18 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: puffs_vnops.c,v 1.184 2014/08/28 08:29:50 hannken Exp $ */
+/* $NetBSD: puffs_vnops.c,v 1.185 2014/09/05 15:39:18 manu Exp $ */
/*
* Copyright (c) 2005, 2006, 2007 Antti Kantee. All Rights Reserved.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: puffs_vnops.c,v 1.184 2014/08/28 08:29:50 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: puffs_vnops.c,v 1.185 2014/09/05 15:39:18 manu Exp $");
#include <sys/param.h>
#include <sys/buf.h>
@@ -1805,6 +1805,8 @@
PUFFS_MSG_RELEASE(remove);
+ puffs_updatenode(VPTOPP(dvp), PUFFS_UPDATECTIME|PUFFS_UPDATEMTIME, 0);
+
RELEPN_AND_VP(dvp, dpn);
RELEPN_AND_VP(vp, pn);
@@ -1922,6 +1924,8 @@
PUFFS_MSG_RELEASE(rmdir);
+ puffs_updatenode(VPTOPP(dvp), PUFFS_UPDATECTIME|PUFFS_UPDATEMTIME, 0);
+
/* XXX: some call cache_purge() *for both vnodes* here, investigate */
RELEPN_AND_VP(dvp, dpn);
RELEPN_AND_VP(vp, pn);
@@ -1967,8 +1971,11 @@
* XXX: stay in touch with the cache. I don't like this, but
* don't have a better solution either. See also puffs_rename().
*/
- if (error == 0)
+ if (error == 0) {
puffs_updatenode(pn, PUFFS_UPDATECTIME, 0);
+ puffs_updatenode(VPTOPP(dvp),
+ PUFFS_UPDATECTIME|PUFFS_UPDATEMTIME, 0);
+ }
RELEPN_AND_VP(dvp, dpn);
puffs_releasenode(pn);
@@ -2133,6 +2140,12 @@
*/
if (error == 0) {
puffs_updatenode(fpn, PUFFS_UPDATECTIME, 0);
+ puffs_updatenode(VPTOPP(fdvp),
+ PUFFS_UPDATECTIME|PUFFS_UPDATEMTIME, 0);
+ if (fdvp != tdvp)
+ puffs_updatenode(VPTOPP(tdvp),
+ PUFFS_UPDATECTIME|PUFFS_UPDATEMTIME,
+ 0);
if (PUFFS_USE_DOTDOTCACHE(pmp) &&
(VPTOPP(fvp)->pn_parent != tdvp))
Home |
Main Index |
Thread Index |
Old Index