Module Name: src
Committed By: rmind
Date: Tue Oct 1 23:10:25 UTC 2013
Modified Files:
src/sys/fs/tmpfs: tmpfs_vnops.c
Log Message:
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.
To generate a diff of this commit:
cvs rdiff -u -r1.101 -r1.102 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.101 src/sys/fs/tmpfs/tmpfs_vnops.c:1.102
--- src/sys/fs/tmpfs/tmpfs_vnops.c:1.101 Mon Mar 18 19:35:40 2013
+++ src/sys/fs/tmpfs/tmpfs_vnops.c Tue Oct 1 23:10:25 2013
@@ -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_remove(void *v)
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. */