@@ -739,7 +739,7 @@ const struct inode_operations cifs_symlink_inode_ops = {
const struct file_operations cifs_file_ops = {
.read = do_sync_read,
.write = do_sync_write,
- .aio_read = generic_file_aio_read,
+ .aio_read = cifs_file_aio_read,
.aio_write = cifs_file_aio_write,
.open = cifs_open,
.release = cifs_close,
@@ -781,7 +781,7 @@ const struct file_operations cifs_file_direct_ops = {
const struct file_operations cifs_file_nobrl_ops = {
.read = do_sync_read,
.write = do_sync_write,
- .aio_read = generic_file_aio_read,
+ .aio_read = cifs_file_aio_read,
.aio_write = cifs_file_aio_write,
.open = cifs_open,
.release = cifs_close,
@@ -86,6 +86,8 @@ extern ssize_t cifs_user_write(struct file *file, const char __user *write_data,
extern int cifs_lock(struct file *, int, struct file_lock *);
extern int cifs_fsync(struct file *, struct dentry *, int);
extern int cifs_flush(struct file *, fl_owner_t id);
+extern ssize_t cifs_file_aio_read(struct kiocb *iocb, const struct iovec *iov,
+ unsigned long nr_segs, loff_t pos);
extern int cifs_file_mmap(struct file * , struct vm_area_struct *);
extern const struct file_operations cifs_dir_ops;
extern int cifs_dir_open(struct inode *inode, struct file *file);
@@ -1888,6 +1888,25 @@ static ssize_t cifs_read(struct file *file, char *read_data, size_t read_size,
return total_read;
}
+ssize_t
+cifs_file_aio_read(struct kiocb *iocb, const struct iovec *iov,
+ unsigned long nr_segs, loff_t pos)
+{
+ int rc;
+ struct dentry *dentry = iocb->ki_filp->f_path.dentry;
+
+ cFYI(1, ("%s: read(%s/%s), %lu@%lu)", __func__,
+ dentry->d_parent->d_name.name, dentry->d_name.name,
+ (unsigned long) iov_length(iov, nr_segs),
+ (unsigned long) pos));
+
+ rc = cifs_revalidate_file(iocb->ki_filp);
+ if (rc)
+ return rc;
+
+ return generic_file_aio_read(iocb, iov, nr_segs, pos);
+}
+
int cifs_file_mmap(struct file *file, struct vm_area_struct *vma)
{
int rc, xid;