mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-04-12 22:51:46 +03:00
libspl/mnttab: remove getmntany()
Only used for when the mount cache was disabled, but since its always enabled now, we don't need it. Sponsored-by: TrueNAS Reviewed-by: Ameer Hamza <ahamza@ixsystems.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Rob Norris <rob.norris@truenas.com> Closes #18296
This commit is contained in:
parent
143f410e99
commit
f64f12079c
@ -75,7 +75,6 @@ struct extmnttab {
|
||||
struct stat64;
|
||||
struct statfs;
|
||||
|
||||
extern int getmntany(FILE *fp, struct mnttab *mp, struct mnttab *mpref);
|
||||
extern int _sol_getmntent(FILE *fp, struct mnttab *mp);
|
||||
extern int getextmntent(const char *path, struct extmnttab *entry,
|
||||
struct stat64 *statbuf);
|
||||
|
||||
@ -71,7 +71,6 @@ struct extmnttab {
|
||||
|
||||
struct statfs;
|
||||
|
||||
extern int getmntany(FILE *fp, struct mnttab *mp, struct mnttab *mpref);
|
||||
extern int _sol_getmntent(FILE *fp, struct mnttab *mp);
|
||||
extern int getextmntent(const char *path, struct extmnttab *mp,
|
||||
struct stat64 *statbuf);
|
||||
|
||||
@ -26,8 +26,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* This file implements Solaris compatible getmntany() and hasmntopt()
|
||||
* functions.
|
||||
* This file implements Solaris compatible hasmntopt() functions.
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -176,38 +175,6 @@ fail:
|
||||
return (error);
|
||||
}
|
||||
|
||||
int
|
||||
getmntany(FILE *fd __unused, struct mnttab *mgetp, struct mnttab *mrefp)
|
||||
{
|
||||
int i, error;
|
||||
|
||||
error = statfs_init();
|
||||
if (error != 0)
|
||||
return (error);
|
||||
|
||||
(void) pthread_rwlock_rdlock(&gsfs_lock);
|
||||
|
||||
for (i = 0; i < allfs; i++) {
|
||||
if (mrefp->mnt_special != NULL &&
|
||||
strcmp(mrefp->mnt_special, gsfs[i].f_mntfromname) != 0) {
|
||||
continue;
|
||||
}
|
||||
if (mrefp->mnt_mountp != NULL &&
|
||||
strcmp(mrefp->mnt_mountp, gsfs[i].f_mntonname) != 0) {
|
||||
continue;
|
||||
}
|
||||
if (mrefp->mnt_fstype != NULL &&
|
||||
strcmp(mrefp->mnt_fstype, gsfs[i].f_fstypename) != 0) {
|
||||
continue;
|
||||
}
|
||||
statfs2mnttab(&gsfs[i], mgetp);
|
||||
(void) pthread_rwlock_unlock(&gsfs_lock);
|
||||
return (0);
|
||||
}
|
||||
(void) pthread_rwlock_unlock(&gsfs_lock);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
int
|
||||
getmntent(FILE *fp, struct mnttab *mp)
|
||||
{
|
||||
|
||||
@ -45,23 +45,6 @@
|
||||
|
||||
static __thread char buf[BUFSIZE];
|
||||
|
||||
#define DIFF(xx) ( \
|
||||
(mrefp->xx != NULL) && \
|
||||
(mgetp->xx == NULL || strcmp(mrefp->xx, mgetp->xx) != 0))
|
||||
|
||||
int
|
||||
getmntany(FILE *fp, struct mnttab *mgetp, struct mnttab *mrefp)
|
||||
{
|
||||
int ret;
|
||||
|
||||
while (
|
||||
((ret = _sol_getmntent(fp, mgetp)) == 0) && (
|
||||
DIFF(mnt_special) || DIFF(mnt_mountp) ||
|
||||
DIFF(mnt_fstype) || DIFF(mnt_mntopts))) { }
|
||||
|
||||
return (ret);
|
||||
}
|
||||
|
||||
int
|
||||
_sol_getmntent(FILE *fp, struct mnttab *mgetp)
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user