Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions lib/libshare/os/linux/nfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@


static boolean_t nfs_available(void);
static boolean_t exports_available(void);

typedef int (*nfs_shareopt_callback_t)(const char *opt, const char *value,
void *cookie);
Expand Down Expand Up @@ -539,6 +540,8 @@ nfs_commit_shares(void)
static void
nfs_truncate_shares(void)
{
if (!exports_available())
return;
nfs_reset_shares(ZFS_EXPORTS_LOCK, ZFS_EXPORTS_FILE);
}

Expand Down Expand Up @@ -566,3 +569,18 @@ nfs_available(void)

return (avail == 1);
}

static boolean_t
exports_available(void)
{
static int avail;

if (!avail) {
if (access(ZFS_EXPORTS_DIR, F_OK) != 0)
avail = -1;
else
avail = 1;
}

return (avail == 1);
}
Loading