mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-31 11:14:09 +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:
committed by
Brian Behlendorf
parent
143f410e99
commit
f64f12079c
@@ -75,7 +75,6 @@ struct extmnttab {
|
|||||||
struct stat64;
|
struct stat64;
|
||||||
struct statfs;
|
struct statfs;
|
||||||
|
|
||||||
extern int getmntany(FILE *fp, struct mnttab *mp, struct mnttab *mpref);
|
|
||||||
extern int _sol_getmntent(FILE *fp, struct mnttab *mp);
|
extern int _sol_getmntent(FILE *fp, struct mnttab *mp);
|
||||||
extern int getextmntent(const char *path, struct extmnttab *entry,
|
extern int getextmntent(const char *path, struct extmnttab *entry,
|
||||||
struct stat64 *statbuf);
|
struct stat64 *statbuf);
|
||||||
|
|||||||
@@ -71,7 +71,6 @@ struct extmnttab {
|
|||||||
|
|
||||||
struct statfs;
|
struct statfs;
|
||||||
|
|
||||||
extern int getmntany(FILE *fp, struct mnttab *mp, struct mnttab *mpref);
|
|
||||||
extern int _sol_getmntent(FILE *fp, struct mnttab *mp);
|
extern int _sol_getmntent(FILE *fp, struct mnttab *mp);
|
||||||
extern int getextmntent(const char *path, struct extmnttab *mp,
|
extern int getextmntent(const char *path, struct extmnttab *mp,
|
||||||
struct stat64 *statbuf);
|
struct stat64 *statbuf);
|
||||||
|
|||||||
@@ -26,8 +26,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This file implements Solaris compatible getmntany() and hasmntopt()
|
* This file implements Solaris compatible hasmntopt() functions.
|
||||||
* functions.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
@@ -176,38 +175,6 @@ fail:
|
|||||||
return (error);
|
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
|
int
|
||||||
getmntent(FILE *fp, struct mnttab *mp)
|
getmntent(FILE *fp, struct mnttab *mp)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -45,23 +45,6 @@
|
|||||||
|
|
||||||
static __thread char buf[BUFSIZE];
|
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
|
int
|
||||||
_sol_getmntent(FILE *fp, struct mnttab *mgetp)
|
_sol_getmntent(FILE *fp, struct mnttab *mgetp)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user