fstype = calloc(sizeof (sa_fstype_t), 1);
if (fstype == NULL)
- return NULL;
+ return (NULL);
fstype->name = name;
fstype->ops = ops;
fstype->next = fstypes;
fstypes = fstype;
- return fstype;
+ return (fstype);
}
sa_handle_t
impl_handle = calloc(sizeof (struct sa_handle_impl), 1);
if (impl_handle == NULL)
- return NULL;
+ return (NULL);
impl_handle->zfs_libhandle = libzfs_init();
if (type == ZFS_TYPE_FILESYSTEM &&
zfs_iter_filesystems(zhp, update_zfs_shares_cb, pcookie) != 0) {
zfs_close(zhp);
- return 1;
+ return (1);
}
if (type != ZFS_TYPE_FILESYSTEM) {
zfs_close(zhp);
- return 0;
+ return (0);
}
if (zfs_prop_get(zhp, ZFS_PROP_MOUNTPOINT, mountpoint,
sizeof (mountpoint), NULL, NULL, 0, B_FALSE) != 0) {
zfs_close(zhp);
- return 0;
+ return (0);
}
dataset = (char *)zfs_get_name(zhp);
if (dataset == NULL) {
zfs_close(zhp);
- return 0;
+ return (0);
}
if (!zfs_is_mounted(zhp, NULL)) {
zfs_close(zhp);
- return 0;
+ return (0);
}
if ((udata->proto == NULL || strcmp(udata->proto, "nfs") == 0) &&
zfs_close(zhp);
- return 0;
+ return (0);
}
static int
update_cookie_t udata;
if (impl_handle->zfs_libhandle == NULL)
- return SA_SYSTEM_ERR;
+ return (SA_SYSTEM_ERR);
assert(impl_share->dataset != NULL);
ZFS_TYPE_FILESYSTEM);
if (zhp == NULL)
- return SA_SYSTEM_ERR;
+ return (SA_SYSTEM_ERR);
udata.handle = impl_handle;
udata.proto = proto;
(void) update_zfs_shares_cb(zhp, &udata);
- return SA_OK;
+ return (SA_OK);
}
static int
update_cookie_t udata;
if (impl_handle->zfs_libhandle == NULL)
- return SA_SYSTEM_ERR;
+ return (SA_SYSTEM_ERR);
udata.handle = impl_handle;
udata.proto = proto;
(void) zfs_iter_root(impl_handle->zfs_libhandle, update_zfs_shares_cb,
&udata);
- return SA_OK;
+ return (SA_OK);
}
static int
if (impl_share == NULL) {
if (lstat(pathname, &statbuf) != 0 ||
!S_ISDIR(statbuf.st_mode))
- return SA_BAD_PATH;
+ return (SA_BAD_PATH);
impl_share = alloc_share(pathname);
free_share(impl_share);
}
- return rc;
+ return (rc);
}
void
impl_share = impl_share->next;
}
- return impl_share;
+ return (impl_share);
}
sa_share_t
sa_find_share(sa_handle_t handle, char *sharepath)
{
- return (sa_share_t)find_share((sa_handle_impl_t)handle, sharepath);
+ return ((sa_share_t)find_share((sa_handle_impl_t)handle, sharepath));
}
int
continue;
}
- return fstype->ops->validate_shareopts(options);
+ return (fstype->ops->validate_shareopts(options));
}
- return SA_INVALID_PROTOCOL;
+ return (SA_INVALID_PROTOCOL);
}
boolean_t
sa_needs_refresh(sa_handle_t handle)
{
- return B_TRUE;
+ return (B_TRUE);
}
libzfs_handle_t *
sa_handle_impl_t impl_handle = (sa_handle_impl_t)handle;
if (impl_handle == NULL)
- return NULL;
+ return (NULL);
- return impl_handle->zfs_libhandle;
+ return (impl_handle->zfs_libhandle);
}
static sa_share_impl_t
impl_share = calloc(sizeof (struct sa_share_impl), 1);
if (impl_share == NULL)
- return NULL;
+ return (NULL);
impl_share->sharepath = strdup(sharepath);
if (impl_share->sharepath == NULL) {
free(impl_share);
- return NULL;
+ return (NULL);
}
impl_share->fsinfo = calloc(sizeof (sa_share_fsinfo_t), fstypes_count);
if (impl_share->fsinfo == NULL) {
free(impl_share->sharepath);
free(impl_share);
- return NULL;
+ return (NULL);
}
- return impl_share;
+ return (impl_share);
}
static void
shareopts, sourcestr, dataset);
#endif
- return process_share(impl_handle, impl_share, mountpoint, NULL,
- proto, shareopts, NULL, dataset, B_FALSE);
+ return (process_share(impl_handle, impl_share, mountpoint, NULL,
+ proto, shareopts, NULL, dataset, B_FALSE));
}
void