Module Name: src
Committed By: pooka
Date: Tue Mar 1 15:19:49 UTC 2011
Modified Files:
src/tests/fs/puffs/h_dtfs: dtfs_subr.c dtfs_vnops.c
Log Message:
Reset node's parent pointer when it's removed. Technically the
parent still exists, but allows us to avoid complicated g/c algorithms
if the parent *is* removed.
To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/fs/puffs/h_dtfs/dtfs_subr.c
cvs rdiff -u -r1.7 -r1.8 src/tests/fs/puffs/h_dtfs/dtfs_vnops.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/tests/fs/puffs/h_dtfs/dtfs_subr.c
diff -u src/tests/fs/puffs/h_dtfs/dtfs_subr.c:1.2 src/tests/fs/puffs/h_dtfs/dtfs_subr.c:1.3
--- src/tests/fs/puffs/h_dtfs/dtfs_subr.c:1.2 Wed Jul 14 13:09:52 2010
+++ src/tests/fs/puffs/h_dtfs/dtfs_subr.c Tue Mar 1 15:19:49 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: dtfs_subr.c,v 1.2 2010/07/14 13:09:52 pooka Exp $ */
+/* $NetBSD: dtfs_subr.c,v 1.3 2011/03/01 15:19:49 pooka Exp $ */
/*
* Copyright (c) 2006 Antti Kantee. All Rights Reserved.
@@ -314,8 +314,12 @@
assert(pn_dir->pn_va.va_type == VDIR);
LIST_REMOVE(dent, dfd_entries);
- if (pn_file->pn_va.va_type == VDIR)
+ if (pn_file->pn_va.va_type == VDIR) {
+ struct dtfs_file *df = DTFS_PTOF(pn_file);
+
pn_dir->pn_va.va_nlink--;
+ df->df_dotdot = NULL;
+ }
pn_file->pn_va.va_nlink--;
assert(pn_dir->pn_va.va_nlink >= 2);
Index: src/tests/fs/puffs/h_dtfs/dtfs_vnops.c
diff -u src/tests/fs/puffs/h_dtfs/dtfs_vnops.c:1.7 src/tests/fs/puffs/h_dtfs/dtfs_vnops.c:1.8
--- src/tests/fs/puffs/h_dtfs/dtfs_vnops.c:1.7 Wed Jul 21 06:58:25 2010
+++ src/tests/fs/puffs/h_dtfs/dtfs_vnops.c Tue Mar 1 15:19:49 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: dtfs_vnops.c,v 1.7 2010/07/21 06:58:25 pooka Exp $ */
+/* $NetBSD: dtfs_vnops.c,v 1.8 2011/03/01 15:19:49 pooka Exp $ */
/*
* Copyright (c) 2006 Antti Kantee. All Rights Reserved.
@@ -51,6 +51,9 @@
/* parent dir? */
if (PCNISDOTDOT(pcn)) {
+ if (df->df_dotdot == NULL)
+ return ENOENT;
+
assert(df->df_dotdot->pn_va.va_type == VDIR);
puffs_newinfo_setcookie(pni, df->df_dotdot);
puffs_newinfo_setvtype(pni, df->df_dotdot->pn_va.va_type);