Lines Matching refs:hdl

127 is_shared(libzfs_handle_t *hdl, const char *mountpoint, zfs_share_proto_t proto)  in is_shared()  argument
132 if (hdl->libzfs_sharetab == NULL) in is_shared()
135 (void) fseek(hdl->libzfs_sharetab, 0, SEEK_SET); in is_shared()
137 while (fgets(buf, sizeof (buf), hdl->libzfs_sharetab) != NULL) { in is_shared()
276 libzfs_handle_t *hdl = zhp->zfs_hdl; in zfs_mount() local
295 zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, in zfs_mount()
297 return (zfs_error_fmt(hdl, EZFS_MOUNTFAILED, in zfs_mount()
313 zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, in zfs_mount()
315 return (zfs_error_fmt(hdl, EZFS_MOUNTFAILED, in zfs_mount()
329 zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, in zfs_mount()
332 zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, in zfs_mount()
345 zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, buf)); in zfs_mount()
347 zfs_error_aux(hdl, strerror(errno)); in zfs_mount()
349 return (zfs_error_fmt(hdl, EZFS_MOUNTFAILED, in zfs_mount()
355 libzfs_mnttab_add(hdl, zfs_get_name(zhp), mountpoint, in zfs_mount()
364 unmount_one(libzfs_handle_t *hdl, const char *mountpoint, int flags) in unmount_one() argument
367 zfs_error_aux(hdl, strerror(errno)); in unmount_one()
368 return (zfs_error_fmt(hdl, EZFS_UMOUNTFAILED, in unmount_one()
382 libzfs_handle_t *hdl = zhp->zfs_hdl; in zfs_unmount() local
388 libzfs_mnttab_find(hdl, zhp->zfs_name, &entry) == 0)) { in zfs_unmount()
396 mntpt = zfs_strdup(hdl, entry.mnt_mountp); in zfs_unmount()
398 mntpt = zfs_strdup(hdl, mountpoint); in zfs_unmount()
406 if (unmount_one(hdl, mntpt, flags) != 0) { in zfs_unmount()
411 libzfs_mnttab_remove(hdl, zhp->zfs_name); in zfs_unmount()
736 libzfs_handle_t *hdl = zhp->zfs_hdl; in zfs_share_proto() local
755 ret = zfs_init_libshare(hdl, SA_INIT_SHARE_API); in zfs_share_proto()
757 (void) zfs_error_fmt(hdl, EZFS_SHARENFSFAILED, in zfs_share_proto()
775 share = zfs_sa_find_share(hdl->libzfs_sharehdl, mountpoint); in zfs_share_proto()
786 if (_sa_zfs_process_share(hdl->libzfs_sharehdl, in zfs_share_proto()
790 (void) zfs_error_fmt(hdl, in zfs_share_proto()
796 hdl->libzfs_shareflags |= ZFSSHARE_MISS; in zfs_share_proto()
797 share = zfs_sa_find_share(hdl->libzfs_sharehdl, in zfs_share_proto()
805 (void) zfs_error_fmt(hdl, in zfs_share_proto()
826 (void) zfs_error_fmt(hdl, in zfs_share_proto()
860 unshare_one(libzfs_handle_t *hdl, const char *name, const char *mountpoint, in unshare_one() argument
872 mntpt = zfs_strdup(hdl, mountpoint); in unshare_one()
875 if ((err = zfs_init_libshare(hdl, SA_INIT_SHARE_API)) != SA_OK) { in unshare_one()
877 return (zfs_error_fmt(hdl, EZFS_SHARENFSFAILED, in unshare_one()
882 share = zfs_sa_find_share(hdl->libzfs_sharehdl, mntpt); in unshare_one()
888 return (zfs_error_fmt(hdl, EZFS_UNSHARENFSFAILED, in unshare_one()
893 return (zfs_error_fmt(hdl, EZFS_UNSHARENFSFAILED, in unshare_one()
909 zfs_error_aux(hdl, "%s", strerror(err)); in unshare_one()
910 return (zfs_error_fmt(hdl, EZFS_UNSHARENFSFAILED, in unshare_one()
925 libzfs_handle_t *hdl = zhp->zfs_hdl; in zfs_unshare_proto() local
932 mountpoint = mntpt = zfs_strdup(hdl, mountpoint); in zfs_unshare_proto()
935 libzfs_mnttab_find(hdl, zfs_get_name(zhp), &entry) == 0)) { in zfs_unshare_proto()
944 if (is_shared(hdl, mntpt, *curr_proto) && in zfs_unshare_proto()
945 unshare_one(hdl, zhp->zfs_name, in zfs_unshare_proto()
1138 libzfs_handle_t *hdl = zhp->zpool_hdl; in zpool_enable_datasets() local
1146 if ((zfsp = zfs_open(hdl, zhp->zpool_name, ZFS_TYPE_DATASET)) == NULL) in zpool_enable_datasets()
1221 libzfs_handle_t *hdl = zhp->zpool_hdl; in zpool_disable_datasets() local
1228 rewind(hdl->libzfs_mnttab); in zpool_disable_datasets()
1230 while (getmntent(hdl->libzfs_mnttab, &entry) == 0) { in zpool_disable_datasets()
1253 if ((mountpoints = zfs_alloc(hdl, in zpool_disable_datasets()
1257 if ((datasets = zfs_alloc(hdl, in zpool_disable_datasets()
1265 if ((ptr = zfs_realloc(hdl, mountpoints, in zpool_disable_datasets()
1271 if ((ptr = zfs_realloc(hdl, datasets, in zpool_disable_datasets()
1281 if ((mountpoints[used] = zfs_strdup(hdl, in zpool_disable_datasets()
1290 datasets[used] = make_dataset_handle(hdl, entry.mnt_special); in zpool_disable_datasets()
1308 if (is_shared(hdl, mountpoints[i], *curr_proto) && in zpool_disable_datasets()
1309 unshare_one(hdl, mountpoints[i], in zpool_disable_datasets()
1320 if (unmount_one(hdl, mountpoints[i], flags) != 0) in zpool_disable_datasets()