Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove ZFS_IOC_*_MINOR ioctl()s #1969

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions include/libzfs_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,6 @@ zfs_handle_t *make_dataset_handle(libzfs_handle_t *, const char *);

int zpool_open_silent(libzfs_handle_t *, const char *, zpool_handle_t **);

int zvol_create_link(libzfs_handle_t *, const char *);
int zvol_remove_link(libzfs_handle_t *, const char *);
boolean_t zpool_name_valid(libzfs_handle_t *, boolean_t, const char *);

int zfs_validate_name(libzfs_handle_t *hdl, const char *path, int type,
Expand Down
2 changes: 0 additions & 2 deletions include/sys/fs/zfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -793,8 +793,6 @@ typedef enum zfs_ioc {
ZFS_IOC_DATASET_LIST_NEXT,
ZFS_IOC_SNAPSHOT_LIST_NEXT,
ZFS_IOC_SET_PROP,
ZFS_IOC_CREATE_MINOR,
ZFS_IOC_REMOVE_MINOR,
ZFS_IOC_CREATE,
ZFS_IOC_DESTROY,
ZFS_IOC_ROLLBACK,
Expand Down
2 changes: 2 additions & 0 deletions include/sys/zfs_ioctl.h
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,8 @@ extern int zfs_secpolicy_destroy_perms(const char *name, cred_t *cr);
extern int zfs_unmount_snap(const char *);
extern void zfs_destroy_unmount_origin(const char *);

extern boolean_t dataset_name_hidden(const char *name);

enum zfsdev_state_type {
ZST_ONEXIT,
ZST_ZEVENT,
Expand Down
9 changes: 5 additions & 4 deletions include/sys/zvol.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,11 @@ extern int zvol_check_volblocksize(uint64_t volblocksize);
extern int zvol_get_stats(objset_t *os, nvlist_t *nv);
extern boolean_t zvol_is_zvol(const char *);
extern void zvol_create_cb(objset_t *os, void *arg, cred_t *cr, dmu_tx_t *tx);
extern int zvol_create_minor(const char *);
extern int zvol_create_minors(char *);
extern int zvol_remove_minor(const char *);
extern void zvol_remove_minors(const char *);
extern int zvol_create_minor(const char *name);
extern int zvol_create_minors(const char *name);
extern int zvol_remove_minor(const char *name);
extern void zvol_remove_minors(const char *name);
extern void zvol_rename_minors(const char *oldname, const char *newname);
extern int zvol_set_volsize(const char *, uint64_t);
extern int zvol_set_volblocksize(const char *, uint64_t);
extern int zvol_set_snapdev(const char *, uint64_t);
Expand Down
18 changes: 5 additions & 13 deletions lib/libzfs/libzfs_changelist.c
Original file line number Diff line number Diff line change
Expand Up @@ -291,30 +291,22 @@ changelist_rename(prop_changelist_t *clp, const char *src, const char *dst)

for (cn = uu_list_first(clp->cl_list); cn != NULL;
cn = uu_list_next(clp->cl_list, cn)) {
zfs_handle_t *hdl;

hdl = cn->cn_handle;

/*
* Do not rename a clone that's not in the source hierarchy.
*/
if (!isa_child_of(hdl->zfs_name, src))
if (!isa_child_of(cn->cn_handle->zfs_name, src))
continue;

/*
* Destroy the previous mountpoint if needed.
*/
remove_mountpoint(hdl);
remove_mountpoint(cn->cn_handle);

(void) strlcpy(newname, dst, sizeof (newname));
(void) strcat(newname, hdl->zfs_name + strlen(src));

if (ZFS_IS_VOLUME(hdl)) {
(void) zvol_remove_link(hdl->zfs_hdl, hdl->zfs_name);
(void) zvol_create_link(hdl->zfs_hdl, newname);
}
(void) strcat(newname, cn->cn_handle->zfs_name + strlen(src));

(void) strlcpy(hdl->zfs_name, newname, sizeof (hdl->zfs_name));
(void) strlcpy(cn->cn_handle->zfs_name, newname,
sizeof (cn->cn_handle->zfs_name));
}
}

Expand Down
Loading