summaryrefslogtreecommitdiffstats
path: root/fs/cifs/file.c
diff options
context:
space:
mode:
authorPavel Shilovsky <piastryyy@gmail.com>2010-12-14 11:29:51 +0300
committerSteve French <sfrench@us.ibm.com>2011-01-20 21:42:25 +0000
commit7a6a19b17ab9103ec708c18befd28f2a3908d4c1 (patch)
tree3b781bf11b2a25c93ce20dbd80876e7e01c730e6 /fs/cifs/file.c
parent8be7e6ba142423e6ad98fed293c96f196f685229 (diff)
downloadop-kernel-dev-7a6a19b17ab9103ec708c18befd28f2a3908d4c1.zip
op-kernel-dev-7a6a19b17ab9103ec708c18befd28f2a3908d4c1.tar.gz
CIFS: Implement cifs_file_strict_mmap (try #2)
Invalidate inode mapping if we don't have at least Level II oplock. Reviewed-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Pavel Shilovsky <piastryyy@gmail.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/file.c')
-rw-r--r--fs/cifs/file.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 5790fab7..0b32377 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -1769,6 +1769,21 @@ static ssize_t cifs_read(struct file *file, char *read_data, size_t read_size,
return total_read;
}
+int cifs_file_strict_mmap(struct file *file, struct vm_area_struct *vma)
+{
+ int rc, xid;
+ struct inode *inode = file->f_path.dentry->d_inode;
+
+ xid = GetXid();
+
+ if (!CIFS_I(inode)->clientCanCacheRead)
+ cifs_invalidate_mapping(inode);
+
+ rc = generic_file_mmap(file, vma);
+ FreeXid(xid);
+ return rc;
+}
+
int cifs_file_mmap(struct file *file, struct vm_area_struct *vma)
{
int rc, xid;
OpenPOWER on IntegriCloud