HomeFreeBSD

Enable /etc/mtab cache to improve performance

Description

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

Details

Provenance
Brian Behlendorf <behlendorf1@llnl.gov>Authored on Jan 7 2014, 5:21 PM
Parents
rG8c091798f26e: Add UNSHARING of filesystems and EXPORTING pools
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rGe07306687d08: Enable /etc/mtab cache to improve performance (authored by Brian Behlendorf <behlendorf1@llnl.gov>).Jan 7 2014, 5:48 PM