]> git.proxmox.com Git - mirror_zfs.git/blobdiff - lib/libzfs/libzfs_pool.c
cstyle: Resolve C style issues
[mirror_zfs.git] / lib / libzfs / libzfs_pool.c
index ccaa86beaf90a0592d5094074a3aa8d11b0485e8..b822ace688c950b5570c57a44a2c230e33f9db08 100644 (file)
@@ -242,7 +242,7 @@ int
 zpool_get_prop(zpool_handle_t *zhp, zpool_prop_t prop, char *buf, size_t len,
     zprop_source_t *srctype)
 {
-    return zpool_get_prop_literal(zhp, prop, buf, len, srctype, B_FALSE);
+       return (zpool_get_prop_literal(zhp, prop, buf, len, srctype, B_FALSE));
 }
 
 /*
@@ -250,8 +250,8 @@ zpool_get_prop(zpool_handle_t *zhp, zpool_prop_t prop, char *buf, size_t len,
  * a pre-allocated buffer.
  */
 int
-zpool_get_prop_literal(zpool_handle_t *zhp, zpool_prop_t prop, char *buf, size_t len,
-    zprop_source_t *srctype, boolean_t literal)
+zpool_get_prop_literal(zpool_handle_t *zhp, zpool_prop_t prop, char *buf,
+    size_t len, zprop_source_t *srctype, boolean_t literal)
 {
        uint64_t intval;
        const char *strval;
@@ -1222,8 +1222,9 @@ zpool_create(libzfs_handle_t *hdl, const char *pool, nvlist_t *nvroot,
                         * part of an active md or lvm device.
                         */
                        zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "one or more vdevs refer to the same device, or one of\n"
-                           "the devices is part of an active md or lvm device"));
+                           "one or more vdevs refer to the same device, or "
+                           "one of\nthe devices is part of an active md or "
+                           "lvm device"));
                        return (zfs_error(hdl, EZFS_BADDEV, msg));
 
                case EOVERFLOW:
@@ -2427,7 +2428,7 @@ zpool_vdev_online(zpool_handle_t *zhp, const char *path, int flags,
 
                        if (path[0] != '/') {
                                error = zfs_resolve_shortname(path, buf,
-                                   sizeof(buf));
+                                   sizeof (buf));
                                if (error != 0)
                                        return (zfs_error(hdl, EZFS_NODEVICE,
                                            msg));
@@ -2519,7 +2520,7 @@ zpool_vdev_fault(zpool_handle_t *zhp, uint64_t guid, vdev_aux_t aux)
        libzfs_handle_t *hdl = zhp->zpool_hdl;
 
        (void) snprintf(msg, sizeof (msg),
-           dgettext(TEXT_DOMAIN, "cannot fault %llu"), (u_longlong_t)guid);
+           dgettext(TEXT_DOMAIN, "cannot fault %llu"), (u_longlong_t)guid);
 
        (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name));
        zc.zc_guid = guid;
@@ -2554,7 +2555,7 @@ zpool_vdev_degrade(zpool_handle_t *zhp, uint64_t guid, vdev_aux_t aux)
        libzfs_handle_t *hdl = zhp->zpool_hdl;
 
        (void) snprintf(msg, sizeof (msg),
-           dgettext(TEXT_DOMAIN, "cannot degrade %llu"), (u_longlong_t)guid);
+           dgettext(TEXT_DOMAIN, "cannot degrade %llu"), (u_longlong_t)guid);
 
        (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name));
        zc.zc_guid = guid;
@@ -3215,7 +3216,7 @@ zpool_vdev_clear(zpool_handle_t *zhp, uint64_t guid)
 
        (void) snprintf(msg, sizeof (msg),
            dgettext(TEXT_DOMAIN, "cannot clear errors for %llx"),
-           (u_longlong_t)guid);
+           (u_longlong_t)guid);
 
        (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name));
        zc.zc_guid = guid;
@@ -3460,7 +3461,7 @@ zpool_vdev_name(libzfs_handle_t *hdl, zpool_handle_t *zhp, nvlist_t *nv,
                 */
                if (nvlist_lookup_uint64(nv, ZPOOL_CONFIG_WHOLE_DISK,
                    &value) == 0 && value) {
-                       return strip_partition(hdl, path);
+                       return (strip_partition(hdl, path));
                }
        } else {
                verify(nvlist_lookup_string(nv, ZPOOL_CONFIG_TYPE, &path) == 0);
@@ -3880,7 +3881,8 @@ zpool_obj_to_path(zpool_handle_t *zhp, uint64_t dsobj, uint64_t obj,
 
        if (dsobj == 0) {
                /* special case for the MOS */
-               (void) snprintf(pathname, len, "<metadata>:<0x%llx>", (longlong_t)obj);
+               (void) snprintf(pathname, len, "<metadata>:<0x%llx>",
+                   (longlong_t)obj);
                return;
        }
 
@@ -3912,7 +3914,8 @@ zpool_obj_to_path(zpool_handle_t *zhp, uint64_t dsobj, uint64_t obj,
                            dsname, zc.zc_value);
                }
        } else {
-               (void) snprintf(pathname, len, "%s:<0x%llx>", dsname, (longlong_t)obj);
+               (void) snprintf(pathname, len, "%s:<0x%llx>", dsname,
+                   (longlong_t)obj);
        }
        free(mntpnt);
 }
@@ -4012,22 +4015,22 @@ zpool_label_disk_check(char *path)
        int fd, err;
 
        if ((fd = open(path, O_RDWR|O_DIRECT)) < 0)
-               return errno;
+               return (errno);
 
        if ((err = efi_alloc_and_read(fd, &vtoc)) != 0) {
                (void) close(fd);
-               return err;
+               return (err);
        }
 
        if (vtoc->efi_flags & EFI_GPT_PRIMARY_CORRUPT) {
                efi_free(vtoc);
                (void) close(fd);
-               return EIDRM;
+               return (EIDRM);
        }
 
        efi_free(vtoc);
        (void) close(fd);
-       return 0;
+       return (0);
 }
 
 /*
@@ -4167,5 +4170,5 @@ zpool_label_disk(libzfs_handle_t *hdl, zpool_handle_t *zhp, char *name)
                return (zfs_error(hdl, EZFS_LABELFAILED, errbuf));
        }
 
-       return 0;
+       return (0);
 }