1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */ 2c66ac9dbSNicholas Bellinger #ifndef TARGET_CORE_IBLOCK_H 3c66ac9dbSNicholas Bellinger #define TARGET_CORE_IBLOCK_H 4c66ac9dbSNicholas Bellinger 58dcf07beSBart Van Assche #include <linux/atomic.h> 65981c245SElena Reshetova #include <linux/refcount.h> 7*415ccd98SMike Christie #include <linux/blkdev.h> 88dcf07beSBart Van Assche #include <target/target_core_base.h> 98dcf07beSBart Van Assche 10c66ac9dbSNicholas Bellinger #define IBLOCK_VERSION "4.0" 11c66ac9dbSNicholas Bellinger 12c66ac9dbSNicholas Bellinger #define IBLOCK_MAX_CDBS 16 13c66ac9dbSNicholas Bellinger 14c66ac9dbSNicholas Bellinger struct iblock_req { 155981c245SElena Reshetova refcount_t pending; 16c66ac9dbSNicholas Bellinger atomic_t ib_bio_err_cnt; 17c66ac9dbSNicholas Bellinger } ____cacheline_aligned; 18c66ac9dbSNicholas Bellinger 19c66ac9dbSNicholas Bellinger #define IBDF_HAS_UDEV_PATH 0x01 20c66ac9dbSNicholas Bellinger 21*415ccd98SMike Christie #define IBD_PLUGF_PLUGGED 0x01 22*415ccd98SMike Christie 23*415ccd98SMike Christie struct iblock_dev_plug { 24*415ccd98SMike Christie struct se_dev_plug se_plug; 25*415ccd98SMike Christie struct blk_plug blk_plug; 26*415ccd98SMike Christie unsigned long flags; 27*415ccd98SMike Christie }; 28*415ccd98SMike Christie 29c66ac9dbSNicholas Bellinger struct iblock_dev { 300fd97ccfSChristoph Hellwig struct se_device dev; 31c66ac9dbSNicholas Bellinger unsigned char ibd_udev_path[SE_UDEV_PATH_LEN]; 32c66ac9dbSNicholas Bellinger u32 ibd_flags; 33a47a28b7SKent Overstreet struct bio_set ibd_bio_set; 34c66ac9dbSNicholas Bellinger struct block_device *ibd_bd; 3544bfd018SAndy Grover bool ibd_readonly; 36*415ccd98SMike Christie struct iblock_dev_plug *ibd_plug; 37c66ac9dbSNicholas Bellinger } ____cacheline_aligned; 38c66ac9dbSNicholas Bellinger 39c66ac9dbSNicholas Bellinger #endif /* TARGET_CORE_IBLOCK_H */ 40