Skip to content
Permalink
Browse files

6328 Fix cstyle errors in zfs codebase

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Alex Reece <alex@delphix.com>
Reviewed by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed by: Jorgen Lundman <lundman@lundman.net>
Approved by: Robert Mustacchi <rm@joyent.com>
  • Loading branch information
pcd1193182 authored and ahrens committed Oct 18, 2015
1 parent 2122794 commit 9a686fbc186e8e2a64e9a5094d44c7d6fa0ea167
@@ -22,6 +22,7 @@
/*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2014 Nexenta Systems, Inc. All rights reserved.
* Copyright (c) 2015 by Delphix. All rights reserved.
*/

/*
@@ -3120,7 +3121,7 @@ install_func(int argc, char *argv[])

static void
warn_dev_match(zone_dochandle_t s_handle, char *source_zone,
zone_dochandle_t t_handle, char *target_zone)
zone_dochandle_t t_handle, char *target_zone)
{
int err;
struct zone_devtab s_devtab;
@@ -3242,7 +3243,7 @@ print_fs_warnings(struct zone_fstab *s_fstab, struct zone_fstab *t_fstab)

static void
warn_fs_match(zone_dochandle_t s_handle, char *source_zone,
zone_dochandle_t t_handle, char *target_zone)
zone_dochandle_t t_handle, char *target_zone)
{
int err;
struct zone_fstab s_fstab;
@@ -3286,7 +3287,7 @@ warn_fs_match(zone_dochandle_t s_handle, char *source_zone,
*/
static void
warn_ip_match(zone_dochandle_t s_handle, char *source_zone,
zone_dochandle_t t_handle, char *target_zone)
zone_dochandle_t t_handle, char *target_zone)
{
int err;
struct zone_nwiftab s_nwiftab;
@@ -3341,7 +3342,7 @@ warn_ip_match(zone_dochandle_t s_handle, char *source_zone,

static void
warn_dataset_match(zone_dochandle_t s_handle, char *source,
zone_dochandle_t t_handle, char *target)
zone_dochandle_t t_handle, char *target)
{
int err;
struct zone_dstab s_dstab;
@@ -3505,7 +3506,8 @@ copy_zone(char *src, char *dst)

/* ARGSUSED */
int
zfm_print(const struct mnttab *p, void *r) {
zfm_print(const struct mnttab *p, void *r)
{
zerror(" %s\n", p->mnt_mountp);
return (0);
}
@@ -22,6 +22,7 @@
/*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, Joyent Inc. All rights reserved.
* Copyright (c) 2015 by Delphix. All rights reserved.
*/

/*
@@ -4292,7 +4293,8 @@ remove_mlps(zlog_t *zlogp, zoneid_t zoneid)
}

int
prtmount(const struct mnttab *fs, void *x) {
prtmount(const struct mnttab *fs, void *x)
{
zerror((zlog_t *)x, B_FALSE, " %s", fs->mnt_mountp);
return (0);
}
@@ -192,7 +192,8 @@ static boolean_t log_history = B_TRUE;
static uint_t timestamp_fmt = NODATE;

static const char *
get_usage(zpool_help_t idx) {
get_usage(zpool_help_t idx)
{
switch (idx) {
case HELP_ADD:
return (gettext("\tadd [-fn] <pool> <vdev> ...\n"));
@@ -24,11 +24,13 @@
* Use is subject to license terms.
*/

/*
* Copyright (c) 2015 by Delphix. All rights reserved.
*/

#ifndef _P12AUX_H
#define _P12AUX_H

#pragma ident "%Z%%M% %I% %E% SMI"

#include <openssl/pkcs12.h>

#ifdef __cplusplus
@@ -42,7 +44,8 @@ extern "C" {
*
* My apologies.
*/
DECLARE_STACK_OF(EVP_PKEY)
/* LINTED */
DECLARE_STACK_OF(EVP_PKEY);

#define sk_EVP_PKEY_new_null() SKM_sk_new_null(EVP_PKEY)
#define sk_EVP_PKEY_free(st) SKM_sk_free(EVP_PKEY, (st))
@@ -118,7 +118,8 @@ zfeature_lookup_name(const char *name, spa_feature_t *res)
}

boolean_t
zfeature_depends_on(spa_feature_t fid, spa_feature_t check) {
zfeature_depends_on(spa_feature_t fid, spa_feature_t check)
{
zfeature_info_t *feature = &spa_feature_table[fid];

for (int i = 0; feature->fi_depends[i] != SPA_FEATURE_NONE; i++) {
@@ -567,7 +567,7 @@ dmu_read(dnode_phys_t *dn, uint64_t blkid, void *buf, char *stack)
*/
static int
mzap_lookup(mzap_phys_t *zapobj, int objsize, const char *name,
uint64_t *value)
uint64_t *value)
{
int i, chunks;
mzap_ent_phys_t *mzap_ent = zapobj->mz_chunk;
@@ -855,7 +855,7 @@ zap_iterate(dnode_phys_t *zap_dnode, zap_cb_t *cb, void *arg, char *stack)
*/
static int
dnode_get(dnode_phys_t *mdn, uint64_t objnum, uint8_t type, dnode_phys_t *buf,
char *stack)
char *stack)
{
uint64_t blkid, blksz; /* the block id this object dnode is in */
int epbs; /* shift of number of dnodes in a block */
@@ -21,7 +21,7 @@

/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013 by Delphix. All rights reserved.
* Copyright (c) 2013, 2015 by Delphix. All rights reserved.
* Copyright 2014 Nexenta Systems, Inc. All rights reserved.
*/

@@ -308,7 +308,8 @@ typedef struct {
} snapspec_arg_t;

static int
snapspec_cb(zfs_handle_t *zhp, void *arg) {
snapspec_cb(zfs_handle_t *zhp, void *arg)
{
snapspec_arg_t *ssa = arg;
char *shortsnapname;
int err = 0;
@@ -22,7 +22,7 @@
/*
* Copyright 2015 Nexenta Systems, Inc. All rights reserved.
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2014 by Delphix. All rights reserved.
* Copyright (c) 2011, 2015 by Delphix. All rights reserved.
* Copyright (c) 2013, Joyent, Inc. All rights reserved.
*/

@@ -1855,7 +1855,8 @@ zpool_scan(zpool_handle_t *zhp, pool_scan_func_t func)
* and the like.
*/
static int
ctd_check_path(char *str) {
ctd_check_path(char *str)
{
/*
* If it starts with a slash, check the last component.
*/
@@ -22,7 +22,7 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, Joyent, Inc. All rights reserved.
* Copyright (c) 2011, 2014 by Delphix. All rights reserved.
* Copyright (c) 2011, 2015 by Delphix. All rights reserved.
*/

/*
@@ -1518,7 +1518,8 @@ zprop_iter(zprop_func func, void *cb, boolean_t show_all, boolean_t ordered,
* and bs are undefined.
*/
int
zfs_get_hole_count(const char *path, uint64_t *count, uint64_t *bs) {
zfs_get_hole_count(const char *path, uint64_t *count, uint64_t *bs)
{
int fd, err;
struct stat64 ss;
uint64_t fill;
@@ -20,7 +20,7 @@
*/
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2014 by Delphix. All rights reserved.
* Copyright (c) 2012, 2015 by Delphix. All rights reserved.
* Copyright (c) 2013, Joyent, Inc. All rights reserved.
*/

@@ -500,7 +500,7 @@ vn_openat(char *path, int x1, int flags, int mode, vnode_t **vpp, int x2,
/*ARGSUSED*/
int
vn_rdwr(int uio, vnode_t *vp, void *addr, ssize_t len, offset_t offset,
int x1, int x2, rlim64_t x3, void *x4, ssize_t *residp)
int x1, int x2, rlim64_t x3, void *x4, ssize_t *residp)
{
ssize_t iolen, split;

@@ -1670,7 +1670,7 @@ dmu_sync(zio_t *pio, uint64_t txg, dmu_sync_cb_t *done, zgd_t *zgd)

int
dmu_object_set_blocksize(objset_t *os, uint64_t object, uint64_t size, int ibs,
dmu_tx_t *tx)
dmu_tx_t *tx)
{
dnode_t *dn;
int err;
@@ -1685,7 +1685,7 @@ dmu_object_set_blocksize(objset_t *os, uint64_t object, uint64_t size, int ibs,

void
dmu_object_set_checksum(objset_t *os, uint64_t object, uint8_t checksum,
dmu_tx_t *tx)
dmu_tx_t *tx)
{
dnode_t *dn;

@@ -1705,7 +1705,7 @@ dmu_object_set_checksum(objset_t *os, uint64_t object, uint8_t checksum,

void
dmu_object_set_compress(objset_t *os, uint64_t object, uint8_t compress,
dmu_tx_t *tx)
dmu_tx_t *tx)
{
dnode_t *dn;

@@ -1873,7 +1873,8 @@ dmu_offset_next(objset_t *os, uint64_t object, boolean_t hole, uint64_t *off)
* ID and wait for that to be synced.
*/
int
dmu_object_wait_synced(objset_t *os, uint64_t object) {
dmu_object_wait_synced(objset_t *os, uint64_t object)
{
dnode_t *dn;
int error, i;

@@ -3449,7 +3449,7 @@ dsl_dataset_space_wouldfree(dsl_dataset_t *firstsnap,
*/
boolean_t
dsl_dataset_is_before(dsl_dataset_t *later, dsl_dataset_t *earlier,
uint64_t earlier_txg)
uint64_t earlier_txg)
{
dsl_pool_t *dp = later->ds_dir->dd_pool;
int error;
@@ -23,7 +23,7 @@
* Use is subject to license terms.
*/
/*
* Copyright (c) 2013 by Delphix. All rights reserved.
* Copyright (c) 2013, 2015 by Delphix. All rights reserved.
*/

#include <sys/zfs_context.h>
@@ -103,7 +103,7 @@ space_reftree_add_node(avl_tree_t *t, uint64_t offset, int64_t refcnt)

void
space_reftree_add_seg(avl_tree_t *t, uint64_t start, uint64_t end,
int64_t refcnt)
int64_t refcnt)
{
space_reftree_add_node(t, start, refcnt);
space_reftree_add_node(t, end, -refcnt);
@@ -20,6 +20,7 @@
*/
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015 by Delphix. All rights reserved.
*/

#ifndef _SYS_ZRLOCK_H
@@ -44,12 +45,8 @@ typedef struct zrlock {

extern void zrl_init(zrlock_t *);
extern void zrl_destroy(zrlock_t *);
#ifdef ZFS_DEBUG
#define zrl_add(_z) zrl_add_debug((_z), __func__)
extern void zrl_add_debug(zrlock_t *, const char *);
#else
extern void zrl_add(zrlock_t *);
#endif
#define zrl_add(_z) zrl_add_impl((_z), __func__)
extern void zrl_add_impl(zrlock_t *, const char *);
extern void zrl_remove(zrlock_t *);
extern int zrl_tryenter(zrlock_t *);
extern void zrl_exit(zrlock_t *);
@@ -21,7 +21,7 @@

/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013 by Delphix. All rights reserved.
* Copyright (c) 2012, 2015 by Delphix. All rights reserved.
*/

/*
@@ -179,7 +179,7 @@ vdev_label_number(uint64_t psize, uint64_t offset)

static void
vdev_label_read(zio_t *zio, vdev_t *vd, int l, void *buf, uint64_t offset,
uint64_t size, zio_done_func_t *done, void *private, int flags)
uint64_t size, zio_done_func_t *done, void *private, int flags)
{
ASSERT(spa_config_held(zio->io_spa, SCL_STATE_ALL, RW_WRITER) ==
SCL_STATE_ALL);
@@ -193,7 +193,7 @@ vdev_label_read(zio_t *zio, vdev_t *vd, int l, void *buf, uint64_t offset,

static void
vdev_label_write(zio_t *zio, vdev_t *vd, int l, void *buf, uint64_t offset,
uint64_t size, zio_done_func_t *done, void *private, int flags)
uint64_t size, zio_done_func_t *done, void *private, int flags)
{
ASSERT(spa_config_held(zio->io_spa, SCL_ALL, RW_WRITER) == SCL_ALL ||
(spa_config_held(zio->io_spa, SCL_CONFIG | SCL_STATE, RW_READER) ==
@@ -20,7 +20,7 @@
*/
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2014 by Delphix. All rights reserved.
* Copyright (c) 2013, 2015 by Delphix. All rights reserved.
*/

/*
@@ -535,7 +535,7 @@ zap_entry_read_name(zap_t *zap, const zap_entry_handle_t *zeh, uint16_t buflen,

int
zap_entry_update(zap_entry_handle_t *zeh,
uint8_t integer_size, uint64_t num_integers, const void *buf)
uint8_t integer_size, uint64_t num_integers, const void *buf)
{
int delta_chunks;
zap_leaf_t *l = zeh->zeh_leaf;
@@ -269,7 +269,8 @@ feature_get_refcount_from_disk(spa_t *spa, zfeature_info_t *feature,


static int
feature_get_enabled_txg(spa_t *spa, zfeature_info_t *feature, uint64_t *res) {
feature_get_enabled_txg(spa_t *spa, zfeature_info_t *feature, uint64_t *res)
{
uint64_t enabled_txg_obj = spa->spa_feat_enabled_txg_obj;

ASSERT(zfeature_depends_on(feature->fi_feature,
@@ -489,7 +490,8 @@ spa_feature_is_active(spa_t *spa, spa_feature_t fid)
* Returns B_FALSE otherwise (i.e. if the feature is not enabled).
*/
boolean_t
spa_feature_enabled_txg(spa_t *spa, spa_feature_t fid, uint64_t *txg) {
spa_feature_enabled_txg(spa_t *spa, spa_feature_t fid, uint64_t *txg)
{
int err;

ASSERT(VALID_FEATURE_FID(fid));
@@ -20,7 +20,7 @@
*/
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2014 by Delphix. All rights reserved.
* Copyright (c) 2013, 2015 by Delphix. All rights reserved.
*/

#include <sys/types.h>
@@ -801,7 +801,7 @@ zfs_dropname(zfs_dirlock_t *dl, znode_t *zp, znode_t *dzp, dmu_tx_t *tx,
*/
int
zfs_link_destroy(zfs_dirlock_t *dl, znode_t *zp, dmu_tx_t *tx, int flag,
boolean_t *unlinkedp)
boolean_t *unlinkedp)
{
znode_t *dzp = dl->dl_dzp;
zfsvfs_t *zfsvfs = dzp->z_zfsvfs;
@@ -5544,7 +5544,7 @@ zfs_ioctl_register_dataset_read(zfs_ioc_t ioc, zfs_ioc_legacy_func_t *func)

static void
zfs_ioctl_register_dataset_modify(zfs_ioc_t ioc, zfs_ioc_legacy_func_t *func,
zfs_secpolicy_func_t *secpolicy)
zfs_secpolicy_func_t *secpolicy)
{
zfs_ioctl_register_legacy(ioc, func, secpolicy,
DATASET_NAME, B_TRUE, POOL_CHECK_SUSPENDED | POOL_CHECK_READONLY);

0 comments on commit 9a686fb

Please sign in to comment.
You can’t perform that action at this time.