Skip to content

Commit f19c981

Browse files
author
Prakash Surya
authored
DLPX-69162 [Backport of DLPX-69120 6.0.2.0] running estat against zvol fails to find zvol_impl.h on AWS (#42)
1 parent a4646a4 commit f19c981

File tree

1 file changed

+27
-2
lines changed

1 file changed

+27
-2
lines changed

bpf/estat/zvol.c

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
#include <sys/zil_impl.h>
1212
#include <sys/zfs_rlock.h>
1313
#include <sys/spa_impl.h>
14-
#include <sys/zvol_impl.h>
15-
14+
#include <sys/zvol.h>
15+
#include <sys/dataset_kstats.h>
1616

1717
#define ZVOL_WCE 0x8
1818
#define ZVOL_READ 1
@@ -28,6 +28,31 @@
2828
#define POOL (OPTARG)
2929
#endif
3030

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;
3156

3257
// Structure to hold thread local data
3358
typedef struct {

0 commit comments

Comments
 (0)