|
11 | 11 | #include <sys/zil_impl.h>
|
12 | 12 | #include <sys/zfs_rlock.h>
|
13 | 13 | #include <sys/spa_impl.h>
|
14 |
| -#include <sys/zvol_impl.h> |
15 |
| - |
| 14 | +#include <sys/zvol.h> |
| 15 | +#include <sys/dataset_kstats.h> |
16 | 16 |
|
17 | 17 | #define ZVOL_WCE 0x8
|
18 | 18 | #define ZVOL_READ 1
|
|
28 | 28 | #define POOL (OPTARG)
|
29 | 29 | #endif
|
30 | 30 |
|
| 31 | +/* |
| 32 | + * Copied and duplicated from "module/zfs/zvol.c" of the ZFS repository. |
| 33 | + */ |
| 34 | +typedef struct zvol_state { |
| 35 | + char zv_name[MAXNAMELEN]; /* name */ |
| 36 | + uint64_t zv_volsize; /* advertised space */ |
| 37 | + uint64_t zv_volblocksize; /* volume block size */ |
| 38 | + objset_t *zv_objset; /* objset handle */ |
| 39 | + uint32_t zv_flags; /* ZVOL_* flags */ |
| 40 | + uint32_t zv_open_count; /* open counts */ |
| 41 | + uint32_t zv_changed; /* disk changed */ |
| 42 | + zilog_t *zv_zilog; /* ZIL handle */ |
| 43 | + rangelock_t zv_rangelock; /* for range locking */ |
| 44 | + dnode_t *zv_dn; /* dnode hold */ |
| 45 | + dev_t zv_dev; /* device id */ |
| 46 | + struct gendisk *zv_disk; /* generic disk */ |
| 47 | + struct request_queue *zv_queue; /* request queue */ |
| 48 | + dataset_kstats_t zv_kstat; /* zvol kstats */ |
| 49 | + list_node_t zv_next; /* next zvol_state_t linkage */ |
| 50 | + uint64_t zv_hash; /* name hash */ |
| 51 | + struct hlist_node zv_hlink; /* hash link */ |
| 52 | + kmutex_t zv_state_lock; /* protects zvol_state_t */ |
| 53 | + atomic_t zv_suspend_ref; /* refcount for suspend */ |
| 54 | + krwlock_t zv_suspend_lock; /* suspend lock */ |
| 55 | +} zvol_state_t; |
31 | 56 |
|
32 | 57 | // Structure to hold thread local data
|
33 | 58 | typedef struct {
|
|
0 commit comments