Module Name:    src
Committed By:   rmind
Date:           Mon May 30 19:22:44 UTC 2011

Modified Files:
        src/sys/fs/tmpfs: tmpfs_vnops.c

Log Message:
- tmpfs_getattr: perform tmpfs_update() before fetching the timestamps.
- tmpfs_rmdir: detach after tn_links decrement, so that correct event
  i.e. NOTE_DELETE would be trigerred.


To generate a diff of this commit:
cvs rdiff -u -r1.85 -r1.86 src/sys/fs/tmpfs/tmpfs_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/sys/fs/tmpfs/tmpfs_vnops.c
diff -u src/sys/fs/tmpfs/tmpfs_vnops.c:1.85 src/sys/fs/tmpfs/tmpfs_vnops.c:1.86
--- src/sys/fs/tmpfs/tmpfs_vnops.c:1.85	Sun May 29 22:29:07 2011
+++ src/sys/fs/tmpfs/tmpfs_vnops.c	Mon May 30 19:22:44 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: tmpfs_vnops.c,v 1.85 2011/05/29 22:29:07 rmind Exp $	*/
+/*	$NetBSD: tmpfs_vnops.c,v 1.86 2011/05/30 19:22:44 rmind Exp $	*/
 
 /*
  * Copyright (c) 2005, 2006, 2007 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tmpfs_vnops.c,v 1.85 2011/05/29 22:29:07 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tmpfs_vnops.c,v 1.86 2011/05/30 19:22:44 rmind Exp $");
 
 #include <sys/param.h>
 #include <sys/dirent.h>
@@ -456,6 +456,8 @@
 
 	vattr_null(vap);
 
+	tmpfs_update(vp, NULL, NULL, NULL, 0);
+
 	vap->va_type = vp->v_type;
 	vap->va_mode = node->tn_mode;
 	vap->va_nlink = node->tn_links;
@@ -478,7 +480,6 @@
 	vap->va_vaflags = 0;
 	vap->va_spare = VNOVAL; /* XXX */
 
-	tmpfs_update(vp, NULL, NULL, NULL, 0);
 	return 0;
 }
 
@@ -1094,13 +1095,13 @@
 		goto out;
 	}
 
-	/* Detach the directory entry from the directory. */
-	tmpfs_dir_detach(dvp, de);
-
 	/* Decrement the link count for the virtual '.' entry. */
 	node->tn_links--;
 	node->tn_status |= TMPFS_NODE_STATUSALL;
 
+	/* Detach the directory entry from the directory. */
+	tmpfs_dir_detach(dvp, de);
+
 	/* Purge the cache for parent. */
 	cache_purge(dvp);
 

Reply via email to