mirror of
https://github.com/SCST-project/scst.git
synced 2026-09-28 18:55:40 +00:00
scst, iscsi-scst: Introduce scst_read(), scst_write(), scst_readv() and scst_writev()
This makes it easier to add support for new kernel versions, e.g. kernel version v4.14. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7260 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -247,27 +247,6 @@ static inline struct inode *file_inode(const struct file *f)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (!defined(CONFIG_SUSE_KERNEL) && \
|
||||
LINUX_VERSION_CODE < KERNEL_VERSION(4, 6, 0)) || \
|
||||
LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0)
|
||||
static inline ssize_t vfs_readv_backport(struct file *file,
|
||||
const struct iovec __user *vec,
|
||||
unsigned long vlen, loff_t *pos,
|
||||
int flags)
|
||||
{
|
||||
return vfs_readv(file, vec, vlen, pos);
|
||||
}
|
||||
static inline ssize_t vfs_writev_backport(struct file *file,
|
||||
const struct iovec __user *vec,
|
||||
unsigned long vlen, loff_t *pos,
|
||||
int flags)
|
||||
{
|
||||
return vfs_writev(file, vec, vlen, pos);
|
||||
}
|
||||
#define vfs_readv vfs_readv_backport
|
||||
#define vfs_writev vfs_writev_backport
|
||||
#endif
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 35)
|
||||
static inline int vfs_fsync_backport(struct file *file, int datasync)
|
||||
{
|
||||
|
||||
@@ -5712,6 +5712,13 @@ struct scst_data_descriptor {
|
||||
uint64_t sdd_blocks;
|
||||
};
|
||||
|
||||
ssize_t scst_read(struct file *file, void *buf, size_t count, loff_t *pos);
|
||||
ssize_t scst_write(struct file *file, const void *buf, size_t count,
|
||||
loff_t *pos);
|
||||
ssize_t scst_readv(struct file *file, const struct iovec *vec,
|
||||
unsigned long vlen, loff_t *pos);
|
||||
ssize_t scst_writev(struct file *file, const struct iovec *vec,
|
||||
unsigned long vlen, loff_t *pos);
|
||||
void scst_write_same(struct scst_cmd *cmd, struct scst_data_descriptor *where);
|
||||
int scst_scsi_execute(struct scsi_device *sdev, const unsigned char *cmd,
|
||||
int data_direction, void *buffer, unsigned bufflen,
|
||||
|
||||
Reference in New Issue
Block a user