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
+4 -5
View File
@@ -7339,15 +7339,14 @@ append_options(char *mntopts, char *newopts)
static enum sa_protocol
sa_protocol_decode(const char *protocol)
{
for (enum sa_protocol i = 0; i < ARRAY_SIZE(sa_protocol_names); ++i)
if (strcmp(protocol, sa_protocol_names[i]) == 0)
for (enum sa_protocol i = 0; i < SA_PROTOCOL_COUNT; ++i)
if (strcmp(protocol, zfs_share_protocol_name(i)) == 0)
return (i);
(void) fputs(gettext("share type must be one of: "), stderr);
for (enum sa_protocol i = 0;
i < ARRAY_SIZE(sa_protocol_names); ++i)
for (enum sa_protocol i = 0; i < SA_PROTOCOL_COUNT; ++i)
(void) fprintf(stderr, "%s%s",
i != 0 ? ", " : "", sa_protocol_names[i]);
i != 0 ? ", " : "", zfs_share_protocol_name(i));
(void) fputc('\n', stderr);
usage(B_FALSE);
}