diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-11-05 17:17:01 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-11-05 17:17:01 -0400 |
| commit | 2e5c36722d4c9c86281f25a1e963a6078c7fce6a (patch) | |
| tree | 373e6d3f2858d69feb9828835e4856bec294d98e /fs/cifs/misc.c | |
| parent | e0a70217107e6f9844628120412cb27bb4cea194 (diff) | |
| parent | c67236281c5d749741f5414103903a7c1b9c4636 (diff) | |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6:
cifs: make cifs_set_oplock_level() take a cifsInodeInfo pointer
cifs: dereferencing first then checking
cifs: trivial comment fix: tlink_tree is now a rbtree
[CIFS] Cleanup unused variable build warning
cifs: convert tlink_tree to a rbtree
cifs: store pointer to master tlink in superblock (try #2)
cifs: trivial doc fix: note setlease implemented
CIFS: Add cifs_set_oplock_level
FS: cifs, remove unneeded NULL tests
Diffstat (limited to 'fs/cifs/misc.c')
| -rw-r--r-- | fs/cifs/misc.c | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c index c4e296fe3518..43f10281bc19 100644 --- a/fs/cifs/misc.c +++ b/fs/cifs/misc.c | |||
| @@ -569,10 +569,9 @@ is_valid_oplock_break(struct smb_hdr *buf, struct TCP_Server_Info *srv) | |||
| 569 | 569 | ||
| 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 | pCifsInode->clientCanCacheAll = false; | ||
| 573 | if (pSMB->OplockLevel == 0) | ||
| 574 | pCifsInode->clientCanCacheRead = false; | ||
| 575 | 572 | ||
| 573 | cifs_set_oplock_level(pCifsInode, | ||
| 574 | pSMB->OplockLevel); | ||
| 576 | /* | 575 | /* |
| 577 | * cifs_oplock_break_put() can't be called | 576 | * cifs_oplock_break_put() can't be called |
| 578 | * from here. Get reference after queueing | 577 | * from here. Get reference after queueing |
| @@ -722,3 +721,23 @@ cifs_autodisable_serverino(struct cifs_sb_info *cifs_sb) | |||
| 722 | cifs_sb_master_tcon(cifs_sb)->treeName); | 721 | cifs_sb_master_tcon(cifs_sb)->treeName); |
| 723 | } | 722 | } |
| 724 | } | 723 | } |
| 724 | |||
| 725 | void cifs_set_oplock_level(struct cifsInodeInfo *cinode, __u32 oplock) | ||
| 726 | { | ||
| 727 | oplock &= 0xF; | ||
| 728 | |||
| 729 | if (oplock == OPLOCK_EXCLUSIVE) { | ||
| 730 | cinode->clientCanCacheAll = true; | ||
| 731 | cinode->clientCanCacheRead = true; | ||
| 732 | cFYI(1, "Exclusive Oplock granted on inode %p", | ||
| 733 | &cinode->vfs_inode); | ||
| 734 | } else if (oplock == OPLOCK_READ) { | ||
| 735 | cinode->clientCanCacheAll = false; | ||
| 736 | cinode->clientCanCacheRead = true; | ||
| 737 | cFYI(1, "Level II Oplock granted on inode %p", | ||
| 738 | &cinode->vfs_inode); | ||
| 739 | } else { | ||
| 740 | cinode->clientCanCacheAll = false; | ||
| 741 | cinode->clientCanCacheRead = false; | ||
| 742 | } | ||
| 743 | } | ||
