]>
git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blob - drivers/block/null_blk.h
d82c5501806d5ae30ef736867b79a3e7042dd5e3
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __BLK_NULL_BLK_H
3 #define __BLK_NULL_BLK_H
5 #include <linux/blkdev.h>
6 #include <linux/slab.h>
7 #include <linux/blk-mq.h>
8 #include <linux/hrtimer.h>
9 #include <linux/configfs.h>
10 #include <linux/badblocks.h>
11 #include <linux/fault-inject.h>
14 struct list_head list
;
15 struct llist_node ll_list
;
16 struct __call_single_data csd
;
21 struct nullb_queue
*nq
;
26 unsigned long *tag_map
;
27 wait_queue_head_t wait
;
28 unsigned int queue_depth
;
29 struct nullb_device
*dev
;
30 unsigned int requeue_selection
;
32 struct nullb_cmd
*cmds
;
37 struct config_item item
;
38 struct radix_tree_root data
; /* data stored in the disk */
39 struct radix_tree_root cache
; /* disk cache data */
40 unsigned long flags
; /* device flags */
41 unsigned int curr_cache
;
42 struct badblocks badblocks
;
44 unsigned long size
; /* device size in MB */
45 unsigned long completion_nsec
; /* time in ns to complete a request */
46 unsigned long cache_size
; /* disk cache size in MB */
47 unsigned int submit_queues
; /* number of submission queues */
48 unsigned int home_node
; /* home node for the device */
49 unsigned int queue_mode
; /* block interface */
50 unsigned int blocksize
; /* block size */
51 unsigned int irqmode
; /* IRQ completion handler */
52 unsigned int hw_queue_depth
; /* queue depth */
53 unsigned int index
; /* index of the disk, only valid with a disk */
54 unsigned int mbps
; /* Bandwidth throttle cap (in MB/s) */
55 bool blocking
; /* blocking blk-mq device */
56 bool use_per_node_hctx
; /* use per-node allocation for hardware context */
57 bool power
; /* power on/off the device */
58 bool memory_backed
; /* if data is stored in memory */
59 bool discard
; /* if support discard */
63 struct nullb_device
*dev
;
64 struct list_head list
;
66 struct request_queue
*q
;
68 struct blk_mq_tag_set
*tag_set
;
69 struct blk_mq_tag_set __tag_set
;
70 unsigned int queue_depth
;
71 atomic_long_t cur_bytes
;
72 struct hrtimer bw_timer
;
73 unsigned long cache_flush_pos
;
76 struct nullb_queue
*queues
;
77 unsigned int nr_queues
;
78 char disk_name
[DISK_NAME_LEN
];
80 #endif /* __NULL_BLK_H */