#ifdef HAVE_LIBBLKID
#include <blkid/blkid.h>
#else
-#define blkid_cache void *
+#define blkid_cache void *
#endif /* HAVE_LIBBLKID */
#include "zpool_util.h"
{"ATA SAMSUNG MCCOE32G", 4096},
{"ATA SAMSUNG MCCOE64G", 4096},
{"ATA SAMSUNG SSD PM80", 4096},
- /* Imported from Open Solaris*/
+ /* Imported from Open Solaris */
{"ATA MARVELL SD88SA02", 4096},
/* Advanced format Hard drives */
{"ATA Hitachi HDS5C303", 4096},
int i;
/* Prepare INQUIRY command */
- memset(&io_hdr, 0, sizeof(sg_io_hdr_t));
+ memset(&io_hdr, 0, sizeof (sg_io_hdr_t));
io_hdr.interface_id = 'S';
- io_hdr.cmd_len = sizeof(inq_cmd_blk);
- io_hdr.mx_sb_len = sizeof(sense_buffer);
+ io_hdr.cmd_len = sizeof (inq_cmd_blk);
+ io_hdr.mx_sb_len = sizeof (sense_buffer);
io_hdr.dxfer_direction = SG_DXFER_FROM_DEV;
io_hdr.dxfer_len = INQ_REPLY_LEN;
io_hdr.dxferp = inq_buff;
io_hdr.cmdp = inq_cmd_blk;
io_hdr.sbp = sense_buffer;
- io_hdr.timeout = 10; /* 10 milliseconds is ample time */
+ io_hdr.timeout = 10; /* 10 milliseconds is ample time */
if ((fd = open(path, O_RDONLY|O_DIRECT)) < 0)
return (B_FALSE);
} else {
err = -1;
vdev_error(gettext("%s contains a filesystem of "
- "type '%s'\n"), path, value);
+ "type '%s'\n"), path, value);
}
}
*/
static int
check_disk(const char *path, blkid_cache cache, int force,
- boolean_t isspare, boolean_t iswholedisk)
+ boolean_t isspare, boolean_t iswholedisk)
{
struct dk_gpt *vtoc;
char slice_path[MAXPATHLEN];
/* This is not a wholedisk we only check the given partition */
if (!iswholedisk)
- return check_slice(path, cache, force, isspare);
+ return (check_slice(path, cache, force, isspare));
/*
* When the device is a whole disk try to read the efi partition
*/
if ((fd = open(path, O_RDONLY|O_DIRECT)) < 0) {
check_error(errno);
- return -1;
+ return (-1);
}
if ((err = efi_alloc_and_read(fd, &vtoc)) != 0) {
(void) close(fd);
if (force) {
- return 0;
+ return (0);
} else {
vdev_error(gettext("%s does not contain an EFI "
"label but it may contain partition\n"
"information in the MBR.\n"), path);
- return -1;
+ return (-1);
}
}
if (force) {
/* Partitions will no be created using the backup */
- return 0;
+ return (0);
} else {
vdev_error(gettext("%s contains a corrupt primary "
"EFI label.\n"), path);
- return -1;
+ return (-1);
}
}
static int
check_device(const char *path, boolean_t force,
- boolean_t isspare, boolean_t iswholedisk)
+ boolean_t isspare, boolean_t iswholedisk)
{
static blkid_cache cache = NULL;
if ((err = blkid_get_cache(&cache, NULL)) != 0) {
check_error(err);
- return -1;
+ return (-1);
}
if ((err = blkid_probe_all(cache)) != 0) {
blkid_put_cache(cache);
check_error(err);
- return -1;
+ return (-1);
}
}
#endif /* HAVE_LIBBLKID */
- return check_disk(path, cache, force, isspare, iswholedisk);
+ return (check_disk(path, cache, force, isspare, iswholedisk));
}
/*
is_whole_disk(const char *path)
{
struct dk_gpt *label;
- int fd;
+ int fd;
if ((fd = open(path, O_RDONLY|O_DIRECT)) < 0)
return (B_FALSE);
*/
static int
is_shorthand_path(const char *arg, char *path,
- struct stat64 *statbuf, boolean_t *wholedisk)
+ struct stat64 *statbuf, boolean_t *wholedisk)
{
int error;
return (0);
}
- strlcpy(path, arg, sizeof(path));
- memset(statbuf, 0, sizeof(*statbuf));
+ strlcpy(path, arg, sizeof (path));
+ memset(statbuf, 0, sizeof (*statbuf));
*wholedisk = B_FALSE;
return (error);
return (-1);
}
- return 0;
+ return (0);
}
/*
* and then block until udev creates the new link.
*/
if (!is_exclusive || !is_spare(NULL, udevpath)) {
- ret = strncmp(udevpath,UDISK_ROOT,strlen(UDISK_ROOT));
+ ret = strncmp(udevpath, UDISK_ROOT, strlen(UDISK_ROOT));
if (ret == 0) {
ret = lstat64(udevpath, &statbuf);
if (ret == 0 && S_ISLNK(statbuf.st_mode))
verify(!nvlist_lookup_string(nv, ZPOOL_CONFIG_PATH, &path));
if (strcmp(type, VDEV_TYPE_DISK) == 0)
verify(!nvlist_lookup_uint64(nv,
- ZPOOL_CONFIG_WHOLE_DISK, &wholedisk));
+ ZPOOL_CONFIG_WHOLE_DISK, &wholedisk));
/*
* As a generic check, we look to see if this is a replace of a
children * sizeof (nvlist_t *));
if (child == NULL)
zpool_no_memory();
- if ((nv = make_leaf_vdev(props, argv[c], B_FALSE))
- == NULL)
+ if ((nv = make_leaf_vdev(props, argv[c],
+ B_FALSE)) == NULL)
return (NULL);
child[children - 1] = nv;
}
* We have a device. Pass off to make_leaf_vdev() to
* construct the appropriate nvlist describing the vdev.
*/
- if ((nv = make_leaf_vdev(props, argv[0], is_log)) == NULL)
+ if ((nv = make_leaf_vdev(props, argv[0],
+ is_log)) == NULL)
return (NULL);
if (is_log)
nlogs++;