Call exportfs -v once for NFS shares.
authorJames H <james@kagisoft.co.uk>
Tue, 26 Jul 2011 10:47:20 +0000 (11:47 +0100)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 1 Aug 2011 20:50:40 +0000 (13:50 -0700)
commit5333eb0b3b18d345052b8cfaf41b90a0c5781fb8
treec3732a22084c4fb331816809f9776cedaad8b64e
parent77999e804fff35782ab4b578d2cecf064c54a841
Call exportfs -v once for NFS shares.

At the moment we call exportfs -v every time we check whether an
NFS share is active. This happens every time you run a zfs or
zpool command, making them extremely slow when you have a lot of
exports. The time taken is approx O(n2) of the number of shares.

This commit stores the output from exportfs -v in a temporary file
and use this to speed up subsequent accesses.

This mechanism is still too slow - if you have tens of thousands
of NFS shares it will still be painful running ANY zfs/zpool
command.

Signed-off-by: Gunnar Beutner <gunnar@beutner.name>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #341
lib/libshare/nfs.c