OpenZFS restructuring - libspl

Factor Linux specific pieces out of libspl.

Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
Reviewed-by: Sean Eric Fagan <sef@ixsystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Matt Macy <mmacy@FreeBSD.org>
Closes #9336
This commit is contained in:
Matthew Macy
2019-10-02 10:39:48 -07:00
committed by Brian Behlendorf
parent 6360e2779e
commit d31277abb1
65 changed files with 127 additions and 443 deletions
-4
View File
@@ -1,9 +1,5 @@
include $(top_srcdir)/config/Rules.am
DEFAULT_INCLUDES += \
-I$(top_srcdir)/include \
-I$(top_srcdir)/lib/libspl/include
sbin_PROGRAMS = zinject
zinject_SOURCES = \
+1 -31
View File
@@ -85,8 +85,6 @@ parse_pathname(const char *inpath, char *dataset, char *relpath,
struct stat64 *statbuf)
{
struct extmnttab mp;
FILE *fp;
int match;
const char *rel;
char fullpath[MAXPATHLEN];
@@ -99,35 +97,7 @@ parse_pathname(const char *inpath, char *dataset, char *relpath,
return (-1);
}
if (strlen(fullpath) >= MAXPATHLEN) {
(void) fprintf(stderr, "invalid object; pathname too long\n");
return (-1);
}
if (stat64(fullpath, statbuf) != 0) {
(void) fprintf(stderr, "cannot open '%s': %s\n",
fullpath, strerror(errno));
return (-1);
}
#ifdef HAVE_SETMNTENT
if ((fp = setmntent(MNTTAB, "r")) == NULL) {
#else
if ((fp = fopen(MNTTAB, "r")) == NULL) {
#endif
(void) fprintf(stderr, "cannot open %s\n", MNTTAB);
return (-1);
}
match = 0;
while (getextmntent(fp, &mp, sizeof (mp)) == 0) {
if (makedev(mp.mnt_major, mp.mnt_minor) == statbuf->st_dev) {
match = 1;
break;
}
}
if (!match) {
if (getextmntent(fullpath, &mp, statbuf) != 0) {
(void) fprintf(stderr, "cannot find mountpoint for '%s'\n",
fullpath);
return (-1);