summaryrefslogtreecommitdiff
path: root/fs/smb/client/cifsacl.c
diff options
context:
space:
mode:
authorHenrique Carvalho <henrique.carvalho@suse.com>2024-11-12 16:48:09 -0300
committerEnzo Matsumiya <ematsumiya@suse.de>2024-11-13 15:49:46 -0300
commit472697f67cf64a2461ad1842927f3c8cc539f37e (patch)
tree37bb1e46b0884721d35eb5d902aaf1bcf88374b0 /fs/smb/client/cifsacl.c
parent8e5cdf186897806453d95697985d2eb21a4730a7 (diff)
downloadlinux-hw24-hc-wip.tar.gz
linux-hw24-hc-wip.tar.bz2
linux-hw24-hc-wip.zip
smb: client: replace function pointers of common operations for thehw24-hc-wip
common function Signed-off-by: Henrique Carvalho <henrique.carvalho@suse.com>
Diffstat (limited to 'fs/smb/client/cifsacl.c')
-rw-r--r--fs/smb/client/cifsacl.c24
1 files changed, 5 insertions, 19 deletions
diff --git a/fs/smb/client/cifsacl.c b/fs/smb/client/cifsacl.c
index 6164c35ea6b8..114dd27ee918 100644
--- a/fs/smb/client/cifsacl.c
+++ b/fs/smb/client/cifsacl.c
@@ -1395,7 +1395,6 @@ cifs_acl_to_fattr(struct cifs_sb_info *cifs_sb, struct cifs_fattr *fattr,
u32 acllen = 0;
int rc = 0;
struct tcon_link *tlink = cifs_sb_tlink(cifs_sb);
- struct smb_version_operations *ops;
const u32 info = 0;
cifs_dbg(NOISY, "converting ACL to mode for %s\n", path);
@@ -1403,16 +1402,11 @@ cifs_acl_to_fattr(struct cifs_sb_info *cifs_sb, struct cifs_fattr *fattr,
if (IS_ERR(tlink))
return PTR_ERR(tlink);
- ops = tlink_tcon(tlink)->ses->server->ops;
+ if (pfid)
+ pntsd = get_smb2_acl_by_fid(cifs_sb, pfid, &acllen, info);
+ else
+ pntsd = get_smb2_acl(cifs_sb, inode, path, &acllen, info);
- if (pfid && (ops->get_acl_by_fid))
- pntsd = ops->get_acl_by_fid(cifs_sb, pfid, &acllen, info);
- else if (ops->get_acl)
- pntsd = ops->get_acl(cifs_sb, inode, path, &acllen, info);
- else {
- cifs_put_tlink(tlink);
- return -EOPNOTSUPP;
- }
/* if we can retrieve the ACL, now parse Access Control Entries, ACEs */
if (IS_ERR(pntsd)) {
rc = PTR_ERR(pntsd);
@@ -1448,25 +1442,17 @@ id_mode_to_cifs_acl(struct inode *inode, const char *path, __u64 *pnmode,
struct cifs_ntsd *pnntsd = NULL; /* modified acl to be sent to server */
struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);
struct tcon_link *tlink = cifs_sb_tlink(cifs_sb);
- struct smb_version_operations *ops;
bool mode_from_sid, id_from_sid;
const u32 info = 0;
if (IS_ERR(tlink))
return PTR_ERR(tlink);
- ops = tlink_tcon(tlink)->ses->server->ops;
-
cifs_dbg(NOISY, "set ACL from mode for %s\n", path);
/* Get the security descriptor */
- if (ops->get_acl == NULL) {
- cifs_put_tlink(tlink);
- return -EOPNOTSUPP;
- }
-
- pntsd = ops->get_acl(cifs_sb, inode, path, &secdesclen, info);
+ pntsd = get_smb2_acl(cifs_sb, inode, path, &secdesclen, info);
if (IS_ERR(pntsd)) {
rc = PTR_ERR(pntsd);
cifs_dbg(VFS, "%s: error %d getting sec desc\n", __func__, rc);