···367367 /* generate new lease key */368368 void (*new_lease_key)(struct cifs_fid *fid);369369 int (*generate_signingkey)(struct cifs_ses *);370370- int (*calc_signature)(struct smb_rqst *rqst,371371- struct TCP_Server_Info *server);372372- int (*query_mf_symlink)(const unsigned char *path, char *pbuf,373373- unsigned int *pbytes_read, struct cifs_sb_info *cifs_sb,374374- unsigned int xid);370370+ int (*calc_signature)(struct smb_rqst *, struct TCP_Server_Info *);371371+ int (*query_mf_symlink)(const unsigned char *, char *, unsigned int *,372372+ struct cifs_sb_info *, unsigned int);373373+ /* if we can do cache read operations */374374+ bool (*is_read_op)(__u32);375375+ /* set oplock level for the inode */376376+ void (*set_oplock_level)(struct cifsInodeInfo *, __u32);375377};376378377379struct smb_version_values {···391389 unsigned int cap_unix;392390 unsigned int cap_nt_find;393391 unsigned int cap_large_files;394394- unsigned int oplock_read;395392 __u16 signing_enabled;396393 __u16 signing_required;397394};···10371036#define CIFS_CACHE_WRITE_FLG 41038103710391038#define CIFS_CACHE_READ(cinode) (cinode->oplock & CIFS_CACHE_READ_FLG)10391039+#define CIFS_CACHE_HANDLE(cinode) (cinode->oplock & CIFS_CACHE_HANDLE_FLG)10401040#define CIFS_CACHE_WRITE(cinode) (cinode->oplock & CIFS_CACHE_WRITE_FLG)1041104110421042/*···15091507extern struct smb_version_operations smb1_operations;15101508extern struct smb_version_values smb1_values;15111509#define SMB20_VERSION_STRING "2.0"15121512-/*extern struct smb_version_operations smb20_operations; */ /* not needed yet */15101510+extern struct smb_version_operations smb20_operations;15131511extern struct smb_version_values smb20_values;15141512#define SMB21_VERSION_STRING "2.1"15151513extern struct smb_version_operations smb21_operations;
+1-1
fs/cifs/connect.c
···11161116 break;11171117#ifdef CONFIG_CIFS_SMB211181118 case Smb_20:11191119- vol->ops = &smb21_operations; /* currently identical with 2.1 */11191119+ vol->ops = &smb20_operations;11201120 vol->vals = &smb20_values;11211121 break;11221122 case Smb_21:
+1-2
fs/cifs/file.c
···313313 * If the server returned a read oplock and we have mandatory brlocks,314314 * set oplock level to None.315315 */316316- if (oplock == server->vals->oplock_read &&317317- cifs_has_mand_locks(cinode)) {316316+ if (server->ops->is_read_op(oplock) && cifs_has_mand_locks(cinode)) {318317 cifs_dbg(FYI, "Reset oplock val from read to None due to mand locks\n");319318 oplock = 0;320319 }
···963963 if (!found)964964 return 0;965965966966- return smb2_map_lease_to_oplock(lc->lcontext.LeaseState);966966+ return le32_to_cpu(lc->lcontext.LeaseState);967967}968968969969static int