diff options
author | Michael Kjorling <[email protected]> | 2013-11-01 20:26:11 +0100 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2013-12-18 16:46:35 -0800 |
commit | d1d7e2689db9e03f11c069ebc9f1ba12829e5dac (patch) | |
tree | 75b9a2b23334d5f673fb31f142f74146d351865c /include/zpios-internal.h | |
parent | 8ffef572ed2ba97e0c2d6a8aa2240012e611dc6f (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/zpios-internal.h')
-rw-r--r-- | include/zpios-internal.h | 54 |
1 files changed, 14 insertions, 40 deletions
diff --git a/include/zpios-internal.h b/include/zpios-internal.h index 24a2febb2..4b99b4ce3 100644 --- a/include/zpios-internal.h +++ b/include/zpios-internal.h @@ -1,4 +1,4 @@ -/*****************************************************************************\ +/* * ZPIOS is a heavily modified version of the original PIOS test code. * It is designed to have the test code running in the Linux kernel * against ZFS while still being flexibly controled from user space. @@ -29,14 +29,14 @@ * * You should have received a copy of the GNU General Public License along * with ZPIOS. If not, see <http://www.gnu.org/licenses/>. -\*****************************************************************************/ + */ #ifndef _ZPIOS_INTERNAL_H -#define _ZPIOS_INTERNAL_H +#define _ZPIOS_INTERNAL_H #include "zpios-ctl.h" -#define OBJ_SIZE 64 +#define OBJ_SIZE 64 struct run_args; @@ -51,7 +51,7 @@ typedef struct thread_data { int thread_no; int rc; zpios_stats_t stats; - kmutex_t lock; + kmutex_t lock; } thread_data_t; /* region for IO data */ @@ -62,7 +62,7 @@ typedef struct zpios_region { __u64 max_offset; dmu_obj_t obj; zpios_stats_t stats; - kmutex_t lock; + kmutex_t lock; } zpios_region_t; /* arguments for one run */ @@ -85,9 +85,9 @@ typedef struct run_args { /* Control data */ objset_t *os; - wait_queue_head_t waitq; + wait_queue_head_t waitq; volatile uint64_t threads_done; - kmutex_t lock_work; + kmutex_t lock_work; kmutex_t lock_ctl; __u32 region_next; @@ -99,40 +99,14 @@ typedef struct run_args { zpios_region_t regions[0]; /* Must be last element */ } run_args_t; -#define ZPIOS_INFO_BUFFER_SIZE 65536 -#define ZPIOS_INFO_BUFFER_REDZONE 1024 +#define ZPIOS_INFO_BUFFER_SIZE 65536 +#define ZPIOS_INFO_BUFFER_REDZONE 1024 typedef struct zpios_info { - spinlock_t info_lock; - int info_size; - char *info_buffer; - char *info_head; /* Internal kernel use only */ + spinlock_t info_lock; + int info_size; + char *info_buffer; + char *info_head; /* Internal kernel use only */ } zpios_info_t; -#define zpios_print(file, format, args...) \ -({ zpios_info_t *_info_ = (zpios_info_t *)file->private_data; \ - int _rc_; \ - \ - ASSERT(_info_); \ - ASSERT(_info_->info_buffer); \ - \ - spin_lock(&_info_->info_lock); \ - \ - /* Don't allow the kernel to start a write in the red zone */ \ - if ((int)(_info_->info_head - _info_->info_buffer) > \ - (_info_->info_size - ZPIOS_INFO_BUFFER_REDZONE)) { \ - _rc_ = -EOVERFLOW; \ - } else { \ - _rc_ = sprintf(_info_->info_head, format, args); \ - if (_rc_ >= 0) \ - _info_->info_head += _rc_; \ - } \ - \ - spin_unlock(&_info_->info_lock); \ - _rc_; \ -}) - -#define zpios_vprint(file, test, format, args...) \ - zpios_print(file, "%*s: " format, ZPIOS_NAME_SIZE, test, args) - #endif /* _ZPIOS_INTERNAL_H */ |