CIFS: Implement cifs_strict_readv (try #4)
Subsystems (2)
PATCH 4/6 CIFS: Implement cifs_strict_readv (try #4)
Read from the cache if we have at least Level II oplock - otherwise read from the server. Add cifs_user_readv to let the client read into iovec buffers.
Reviewed-by Jeff Layton <[email protected]>
Signed-off-by Pavel Shilovsky <[email protected]>
--- fs/cifs/cifsfs.c | 4 +- fs/cifs/cifsfs.h | 4 +- fs/cifs/file.c | 116 ++++++++++++++++++++++++++++++++++++----------------- 3 files changed, 84 insertions(+), 40 deletions(-)
fs/cifs/cifsfs.c +2 -2
@@ -714,7 +714,7 @@ const struct file_operations cifs_file_ops = {const struct file_operations cifs_file_strict_ops = { .read = do_sync_read, .write = do_sync_write, - .aio_read = generic_file_aio_read, + .aio_read = cifs_strict_readv, .aio_write = cifs_file_aio_write, .open = cifs_open, .release = cifs_close,
@@ -770,7 +770,7 @@ const struct file_operations cifs_file_nobrl_ops = {const struct file_operations cifs_file_strict_nobrl_ops = { .read = do_sync_read, .write = do_sync_write, - .aio_read = generic_file_aio_read, + .aio_read = cifs_strict_readv, .aio_write = cifs_file_aio_write, .open = cifs_open, .release = cifs_close,
fs/cifs/cifsfs.h +3 -1
@@ -81,7 +81,9 @@ extern int cifs_open(struct inode *inode, struct file *file);extern int cifs_close (struct inode *inode,struct file *file);extern int cifs_closedir (struct inode *inode,struct file *file);extern ssize_t cifs_user_read (struct file *file,char __user *read_data, -size_t read_size,loff_t *poffset); +size_t read_size,loff_t *poffset); +extern ssize_t cifs_strict_readv (struct kiocb *iocb,const struct iovec *iov, +unsigned long nr_segs,loff_t pos);extern ssize_t cifs_user_write (struct file *file,const char __user *write_data,size_t write_size,loff_t *poffset);extern int cifs_lock (struct file *,int ,struct file_lock *);
fs/cifs/file.c +79 -37
161 lines not on this page · raw message
Signature · 1 line
1.7.3.4