]> git.proxmox.com Git - mirror_zfs.git/blame - include/zpios-internal.h
cstyle: Resolve C style issues
[mirror_zfs.git] / include / zpios-internal.h
CommitLineData
d1d7e268 1/*
302ef151
BB
2 * ZPIOS is a heavily modified version of the original PIOS test code.
3 * It is designed to have the test code running in the Linux kernel
4 * against ZFS while still being flexibly controled from user space.
5 *
6 * Copyright (C) 2008-2010 Lawrence Livermore National Security, LLC.
7 * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
8 * Written by Brian Behlendorf <behlendorf1@llnl.gov>.
9 * LLNL-CODE-403049
10 *
11 * Original PIOS Test Code
12 * Copyright (C) 2004 Cluster File Systems, Inc.
13 * Written by Peter Braam <braam@clusterfs.com>
14 * Atul Vidwansa <atul@clusterfs.com>
15 * Milind Dumbare <milind@clusterfs.com>
16 *
17 * This file is part of ZFS on Linux.
92db59ca 18 * For details, see <http://zfsonlinux.org/>.
302ef151
BB
19 *
20 * ZPIOS is free software; you can redistribute it and/or modify it
21 * under the terms of the GNU General Public License as published by the
22 * Free Software Foundation; either version 2 of the License, or (at your
23 * option) any later version.
24 *
25 * ZPIOS is distributed in the hope that it will be useful, but WITHOUT
26 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
27 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
28 * for more details.
29 *
30 * You should have received a copy of the GNU General Public License along
31 * with ZPIOS. If not, see <http://www.gnu.org/licenses/>.
d1d7e268 32 */
302ef151
BB
33
34#ifndef _ZPIOS_INTERNAL_H
d1d7e268 35#define _ZPIOS_INTERNAL_H
302ef151
BB
36
37#include "zpios-ctl.h"
38
d1d7e268 39#define OBJ_SIZE 64
302ef151
BB
40
41struct run_args;
42
43typedef struct dmu_obj {
44 objset_t *os;
45 uint64_t obj;
46} dmu_obj_t;
47
48/* thread doing the IO data */
49typedef struct thread_data {
50 struct run_args *run_args;
51 int thread_no;
52 int rc;
53 zpios_stats_t stats;
d1d7e268 54 kmutex_t lock;
302ef151
BB
55} thread_data_t;
56
57/* region for IO data */
58typedef struct zpios_region {
59 __u64 wr_offset;
60 __u64 rd_offset;
61 __u64 init_offset;
62 __u64 max_offset;
63 dmu_obj_t obj;
64 zpios_stats_t stats;
d1d7e268 65 kmutex_t lock;
302ef151
BB
66} zpios_region_t;
67
68/* arguments for one run */
69typedef struct run_args {
70 /* Config args */
71 int id;
72 char pool[ZPIOS_NAME_SIZE];
73 __u64 chunk_size;
74 __u32 thread_count;
75 __u32 region_count;
76 __u64 region_size;
77 __u64 offset;
78 __u32 region_noise;
79 __u32 chunk_noise;
80 __u32 thread_delay;
81 __u32 flags;
82 char pre[ZPIOS_PATH_SIZE];
83 char post[ZPIOS_PATH_SIZE];
84 char log[ZPIOS_PATH_SIZE];
85
86 /* Control data */
87 objset_t *os;
d1d7e268 88 wait_queue_head_t waitq;
302ef151 89 volatile uint64_t threads_done;
d1d7e268 90 kmutex_t lock_work;
302ef151
BB
91 kmutex_t lock_ctl;
92 __u32 region_next;
93
94 /* Results data */
95 struct file *file;
96 zpios_stats_t stats;
97
98 thread_data_t **threads;
99 zpios_region_t regions[0]; /* Must be last element */
100} run_args_t;
101
d1d7e268
MK
102#define ZPIOS_INFO_BUFFER_SIZE 65536
103#define ZPIOS_INFO_BUFFER_REDZONE 1024
302ef151
BB
104
105typedef struct zpios_info {
d1d7e268
MK
106 spinlock_t info_lock;
107 int info_size;
108 char *info_buffer;
109 char *info_head; /* Internal kernel use only */
302ef151
BB
110} zpios_info_t;
111
302ef151 112#endif /* _ZPIOS_INTERNAL_H */