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_remove: as per POSIX, "if the file's link...



details:   https://anonhg.NetBSD.org/src/rev/e1c00a24e5ec
branches:  trunk
changeset: 790287:e1c00a24e5ec
user:      rmind <rmind%NetBSD.org@localhost>
date:      Tue Oct 01 23:10:25 2013 +0000

description:
tmpfs_remove: as per POSIX, "if the file's link count is not 0, the last
file status change timestamp of the file shall be marked for update."

>From Pedro Martelletto.

diffstat:

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

diffs (30 lines):

diff -r dc5df2ee9195 -r e1c00a24e5ec sys/fs/tmpfs/tmpfs_vnops.c
--- a/sys/fs/tmpfs/tmpfs_vnops.c        Tue Oct 01 17:37:08 2013 +0000
+++ b/sys/fs/tmpfs/tmpfs_vnops.c        Tue Oct 01 23:10:25 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tmpfs_vnops.c,v 1.101 2013/03/18 19:35:40 plunky Exp $ */
+/*     $NetBSD: tmpfs_vnops.c,v 1.102 2013/10/01 23:10:25 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.101 2013/03/18 19:35:40 plunky Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tmpfs_vnops.c,v 1.102 2013/10/01 23:10:25 rmind Exp $");
 
 #include <sys/param.h>
 #include <sys/dirent.h>
@@ -707,6 +707,11 @@
                tmpfs_dir_attach(dvp, de, TMPFS_NODE_WHITEOUT);
        else
                tmpfs_free_dirent(VFS_TO_TMPFS(vp->v_mount), de);
+       if (node->tn_links > 0) {
+               /* We removed a hard link. */
+               node->tn_status |= TMPFS_NODE_CHANGED;
+               tmpfs_update(vp, NULL, NULL, NULL, 0);
+       }
        error = 0;
 out:
        /* Drop the references and unlock the vnodes. */



Home | Main Index | Thread Index | Old Index