aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/file.c
diff options
context:
space:
mode:
authorPavel Shilovsky <piastryyy@gmail.com>2010-12-14 03:29:51 -0500
committerSteve French <sfrench@us.ibm.com>2011-01-20 16:42:25 -0500
commit7a6a19b17ab9103ec708c18befd28f2a3908d4c1 (patch)
tree3b781bf11b2a25c93ce20dbd80876e7e01c730e6 /fs/cifs/file.c
parent8be7e6ba142423e6ad98fed293c96f196f685229 (diff)
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 5790fab7349b..0b32377ef8b7 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,
1769 return total_read; 1769 return total_read;
1770} 1770}
1771 1771
1772int cifs_file_strict_mmap(struct file *file, struct vm_area_struct *vma)
1773{
1774 int rc, xid;
1775 struct inode *inode = file->f_path.dentry->d_inode;
1776
1777 xid = GetXid();
1778
1779 if (!CIFS_I(inode)->clientCanCacheRead)
1780 cifs_invalidate_mapping(inode);
1781
1782 rc = generic_file_mmap(file, vma);
1783 FreeXid(xid);
1784 return rc;
1785}
1786
1772int cifs_file_mmap(struct file *file, struct vm_area_struct *vma) 1787int cifs_file_mmap(struct file *file, struct vm_area_struct *vma)
1773{ 1788{
1774 int rc, xid; 1789 int rc, xid;