diff options
Diffstat (limited to 'fs/cifs/misc.c')
| -rw-r--r-- | fs/cifs/misc.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c index d3b9ddebc17e..43f10281bc19 100644 --- a/fs/cifs/misc.c +++ b/fs/cifs/misc.c | |||
| @@ -570,7 +570,7 @@ is_valid_oplock_break(struct smb_hdr *buf, struct TCP_Server_Info *srv) | |||
| 570 | cFYI(1, "file id match, oplock break"); | 570 | cFYI(1, "file id match, oplock break"); |
| 571 | pCifsInode = CIFS_I(netfile->dentry->d_inode); | 571 | pCifsInode = CIFS_I(netfile->dentry->d_inode); |
| 572 | 572 | ||
| 573 | cifs_set_oplock_level(netfile->dentry->d_inode, | 573 | cifs_set_oplock_level(pCifsInode, |
| 574 | pSMB->OplockLevel); | 574 | pSMB->OplockLevel); |
| 575 | /* | 575 | /* |
| 576 | * cifs_oplock_break_put() can't be called | 576 | * cifs_oplock_break_put() can't be called |
| @@ -722,18 +722,20 @@ cifs_autodisable_serverino(struct cifs_sb_info *cifs_sb) | |||
| 722 | } | 722 | } |
| 723 | } | 723 | } |
| 724 | 724 | ||
| 725 | void cifs_set_oplock_level(struct inode *inode, __u32 oplock) | 725 | void cifs_set_oplock_level(struct cifsInodeInfo *cinode, __u32 oplock) |
| 726 | { | 726 | { |
| 727 | struct cifsInodeInfo *cinode = CIFS_I(inode); | 727 | oplock &= 0xF; |
| 728 | 728 | ||
| 729 | if ((oplock & 0xF) == OPLOCK_EXCLUSIVE) { | 729 | if (oplock == OPLOCK_EXCLUSIVE) { |
| 730 | cinode->clientCanCacheAll = true; | 730 | cinode->clientCanCacheAll = true; |
| 731 | cinode->clientCanCacheRead = true; | 731 | cinode->clientCanCacheRead = true; |
| 732 | cFYI(1, "Exclusive Oplock granted on inode %p", inode); | 732 | cFYI(1, "Exclusive Oplock granted on inode %p", |
| 733 | } else if ((oplock & 0xF) == OPLOCK_READ) { | 733 | &cinode->vfs_inode); |
| 734 | } else if (oplock == OPLOCK_READ) { | ||
| 734 | cinode->clientCanCacheAll = false; | 735 | cinode->clientCanCacheAll = false; |
| 735 | cinode->clientCanCacheRead = true; | 736 | cinode->clientCanCacheRead = true; |
| 736 | cFYI(1, "Level II Oplock granted on inode %p", inode); | 737 | cFYI(1, "Level II Oplock granted on inode %p", |
| 738 | &cinode->vfs_inode); | ||
| 737 | } else { | 739 | } else { |
| 738 | cinode->clientCanCacheAll = false; | 740 | cinode->clientCanCacheAll = false; |
| 739 | cinode->clientCanCacheRead = false; | 741 | cinode->clientCanCacheRead = false; |
