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>
This commit is contained in:

committed by
Steve French

parent
8be7e6ba14
commit
7a6a19b17a
@@ -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;
|
||||
|
Reference in New Issue
Block a user