Update synchronous open zfs_close() comment
authorBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 13 May 2011 15:16:10 +0000 (08:16 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 13 May 2011 15:20:06 +0000 (08:20 -0700)
The comment in zfs_close() pertaining to decrementing the synchronous
open count needs to be updated for Linux.  The code was already
updated to be correct, but the comment was missed and is now misleading.
Under Linux the zfs_close() hook is only called once when the final
reference is dropped.  This differs from Solaris where zfs_close()
is called for each close.

Closes #237

module/zfs/zfs_vnops.c

index 107211f..5b47cba 100644 (file)
@@ -220,7 +220,11 @@ zfs_close(struct inode *ip, int flag, cred_t *cr)
        ZFS_ENTER(zsb);
        ZFS_VERIFY_ZP(zp);
 
-       /* Decrement the synchronous opens in the znode */
+       /*
+        * Zero the synchronous opens in the znode.  Under Linux the
+        * zfs_close() hook is not symmetric with zfs_open(), it is
+        * only called once when the last reference is dropped.
+        */
        if (flag & O_SYNC)
                zp->z_sync_cnt = 0;