svn commit: r231774 - stable/8/sys/fs/tmpfs

Alan Cox alc at FreeBSD.org
Wed Feb 15 18:07:24 UTC 2012


Author: alc
Date: Wed Feb 15 18:07:24 2012
New Revision: 231774
URL: http://svn.freebsd.org/changeset/base/231774

Log:
  MFC r218949
    Eliminate two dubious attempts at optimizing the implementation of a
    file's last accessed, modified, and changed times.

Modified:
  stable/8/sys/fs/tmpfs/tmpfs_vnops.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/boot/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/e1000/   (props changed)

Modified: stable/8/sys/fs/tmpfs/tmpfs_vnops.c
==============================================================================
--- stable/8/sys/fs/tmpfs/tmpfs_vnops.c	Wed Feb 15 17:46:16 2012	(r231773)
+++ stable/8/sys/fs/tmpfs/tmpfs_vnops.c	Wed Feb 15 18:07:24 2012	(r231774)
@@ -265,19 +265,12 @@ tmpfs_close(struct vop_close_args *v)
 {
 	struct vnode *vp = v->a_vp;
 
-	struct tmpfs_node *node;
-
 	MPASS(VOP_ISLOCKED(vp));
 
-	node = VP_TO_TMPFS_NODE(vp);
-
-	if (node->tn_links > 0) {
-		/* Update node times.  No need to do it if the node has
-		 * been deleted, because it will vanish after we return. */
-		tmpfs_update(vp);
-	}
+	/* Update node times. */
+	tmpfs_update(vp);
 
-	return 0;
+	return (0);
 }
 
 /* --------------------------------------------------------------------- */
@@ -822,8 +815,7 @@ tmpfs_remove(struct vop_remove_args *v)
 	 * reclaimed. */
 	tmpfs_free_dirent(tmp, de, TRUE);
 
-	if (node->tn_links > 0)
-		node->tn_status |= TMPFS_NODE_ACCESSED | TMPFS_NODE_CHANGED;
+	node->tn_status |= TMPFS_NODE_ACCESSED | TMPFS_NODE_CHANGED;
 	error = 0;
 
 out:


More information about the svn-src-stable-8 mailing list