aboutsummaryrefslogtreecommitdiffstats
path: root/include/sys
diff options
context:
space:
mode:
authorMichael Kjorling <[email protected]>2013-11-01 20:26:11 +0100
committerBrian Behlendorf <[email protected]>2013-12-18 16:46:35 -0800
commitd1d7e2689db9e03f11c069ebc9f1ba12829e5dac (patch)
tree75b9a2b23334d5f673fb31f142f74146d351865c /include/sys
parent8ffef572ed2ba97e0c2d6a8aa2240012e611dc6f (diff)
cstyle: Resolve C style issues
The vast majority of these changes are in Linux specific code. They are the result of not having an automated style checker to validate the code when it was originally written. Others were caused when the common code was slightly adjusted for Linux. This patch contains no functional changes. It only refreshes the code to conform to style guide. Everyone submitting patches for inclusion upstream should now run 'make checkstyle' and resolve any warning prior to opening a pull request. The automated builders have been updated to fail a build if when 'make checkstyle' detects an issue. Signed-off-by: Brian Behlendorf <[email protected]> Closes #1821
Diffstat (limited to 'include/sys')
-rw-r--r--include/sys/dmu_tx.h4
-rw-r--r--include/sys/fm/fs/zfs.h2
-rw-r--r--include/sys/fm/util.h18
-rw-r--r--include/sys/fs/zfs.h2
-rw-r--r--include/sys/vdev_disk.h2
-rw-r--r--include/sys/zfs_context.h4
-rw-r--r--include/sys/zfs_debug.h4
-rw-r--r--include/sys/zfs_delay.h2
-rw-r--r--include/sys/zfs_ioctl.h2
-rw-r--r--include/sys/zfs_sa.h4
-rw-r--r--include/sys/zfs_vfsops.h4
-rw-r--r--include/sys/zfs_znode.h4
-rw-r--r--include/sys/zil.h4
-rw-r--r--include/sys/zil_impl.h2
-rw-r--r--include/sys/zio.h2
-rw-r--r--include/sys/zpl.h23
16 files changed, 42 insertions, 41 deletions
diff --git a/include/sys/dmu_tx.h b/include/sys/dmu_tx.h
index f6a62af4b..59a147402 100644
--- a/include/sys/dmu_tx.h
+++ b/include/sys/dmu_tx.h
@@ -142,9 +142,9 @@ typedef struct dmu_tx_stats {
extern dmu_tx_stats_t dmu_tx_stats;
-#define DMU_TX_STAT_INCR(stat, val) \
+#define DMU_TX_STAT_INCR(stat, val) \
atomic_add_64(&dmu_tx_stats.stat.value.ui64, (val));
-#define DMU_TX_STAT_BUMP(stat) \
+#define DMU_TX_STAT_BUMP(stat) \
DMU_TX_STAT_INCR(stat, 1);
/*
diff --git a/include/sys/fm/fs/zfs.h b/include/sys/fm/fs/zfs.h
index 741b99e62..d9122ac5f 100644
--- a/include/sys/fm/fs/zfs.h
+++ b/include/sys/fm/fs/zfs.h
@@ -39,7 +39,7 @@ extern "C" {
#define FM_EREPORT_ZFS_CONFIG_SYNC "config.sync"
#define FM_EREPORT_ZFS_POOL "zpool"
#define FM_EREPORT_ZFS_POOL_DESTROY "zpool.destroy"
-#define FM_EREPORT_ZFS_POOL_REGUID "zpool.reguid"
+#define FM_EREPORT_ZFS_POOL_REGUID "zpool.reguid"
#define FM_EREPORT_ZFS_DEVICE_UNKNOWN "vdev.unknown"
#define FM_EREPORT_ZFS_DEVICE_OPEN_FAILED "vdev.open_failed"
#define FM_EREPORT_ZFS_DEVICE_CORRUPT_DATA "vdev.corrupt_data"
diff --git a/include/sys/fm/util.h b/include/sys/fm/util.h
index a3a8c3f86..2f03d1011 100644
--- a/include/sys/fm/util.h
+++ b/include/sys/fm/util.h
@@ -71,22 +71,22 @@ typedef struct erpt_dump {
#ifdef _KERNEL
-#define ZEVENT_SHUTDOWN 0x1
+#define ZEVENT_SHUTDOWN 0x1
typedef void zevent_cb_t(nvlist_t *, nvlist_t *);
typedef struct zevent_s {
- nvlist_t *ev_nvl; /* protected by the zevent_lock */
- nvlist_t *ev_detector; /* " */
- list_t ev_ze_list; /* " */
- list_node_t ev_node; /* " */
- zevent_cb_t *ev_cb; /* " */
+ nvlist_t *ev_nvl; /* protected by the zevent_lock */
+ nvlist_t *ev_detector; /* " */
+ list_t ev_ze_list; /* " */
+ list_node_t ev_node; /* " */
+ zevent_cb_t *ev_cb; /* " */
} zevent_t;
typedef struct zfs_zevent {
- zevent_t *ze_zevent; /* protected by the zevent_lock */
- list_node_t ze_node; /* " */
- uint64_t ze_dropped; /* " */
+ zevent_t *ze_zevent; /* protected by the zevent_lock */
+ list_node_t ze_node; /* " */
+ uint64_t ze_dropped; /* " */
} zfs_zevent_t;
extern void fm_init(void);
diff --git a/include/sys/fs/zfs.h b/include/sys/fs/zfs.h
index b19ebb6fe..cfcc78b80 100644
--- a/include/sys/fs/zfs.h
+++ b/include/sys/fs/zfs.h
@@ -859,7 +859,7 @@ typedef enum zfs_ioc {
/*
* zvol ioctl to get dataset name
*/
-#define BLKZNAME _IOR(0x12,125,char[ZFS_MAXNAMELEN])
+#define BLKZNAME _IOR(0x12, 125, char[ZFS_MAXNAMELEN])
/*
* Internal SPA load state. Used by FMA diagnosis engine.
diff --git a/include/sys/vdev_disk.h b/include/sys/vdev_disk.h
index daefed718..d5a1889d2 100644
--- a/include/sys/vdev_disk.h
+++ b/include/sys/vdev_disk.h
@@ -26,7 +26,7 @@
*/
#ifndef _SYS_VDEV_DISK_H
-#define _SYS_VDEV_DISK_H
+#define _SYS_VDEV_DISK_H
#ifdef _KERNEL
#include <sys/vdev.h>
diff --git a/include/sys/zfs_context.h b/include/sys/zfs_context.h
index 3fd9e1be0..fa12cea53 100644
--- a/include/sys/zfs_context.h
+++ b/include/sys/zfs_context.h
@@ -225,7 +225,7 @@ typedef void (*thread_func_t)(void *);
typedef void (*thread_func_arg_t)(void *);
typedef pthread_t kt_did_t;
-#define kpreempt(x) ((void)0)
+#define kpreempt(x) ((void)0)
typedef struct kthread {
kt_did_t t_tid;
@@ -711,7 +711,7 @@ void ksiddomain_rele(ksiddomain_t *);
#define ddi_log_sysevent(_a, _b, _c, _d, _e, _f, _g) \
sysevent_post_event(_c, _d, _b, "libzpool", _e, _f)
-#define zfs_sleep_until(wakeup) \
+#define zfs_sleep_until(wakeup) \
do { \
hrtime_t delta = wakeup - gethrtime(); \
struct timespec ts; \
diff --git a/include/sys/zfs_debug.h b/include/sys/zfs_debug.h
index 1013009fd..e51207955 100644
--- a/include/sys/zfs_debug.h
+++ b/include/sys/zfs_debug.h
@@ -75,7 +75,7 @@ extern int zfs_recover;
* filtered based on the zfs_flags variable.
*/
#else
-#define dprintf(...) \
+#define dprintf(...) \
if (zfs_flags & ZFS_DEBUG_DPRINTF) \
__dprintf(__FILE__, __func__, __LINE__, __VA_ARGS__)
@@ -92,7 +92,7 @@ typedef struct zfs_dbgmsg {
extern void zfs_dbgmsg_init(void);
extern void zfs_dbgmsg_fini(void);
#if defined(_KERNEL) && defined(__linux__)
-#define zfs_dbgmsg(...) dprintf(__VA_ARGS__)
+#define zfs_dbgmsg(...) dprintf(__VA_ARGS__)
#else
extern void zfs_dbgmsg(const char *fmt, ...);
extern void zfs_dbgmsg_print(const char *tag);
diff --git a/include/sys/zfs_delay.h b/include/sys/zfs_delay.h
index 4c7663117..b56a7daa7 100644
--- a/include/sys/zfs_delay.h
+++ b/include/sys/zfs_delay.h
@@ -27,7 +27,7 @@
/*
* Generic wrapper to sleep until a given time.
*/
-#define zfs_sleep_until(wakeup) \
+#define zfs_sleep_until(wakeup) \
do { \
hrtime_t delta = wakeup - gethrtime(); \
\
diff --git a/include/sys/zfs_ioctl.h b/include/sys/zfs_ioctl.h
index 52557d210..dad611328 100644
--- a/include/sys/zfs_ioctl.h
+++ b/include/sys/zfs_ioctl.h
@@ -368,7 +368,7 @@ enum zfsdev_state_type {
};
typedef struct zfsdev_state {
- list_node_t zs_next; /* next zfsdev_state_t link */
+ list_node_t zs_next; /* next zfsdev_state_t link */
struct file *zs_file; /* associated file struct */
minor_t zs_minor; /* made up minor number */
void *zs_onexit; /* onexit data */
diff --git a/include/sys/zfs_sa.h b/include/sys/zfs_sa.h
index 0bac7808a..735d4b32a 100644
--- a/include/sys/zfs_sa.h
+++ b/include/sys/zfs_sa.h
@@ -128,8 +128,8 @@ typedef struct znode_phys {
#ifdef _KERNEL
-#define DXATTR_MAX_ENTRY_SIZE (32768)
-#define DXATTR_MAX_SA_SIZE (SPA_MAXBLOCKSIZE >> 1)
+#define DXATTR_MAX_ENTRY_SIZE (32768)
+#define DXATTR_MAX_SA_SIZE (SPA_MAXBLOCKSIZE >> 1)
int zfs_sa_readlink(struct znode *, uio_t *);
void zfs_sa_symlink(struct znode *, char *link, int len, dmu_tx_t *);
diff --git a/include/sys/zfs_vfsops.h b/include/sys/zfs_vfsops.h
index c9e9ba7f9..7dca3369d 100644
--- a/include/sys/zfs_vfsops.h
+++ b/include/sys/zfs_vfsops.h
@@ -70,7 +70,7 @@ typedef struct zfs_sb {
krwlock_t z_teardown_inactive_lock;
list_t z_all_znodes; /* all znodes in the fs */
uint64_t z_nr_znodes; /* number of znodes in the fs */
- unsigned long z_rollback_time;/* last online rollback time */
+ unsigned long z_rollback_time; /* last online rollback time */
kmutex_t z_znodes_lock; /* lock for z_all_znodes */
struct inode *z_ctldir; /* .zfs directory inode */
avl_tree_t z_ctldir_snaps; /* .zfs/snapshot entries */
@@ -102,7 +102,7 @@ typedef struct zfs_sb {
* this the inode->i_nlink member is defined as an unsigned int. To be
* safe we use 2^31-1 as the limit.
*/
-#define ZFS_LINK_MAX ((1U << 31) - 1U)
+#define ZFS_LINK_MAX ((1U << 31) - 1U)
/*
* Normal filesystems (those not under .zfs/snapshot) have a total
diff --git a/include/sys/zfs_znode.h b/include/sys/zfs_znode.h
index 620244556..4b70f7d0c 100644
--- a/include/sys/zfs_znode.h
+++ b/include/sys/zfs_znode.h
@@ -210,8 +210,8 @@ typedef struct znode {
kmutex_t z_acl_lock; /* acl data lock */
zfs_acl_t *z_acl_cached; /* cached acl */
krwlock_t z_xattr_lock; /* xattr data lock */
- nvlist_t *z_xattr_cached;/* cached xattrs */
- struct znode *z_xattr_parent;/* xattr parent znode */
+ nvlist_t *z_xattr_cached; /* cached xattrs */
+ struct znode *z_xattr_parent; /* xattr parent znode */
list_node_t z_link_node; /* all znodes in fs link */
sa_handle_t *z_sa_hdl; /* handle to sa data */
boolean_t z_is_sa; /* are we native sa? */
diff --git a/include/sys/zil.h b/include/sys/zil.h
index b6718b93c..400074270 100644
--- a/include/sys/zil.h
+++ b/include/sys/zil.h
@@ -430,9 +430,9 @@ typedef struct zil_stats {
extern zil_stats_t zil_stats;
-#define ZIL_STAT_INCR(stat, val) \
+#define ZIL_STAT_INCR(stat, val) \
atomic_add_64(&zil_stats.stat.value.ui64, (val));
-#define ZIL_STAT_BUMP(stat) \
+#define ZIL_STAT_BUMP(stat) \
ZIL_STAT_INCR(stat, 1);
typedef int zil_parse_blk_func_t(zilog_t *zilog, blkptr_t *bp, void *arg,
diff --git a/include/sys/zil_impl.h b/include/sys/zil_impl.h
index f5b69b7ed..0db4b525c 100644
--- a/include/sys/zil_impl.h
+++ b/include/sys/zil_impl.h
@@ -41,7 +41,7 @@ extern "C" {
typedef struct lwb {
zilog_t *lwb_zilog; /* back pointer to log struct */
blkptr_t lwb_blk; /* on disk address of this log blk */
- boolean_t lwb_fastwrite; /* is blk marked for fastwrite? */
+ boolean_t lwb_fastwrite; /* is blk marked for fastwrite? */
int lwb_nused; /* # used bytes in buffer */
int lwb_sz; /* size of block and buffer */
char *lwb_buf; /* log write buffer */
diff --git a/include/sys/zio.h b/include/sys/zio.h
index cfb256f0f..d4350badc 100644
--- a/include/sys/zio.h
+++ b/include/sys/zio.h
@@ -124,7 +124,7 @@ enum zio_compress {
/*
* Default Linux timeout for a sd device.
*/
-#define ZIO_DELAY_MAX (30 * MILLISEC)
+#define ZIO_DELAY_MAX (30 * MILLISEC)
#define ZIO_FAILURE_MODE_WAIT 0
#define ZIO_FAILURE_MODE_CONTINUE 1
diff --git a/include/sys/zpl.h b/include/sys/zpl.h
index 5a7e23d46..56bd9ae5e 100644
--- a/include/sys/zpl.h
+++ b/include/sys/zpl.h
@@ -77,7 +77,7 @@ extern int zpl_set_acl(struct inode *ip, int type, struct posix_acl *acl);
extern struct posix_acl *zpl_get_acl(struct inode *ip, int type);
#if !defined(HAVE_GET_ACL)
#if defined(HAVE_CHECK_ACL_WITH_FLAGS)
-extern int zpl_check_acl(struct inode *inode, int mask,unsigned int flags);
+extern int zpl_check_acl(struct inode *inode, int mask, unsigned int flags);
#elif defined(HAVE_CHECK_ACL)
extern int zpl_check_acl(struct inode *inode, int mask);
#elif defined(HAVE_PERMISSION_WITH_NAMEIDATA)
@@ -122,7 +122,7 @@ extern const struct inode_operations zpl_ops_shares;
#ifdef HAVE_VFS_ITERATE
-#define DIR_CONTEXT_INIT(_dirent, _actor, _pos) { \
+#define DIR_CONTEXT_INIT(_dirent, _actor, _pos) { \
.actor = _actor, \
.pos = _pos, \
}
@@ -135,7 +135,7 @@ typedef struct dir_context {
loff_t pos;
} dir_context_t;
-#define DIR_CONTEXT_INIT(_dirent, _actor, _pos) { \
+#define DIR_CONTEXT_INIT(_dirent, _actor, _pos) { \
.dirent = _dirent, \
.actor = _actor, \
.pos = _pos, \
@@ -145,21 +145,22 @@ static inline bool
dir_emit(struct dir_context *ctx, const char *name, int namelen,
uint64_t ino, unsigned type)
{
- return ctx->actor(ctx->dirent, name, namelen, ctx->pos, ino, type) == 0;
+ return (ctx->actor(ctx->dirent, name, namelen, ctx->pos, ino, type)
+ == 0);
}
static inline bool
dir_emit_dot(struct file *file, struct dir_context *ctx)
{
- return ctx->actor(ctx->dirent, ".", 1, ctx->pos,
- file->f_path.dentry->d_inode->i_ino, DT_DIR) == 0;
+ return (ctx->actor(ctx->dirent, ".", 1, ctx->pos,
+ file->f_path.dentry->d_inode->i_ino, DT_DIR) == 0);
}
static inline bool
dir_emit_dotdot(struct file *file, struct dir_context *ctx)
{
- return ctx->actor(ctx->dirent, "..", 2, ctx->pos,
- parent_ino(file->f_path.dentry), DT_DIR) == 0;
+ return (ctx->actor(ctx->dirent, "..", 2, ctx->pos,
+ parent_ino(file->f_path.dentry), DT_DIR) == 0);
}
static inline bool
@@ -167,15 +168,15 @@ dir_emit_dots(struct file *file, struct dir_context *ctx)
{
if (ctx->pos == 0) {
if (!dir_emit_dot(file, ctx))
- return false;
+ return (false);
ctx->pos = 1;
}
if (ctx->pos == 1) {
if (!dir_emit_dotdot(file, ctx))
- return false;
+ return (false);
ctx->pos = 2;
}
- return true;
+ return (true);
}
#endif /* HAVE_VFS_ITERATE */