libzfs: get rid of libzfs_handle::libzfs_mnttab

All users did a freopen() on it. Even some non-users did!
This is point-less ‒ just open the mtab when needed

If I understand Solaris' getextmntent(3C) correctly, the non-user
freopen()s are very likely an odd, twisted vestigial tail of that ‒
but it's got a completely different calling convention and caching
semantics than any platform we support

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #11868
This commit is contained in:
наб
2021-04-09 00:44:23 +02:00
committed by Brian Behlendorf
parent 74e48f470e
commit 533527725b
7 changed files with 2563 additions and 2713 deletions
-4
View File
@@ -127,11 +127,7 @@ getextmntent(const char *path, struct extmnttab *entry, struct stat64 *statbuf)
}
#ifdef HAVE_SETMNTENT
if ((fp = setmntent(MNTTAB, "re")) == NULL) {
#else
if ((fp = fopen(MNTTAB, "re")) == NULL) {
#endif
(void) fprintf(stderr, "cannot open %s\n", MNTTAB);
return (-1);
}