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:
Bart Van Assche
2017-11-13 05:50:44 +00:00
parent 64c76f339c
commit 4c05086b59
7 changed files with 128 additions and 54 deletions
-21
View File
@@ -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)
{
+7
View File
@@ -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,