Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef TARGET_CORE_FILE_H
0003 #define TARGET_CORE_FILE_H
0004 
0005 #include <target/target_core_base.h>
0006 
0007 #define FD_VERSION      "4.0"
0008 
0009 #define FD_MAX_DEV_NAME     256
0010 #define FD_MAX_DEV_PROT_NAME    FD_MAX_DEV_NAME + 16
0011 #define FD_DEVICE_QUEUE_DEPTH   32
0012 #define FD_MAX_DEVICE_QUEUE_DEPTH 128
0013 #define FD_BLOCKSIZE        512
0014 /*
0015  * Limited by the number of iovecs (2048) per vfs_[writev,readv] call
0016  */
0017 #define FD_MAX_BYTES        8388608
0018 
0019 #define RRF_EMULATE_CDB     0x01
0020 #define RRF_GOT_LBA     0x02
0021 
0022 #define FBDF_HAS_PATH       0x01
0023 #define FBDF_HAS_SIZE       0x02
0024 #define FDBD_HAS_BUFFERED_IO_WCE 0x04
0025 #define FDBD_HAS_ASYNC_IO    0x08
0026 #define FDBD_FORMAT_UNIT_SIZE   2048
0027 
0028 struct fd_dev {
0029     struct se_device dev;
0030 
0031     u32     fbd_flags;
0032     unsigned char   fd_dev_name[FD_MAX_DEV_NAME];
0033     /* Unique Ramdisk Device ID in Ramdisk HBA */
0034     u32     fd_dev_id;
0035     /* Number of SG tables in sg_table_array */
0036     u32     fd_table_count;
0037     u32     fd_queue_depth;
0038     u32     fd_block_size;
0039     unsigned long long fd_dev_size;
0040     struct file *fd_file;
0041     struct file *fd_prot_file;
0042     /* FILEIO HBA device is connected to */
0043     struct fd_host *fd_host;
0044 } ____cacheline_aligned;
0045 
0046 struct fd_host {
0047     u32     fd_host_dev_id_count;
0048     /* Unique FILEIO Host ID */
0049     u32     fd_host_id;
0050 } ____cacheline_aligned;
0051 
0052 #endif /* TARGET_CORE_FILE_H */