libbe: use the new zfs_mount_at()

More background is available in r356876, but this new interface is more
portable across ZFS implementations and cleaner for what libbe is attempting
to achieve anyways.

MFC after:	3 days
This commit is contained in:
Kyle Evans 2020-01-19 02:48:56 +00:00
parent 149d640cfa
commit c7a19fd70a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=356877

View File

@ -82,7 +82,6 @@ be_mount_iter(zfs_handle_t *zfs_hdl, void *data)
char *mountpoint;
char tmp[BE_MAXPATHLEN], zfs_mnt[BE_MAXPATHLEN];
struct be_mount_info *info;
char opt;
info = (struct be_mount_info *)data;
@ -121,9 +120,7 @@ be_mount_iter(zfs_handle_t *zfs_hdl, void *data)
mountpoint);
}
opt = '\0';
if ((err = zmount(zfs_get_name(zfs_hdl), tmp, info->mntflags,
__DECONST(char *, MNTTYPE_ZFS), NULL, 0, &opt, 1)) != 0) {
if ((err = zfs_mount_at(zfs_hdl, NULL, info->mntflags, tmp)) != 0) {
switch (errno) {
case ENAMETOOLONG:
return (set_error(info->lbh, BE_ERR_PATHLEN));