summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEnzo Matsumiya <ematsumiya@suse.de>2024-11-13 18:24:00 -0300
committerEnzo Matsumiya <ematsumiya@suse.de>2024-11-14 15:54:44 -0300
commite0566abf2543a74e339660f0ffe45498dd439100 (patch)
tree3a358ecb7c90e292a0b6d72645b5e5887ec22c28
parentc75d799be8438b263ff3f3d97b951fe83a647afc (diff)
downloadlinux-e0566abf2543a74e339660f0ffe45498dd439100.tar.gz
linux-e0566abf2543a74e339660f0ffe45498dd439100.tar.bz2
linux-e0566abf2543a74e339660f0ffe45498dd439100.zip
smb: client: remove ->set_integrity op
Call smb3_set_integrity() directly if protocol is >= 3.0. Signed-off-by: Enzo Matsumiya <ematsumiya@suse.de>
-rw-r--r--fs/smb/client/cifsglob.h2
-rw-r--r--fs/smb/client/ioctl.c8
-rw-r--r--fs/smb/client/smb2ops.c6
-rw-r--r--fs/smb/client/smb2proto.h2
4 files changed, 6 insertions, 12 deletions
diff --git a/fs/smb/client/cifsglob.h b/fs/smb/client/cifsglob.h
index 1bbfb8e07409..5a8ed847bdc7 100644
--- a/fs/smb/client/cifsglob.h
+++ b/fs/smb/client/cifsglob.h
@@ -302,8 +302,6 @@ struct smb_version_operations {
struct TCP_Server_Info *server);
int (*calc_signature)(struct smb_rqst *, struct TCP_Server_Info *,
bool allocate_crypto);
- int (*set_integrity)(const unsigned int, struct cifs_tcon *tcon,
- struct cifsFileInfo *src_file);
/* set oplock level for the inode */
void (*set_oplock_level)(struct cifsInodeInfo *, __u32, unsigned int,
bool *);
diff --git a/fs/smb/client/ioctl.c b/fs/smb/client/ioctl.c
index 18078f23bdb1..5c908a96785c 100644
--- a/fs/smb/client/ioctl.c
+++ b/fs/smb/client/ioctl.c
@@ -415,11 +415,9 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg)
if (pSMBFile == NULL)
break;
tcon = tlink_tcon(pSMBFile->tlink);
- if (tcon->ses->server->ops->set_integrity)
- rc = tcon->ses->server->ops->set_integrity(xid,
- tcon, pSMBFile);
- else
- rc = -EOPNOTSUPP;
+ rc = -EOPNOTSUPP;
+ if (tcon->ses->server->vals->protocol_id >= SMB30_PROT_ID)
+ rc = smb3_set_integrity(xid, tcon, pSMBFile);
break;
case CIFS_IOC_GET_MNT_INFO:
if (pSMBFile == NULL)
diff --git a/fs/smb/client/smb2ops.c b/fs/smb/client/smb2ops.c
index 75eca2a44b2f..416104bc0966 100644
--- a/fs/smb/client/smb2ops.c
+++ b/fs/smb/client/smb2ops.c
@@ -2051,9 +2051,7 @@ int smb2_set_compression(const unsigned int xid, struct cifs_tcon *tcon,
cfile->fid.volatile_fid);
}
-static int
-smb3_set_integrity(const unsigned int xid, struct cifs_tcon *tcon,
- struct cifsFileInfo *cfile)
+int smb3_set_integrity(const unsigned int xid, struct cifs_tcon *tcon, struct cifsFileInfo *cfile)
{
struct fsctl_set_integrity_information_req integr_info;
unsigned int ret_data_len;
@@ -5104,7 +5102,6 @@ struct smb_version_operations smb30_operations = {
.queryfs = smb2_queryfs,
.generate_signingkey = generate_smb30signingkey,
.calc_signature = smb3_calc_signature,
- .set_integrity = smb3_set_integrity,
.set_oplock_level = smb3_set_oplock_level,
.create_lease_buf = smb3_create_lease_buf,
.parse_lease_buf = smb3_parse_lease_buf,
@@ -5126,7 +5123,6 @@ struct smb_version_operations smb311_operations = {
.queryfs = smb311_queryfs,
.generate_signingkey = generate_smb311signingkey,
.calc_signature = smb3_calc_signature,
- .set_integrity = smb3_set_integrity,
.set_oplock_level = smb3_set_oplock_level,
.create_lease_buf = smb3_create_lease_buf,
.parse_lease_buf = smb3_parse_lease_buf,
diff --git a/fs/smb/client/smb2proto.h b/fs/smb/client/smb2proto.h
index d59f6ec082a6..a7a72bb38ac1 100644
--- a/fs/smb/client/smb2proto.h
+++ b/fs/smb/client/smb2proto.h
@@ -279,6 +279,8 @@ extern int SMB2_set_ea(const unsigned int xid, struct cifs_tcon *tcon,
struct smb2_file_full_ea_info *buf, int len);
extern int SMB2_set_compression(const unsigned int xid, struct cifs_tcon *tcon,
u64 persistent_fid, u64 volatile_fid);
+extern int smb3_set_integrity(const unsigned int xid, struct cifs_tcon *tcon,
+ struct cifsFileInfo *cfile);
extern int SMB2_oplock_break(const unsigned int xid, struct cifs_tcon *tcon,
const u64 persistent_fid, const u64 volatile_fid,
const __u8 oplock_level);