Skip to contentSkip to conversation

CIFS: Implement cifs_strict_readv (try #4)

PATCH In review Pavel Shilovsky 1 participant 1 message Dec 27, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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.

---
 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
index 2b52020..0d6b005 100644
@@ -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
index 657738f..d97c96e 100644
@@ -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