Source-Changes-HG archive

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

[src/trunk]: src/sys/fs/tmpfs - tmpfs_getattr: perform tmpfs_update() before ...



details:   https://anonhg.NetBSD.org/src/rev/566ef039ea25
branches:  trunk
changeset: 765571:566ef039ea25
user:      rmind <rmind%NetBSD.org@localhost>
date:      Mon May 30 19:22:44 2011 +0000

description:
- 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.

diffstat:

 sys/fs/tmpfs/tmpfs_vnops.c |  13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diffs (52 lines):

diff -r f22544f95c59 -r 566ef039ea25 sys/fs/tmpfs/tmpfs_vnops.c
--- a/sys/fs/tmpfs/tmpfs_vnops.c        Mon May 30 19:03:09 2011 +0000
+++ b/sys/fs/tmpfs/tmpfs_vnops.c        Mon May 30 19:22:44 2011 +0000
@@ -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);
 



Home | Main Index | Thread Index | Old Index