libshare: fold into libzfs and reorg headers a little

libzfs is the only user of libshare, and only internally, so there's no
particular reason to build it separately, nor to export its symbols. So,
pull it into libzfs proper, remove its "public" header, and hide its
symbols.

The bare minimum "public" API is just to count and enumerate the
supported share types. These are moved to libzfs.h with the other share
API.

Sponsored-by: https://despairlabs.com/sponsor/
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rob Norris <robn@despairlabs.com>
Closes #18072
This commit is contained in:
Rob Norris
2025-12-20 14:52:33 +11:00
committed by GitHub
parent 962e68865e
commit 0d44b58d7f
20 changed files with 337 additions and 449 deletions
+9 -1
View File
@@ -37,7 +37,6 @@
#define _LIBZFS_H extern __attribute__((visibility("default")))
#include <assert.h>
#include <libshare.h>
#include <libnvpair.h>
#include <sys/mnttab.h>
#include <sys/param.h>
@@ -983,6 +982,15 @@ _LIBZFS_H void zfs_adjust_mount_options(zfs_handle_t *zhp, const char *mntpoint,
*/
#define SA_NO_PROTOCOL -1
/* available protocols */
enum sa_protocol {
SA_PROTOCOL_NFS,
SA_PROTOCOL_SMB, /* ABI: add before _COUNT */
SA_PROTOCOL_COUNT,
};
_LIBZFS_H const char *zfs_share_protocol_name(enum sa_protocol);
_LIBZFS_H boolean_t zfs_is_shared(zfs_handle_t *zhp, char **where,
const enum sa_protocol *proto);
_LIBZFS_H int zfs_share(zfs_handle_t *zhp, const enum sa_protocol *proto);