Reverting series of commits (1/2 and 2/2) since they introduce
authorTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Tue, 12 May 2015 00:49:45 +0000 (09:49 +0900)
committerTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Tue, 12 May 2015 00:58:24 +0000 (09:58 +0900)
performance degrade.
'if ((node->tn_status & TMPFS_NODE_ACCESSED) == 0) {'
can be done without inode lock and helps performance.

Spotted-by: dillon
Revert "sys/vfs/tmpfs: Make flag handling consistent [2/2]"

This reverts commit c595728587e3d04ed27f9c275bddd0eafd6427ce.

sys/vfs/tmpfs/tmpfs_vnops.c

index 5c6e922..7e5a5b8 100644 (file)
@@ -108,7 +108,9 @@ tmpfs_nresolve(struct vop_nresolve_args *v)
                if (error == 0)
                        KKASSERT(vp);
        }
+       TMPFS_NODE_UNLOCK(dnode);
 
+       TMPFS_NODE_LOCK(dnode);
        dnode->tn_status |= TMPFS_NODE_ACCESSED;
        TMPFS_NODE_UNLOCK(dnode);
 
@@ -1513,7 +1515,9 @@ outok:
                }
                KKASSERT(uio->uio_offset == off);
        }
+       TMPFS_NODE_UNLOCK(node);
 
+       TMPFS_NODE_LOCK(node);
        node->tn_status |= TMPFS_NODE_ACCESSED;
        TMPFS_NODE_UNLOCK(node);
        return error;
@@ -1536,6 +1540,8 @@ tmpfs_readlink(struct vop_readlink_args *v)
        TMPFS_NODE_LOCK_SH(node);
        error = uiomove(node->tn_link,
                        MIN(node->tn_size, uio->uio_resid), uio);
+       TMPFS_NODE_UNLOCK(node);
+       TMPFS_NODE_LOCK(node);
        node->tn_status |= TMPFS_NODE_ACCESSED;
        TMPFS_NODE_UNLOCK(node);
        return error;