mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-23 02:44:41 +03:00
Correct compilation errors reported by GCC 10/11
New `zfs_type_t` value `ZFS_TYPE_INVALID` is introduced. Variable initialization is now possible to make GCC happy. Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: szubersk <szuberskidamian@gmail.com> Closes #12167 Closes #13103
This commit is contained in:
+3
-5
@@ -453,23 +453,21 @@ zfs_for_each(int argc, char **argv, int flags, zfs_type_t types,
|
||||
cb.cb_flags |= ZFS_ITER_RECURSE;
|
||||
ret = zfs_iter_root(g_zfs, zfs_callback, &cb);
|
||||
} else {
|
||||
int i;
|
||||
zfs_handle_t *zhp;
|
||||
zfs_type_t argtype;
|
||||
zfs_handle_t *zhp = NULL;
|
||||
zfs_type_t argtype = types;
|
||||
|
||||
/*
|
||||
* If we're recursive, then we always allow filesystems as
|
||||
* arguments. If we also are interested in snapshots or
|
||||
* bookmarks, then we can take volumes as well.
|
||||
*/
|
||||
argtype = types;
|
||||
if (flags & ZFS_ITER_RECURSE) {
|
||||
argtype |= ZFS_TYPE_FILESYSTEM;
|
||||
if (types & (ZFS_TYPE_SNAPSHOT | ZFS_TYPE_BOOKMARK))
|
||||
argtype |= ZFS_TYPE_VOLUME;
|
||||
}
|
||||
|
||||
for (i = 0; i < argc; i++) {
|
||||
for (int i = 0; i < argc; i++) {
|
||||
if (flags & ZFS_ITER_ARGS_CAN_BE_PATHS) {
|
||||
zhp = zfs_path_to_zhandle(g_zfs, argv[i],
|
||||
argtype);
|
||||
|
||||
@@ -278,7 +278,7 @@ get_vdev_name(nvlist_t *nvroot, const char *parent_name)
|
||||
vdev_type);
|
||||
} else {
|
||||
(void) snprintf(vdev_name, sizeof (vdev_name),
|
||||
"%s/%s-%llu",
|
||||
"%.220s/%s-%llu",
|
||||
parent_name, vdev_type, (u_longlong_t)vdev_id);
|
||||
}
|
||||
return (vdev_name);
|
||||
|
||||
Reference in New Issue
Block a user