diff options
Diffstat (limited to 'fs/cifs/smb2file.c')
-rw-r--r-- | fs/cifs/smb2file.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/fs/cifs/smb2file.c b/fs/cifs/smb2file.c index 5da1b55a2258..04a81a4142c3 100644 --- a/fs/cifs/smb2file.c +++ b/fs/cifs/smb2file.c | |||
@@ -40,7 +40,8 @@ smb2_set_oplock_level(struct cifsInodeInfo *cinode, __u32 oplock) | |||
40 | oplock &= 0xFF; | 40 | oplock &= 0xFF; |
41 | if (oplock == SMB2_OPLOCK_LEVEL_NOCHANGE) | 41 | if (oplock == SMB2_OPLOCK_LEVEL_NOCHANGE) |
42 | return; | 42 | return; |
43 | if (oplock == SMB2_OPLOCK_LEVEL_EXCLUSIVE) { | 43 | if (oplock == SMB2_OPLOCK_LEVEL_EXCLUSIVE || |
44 | oplock == SMB2_OPLOCK_LEVEL_BATCH) { | ||
44 | cinode->clientCanCacheAll = true; | 45 | cinode->clientCanCacheAll = true; |
45 | cinode->clientCanCacheRead = true; | 46 | cinode->clientCanCacheRead = true; |
46 | cifs_dbg(FYI, "Exclusive Oplock granted on inode %p\n", | 47 | cifs_dbg(FYI, "Exclusive Oplock granted on inode %p\n", |
@@ -57,17 +58,16 @@ smb2_set_oplock_level(struct cifsInodeInfo *cinode, __u32 oplock) | |||
57 | } | 58 | } |
58 | 59 | ||
59 | int | 60 | int |
60 | smb2_open_file(const unsigned int xid, struct cifs_tcon *tcon, const char *path, | 61 | smb2_open_file(const unsigned int xid, struct cifs_open_parms *oparms, |
61 | int disposition, int desired_access, int create_options, | 62 | __u32 *oplock, FILE_ALL_INFO *buf) |
62 | struct cifs_fid *fid, __u32 *oplock, FILE_ALL_INFO *buf, | ||
63 | struct cifs_sb_info *cifs_sb) | ||
64 | { | 63 | { |
65 | int rc; | 64 | int rc; |
66 | __le16 *smb2_path; | 65 | __le16 *smb2_path; |
67 | struct smb2_file_all_info *smb2_data = NULL; | 66 | struct smb2_file_all_info *smb2_data = NULL; |
68 | __u8 smb2_oplock[17]; | 67 | __u8 smb2_oplock[17]; |
68 | struct cifs_fid *fid = oparms->fid; | ||
69 | 69 | ||
70 | smb2_path = cifs_convert_path_to_utf16(path, cifs_sb); | 70 | smb2_path = cifs_convert_path_to_utf16(oparms->path, oparms->cifs_sb); |
71 | if (smb2_path == NULL) { | 71 | if (smb2_path == NULL) { |
72 | rc = -ENOMEM; | 72 | rc = -ENOMEM; |
73 | goto out; | 73 | goto out; |
@@ -80,21 +80,19 @@ smb2_open_file(const unsigned int xid, struct cifs_tcon *tcon, const char *path, | |||
80 | goto out; | 80 | goto out; |
81 | } | 81 | } |
82 | 82 | ||
83 | desired_access |= FILE_READ_ATTRIBUTES; | 83 | oparms->desired_access |= FILE_READ_ATTRIBUTES; |
84 | *smb2_oplock = SMB2_OPLOCK_LEVEL_EXCLUSIVE; | 84 | *smb2_oplock = SMB2_OPLOCK_LEVEL_BATCH; |
85 | 85 | ||
86 | if (tcon->ses->server->capabilities & SMB2_GLOBAL_CAP_LEASING) | 86 | if (oparms->tcon->ses->server->capabilities & SMB2_GLOBAL_CAP_LEASING) |
87 | memcpy(smb2_oplock + 1, fid->lease_key, SMB2_LEASE_KEY_SIZE); | 87 | memcpy(smb2_oplock + 1, fid->lease_key, SMB2_LEASE_KEY_SIZE); |
88 | 88 | ||
89 | rc = SMB2_open(xid, tcon, smb2_path, &fid->persistent_fid, | 89 | rc = SMB2_open(xid, oparms, smb2_path, smb2_oplock, smb2_data); |
90 | &fid->volatile_fid, desired_access, disposition, | ||
91 | 0, 0, smb2_oplock, smb2_data); | ||
92 | if (rc) | 90 | if (rc) |
93 | goto out; | 91 | goto out; |
94 | 92 | ||
95 | if (buf) { | 93 | if (buf) { |
96 | /* open response does not have IndexNumber field - get it */ | 94 | /* open response does not have IndexNumber field - get it */ |
97 | rc = SMB2_get_srv_num(xid, tcon, fid->persistent_fid, | 95 | rc = SMB2_get_srv_num(xid, oparms->tcon, fid->persistent_fid, |
98 | fid->volatile_fid, | 96 | fid->volatile_fid, |
99 | &smb2_data->IndexNumber); | 97 | &smb2_data->IndexNumber); |
100 | if (rc) { | 98 | if (rc) { |