]> git.proxmox.com Git - mirror_zfs.git/commit - cmd/zfs/zfs_main.c
Enable /etc/mtab cache to improve performance
authorBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 7 Jan 2014 17:21:20 +0000 (09:21 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 7 Jan 2014 17:48:09 +0000 (09:48 -0800)
commite07306687d0862e8d43b5a0e32003748dedcfa3b
tree03c00b0bab894a0ce085a93f90c8cf8166f5715f
parent8c091798f26e7c1e6fd105e90065ebe12d97dfc2
Enable /etc/mtab cache to improve performance

Re-enable the /etc/mtab cache to prevent the zfs command from
having to repeatedly open and read from the /etc/mtab file.
Instead an AVL tree of the mounted filesystems is created and
used to vastly speed up lookups. This means that if non-zfs
filesystems are mounted concurrently the 'zfs mount' will not
immediately detect them.  In practice that will rarely happen
and even if it does the absolute worst case would be a failed
mount.  This was originally disabled out of an abundance of
paranoia.

NOTE: There may still be some parts of the code which do not
consult the mtab cache.  They should be updated to check the
mtab cache as they as discovered to be a problem.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Turbo Fredriksson <turbo@bayour.com>
Signed-off-by: Chris Dunlop <chris@onthe.net.au>
Issue #845
cmd/zfs/zfs_main.c