Skip to content

Commit 5f8a209

Browse files
ChenXiaoSongSasha Levin
authored andcommitted
smb/client: rename cifs_acl to smb_acl
[ Upstream commit 251b93a ] Preparation for moving acl definitions to new common header file. Use the following shell command to rename: find fs/smb/client -type f -exec sed -i \ 's/struct cifs_acl/struct smb_acl/g' {} + Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn> Reviewed-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com> Stable-dep-of: d413eab ("fs/smb/client: implement chmod() for SMB3 POSIX Extensions") Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent ccdb8ac commit 5f8a209

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

fs/smb/client/cifsacl.c

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -758,7 +758,7 @@ static void dump_ace(struct cifs_ace *pace, char *end_of_acl)
758758
}
759759
#endif
760760

761-
static void parse_dacl(struct cifs_acl *pdacl, char *end_of_acl,
761+
static void parse_dacl(struct smb_acl *pdacl, char *end_of_acl,
762762
struct smb_sid *pownersid, struct smb_sid *pgrpsid,
763763
struct cifs_fattr *fattr, bool mode_from_special_sid)
764764
{
@@ -793,7 +793,7 @@ static void parse_dacl(struct cifs_acl *pdacl, char *end_of_acl,
793793
fattr->cf_mode &= ~(0777);
794794

795795
acl_base = (char *)pdacl;
796-
acl_size = sizeof(struct cifs_acl);
796+
acl_size = sizeof(struct smb_acl);
797797

798798
num_aces = le32_to_cpu(pdacl->num_aces);
799799
if (num_aces > 0) {
@@ -1034,7 +1034,7 @@ static void populate_new_aces(char *nacl_base,
10341034
*pnsize = nsize;
10351035
}
10361036

1037-
static __u16 replace_sids_and_copy_aces(struct cifs_acl *pdacl, struct cifs_acl *pndacl,
1037+
static __u16 replace_sids_and_copy_aces(struct smb_acl *pdacl, struct smb_acl *pndacl,
10381038
struct smb_sid *pownersid, struct smb_sid *pgrpsid,
10391039
struct smb_sid *pnownersid, struct smb_sid *pngrpsid)
10401040
{
@@ -1049,11 +1049,11 @@ static __u16 replace_sids_and_copy_aces(struct cifs_acl *pdacl, struct cifs_acl
10491049
u16 ace_size = 0;
10501050

10511051
acl_base = (char *)pdacl;
1052-
size = sizeof(struct cifs_acl);
1052+
size = sizeof(struct smb_acl);
10531053
src_num_aces = le32_to_cpu(pdacl->num_aces);
10541054

10551055
nacl_base = (char *)pndacl;
1056-
nsize = sizeof(struct cifs_acl);
1056+
nsize = sizeof(struct smb_acl);
10571057

10581058
/* Go through all the ACEs */
10591059
for (i = 0; i < src_num_aces; ++i) {
@@ -1074,7 +1074,7 @@ static __u16 replace_sids_and_copy_aces(struct cifs_acl *pdacl, struct cifs_acl
10741074
return nsize;
10751075
}
10761076

1077-
static int set_chmod_dacl(struct cifs_acl *pdacl, struct cifs_acl *pndacl,
1077+
static int set_chmod_dacl(struct smb_acl *pdacl, struct smb_acl *pndacl,
10781078
struct smb_sid *pownersid, struct smb_sid *pgrpsid,
10791079
__u64 *pnmode, bool mode_from_sid)
10801080
{
@@ -1091,7 +1091,7 @@ static int set_chmod_dacl(struct cifs_acl *pdacl, struct cifs_acl *pndacl,
10911091

10921092
/* Assuming that pndacl and pnmode are never NULL */
10931093
nacl_base = (char *)pndacl;
1094-
nsize = sizeof(struct cifs_acl);
1094+
nsize = sizeof(struct smb_acl);
10951095

10961096
/* If pdacl is NULL, we don't have a src. Simply populate new ACL. */
10971097
if (!pdacl) {
@@ -1103,7 +1103,7 @@ static int set_chmod_dacl(struct cifs_acl *pdacl, struct cifs_acl *pndacl,
11031103
}
11041104

11051105
acl_base = (char *)pdacl;
1106-
size = sizeof(struct cifs_acl);
1106+
size = sizeof(struct smb_acl);
11071107
src_num_aces = le32_to_cpu(pdacl->num_aces);
11081108

11091109
/* Retain old ACEs which we can retain */
@@ -1196,7 +1196,7 @@ static int parse_sec_desc(struct cifs_sb_info *cifs_sb,
11961196
{
11971197
int rc = 0;
11981198
struct smb_sid *owner_sid_ptr, *group_sid_ptr;
1199-
struct cifs_acl *dacl_ptr; /* no need for SACL ptr */
1199+
struct smb_acl *dacl_ptr; /* no need for SACL ptr */
12001200
char *end_of_acl = ((char *)pntsd) + acl_len;
12011201
__u32 dacloffset;
12021202

@@ -1208,7 +1208,7 @@ static int parse_sec_desc(struct cifs_sb_info *cifs_sb,
12081208
group_sid_ptr = (struct smb_sid *)((char *)pntsd +
12091209
le32_to_cpu(pntsd->gsidoffset));
12101210
dacloffset = le32_to_cpu(pntsd->dacloffset);
1211-
dacl_ptr = (struct cifs_acl *)((char *)pntsd + dacloffset);
1211+
dacl_ptr = (struct smb_acl *)((char *)pntsd + dacloffset);
12121212
cifs_dbg(NOISY, "revision %d type 0x%x ooffset 0x%x goffset 0x%x sacloffset 0x%x dacloffset 0x%x\n",
12131213
pntsd->revision, pntsd->type, le32_to_cpu(pntsd->osidoffset),
12141214
le32_to_cpu(pntsd->gsidoffset),
@@ -1259,14 +1259,14 @@ static int build_sec_desc(struct smb_ntsd *pntsd, struct smb_ntsd *pnntsd,
12591259
__u32 sidsoffset;
12601260
struct smb_sid *owner_sid_ptr, *group_sid_ptr;
12611261
struct smb_sid *nowner_sid_ptr = NULL, *ngroup_sid_ptr = NULL;
1262-
struct cifs_acl *dacl_ptr = NULL; /* no need for SACL ptr */
1263-
struct cifs_acl *ndacl_ptr = NULL; /* no need for SACL ptr */
1262+
struct smb_acl *dacl_ptr = NULL; /* no need for SACL ptr */
1263+
struct smb_acl *ndacl_ptr = NULL; /* no need for SACL ptr */
12641264
char *end_of_acl = ((char *)pntsd) + secdesclen;
12651265
u16 size = 0;
12661266

12671267
dacloffset = le32_to_cpu(pntsd->dacloffset);
12681268
if (dacloffset) {
1269-
dacl_ptr = (struct cifs_acl *)((char *)pntsd + dacloffset);
1269+
dacl_ptr = (struct smb_acl *)((char *)pntsd + dacloffset);
12701270
if (end_of_acl < (char *)dacl_ptr + le16_to_cpu(dacl_ptr->size)) {
12711271
cifs_dbg(VFS, "Server returned illegal ACL size\n");
12721272
return -EINVAL;
@@ -1280,7 +1280,7 @@ static int build_sec_desc(struct smb_ntsd *pntsd, struct smb_ntsd *pnntsd,
12801280

12811281
if (pnmode && *pnmode != NO_CHANGE_64) { /* chmod */
12821282
ndacloffset = sizeof(struct smb_ntsd);
1283-
ndacl_ptr = (struct cifs_acl *)((char *)pnntsd + ndacloffset);
1283+
ndacl_ptr = (struct smb_acl *)((char *)pnntsd + ndacloffset);
12841284
ndacl_ptr->revision =
12851285
dacloffset ? dacl_ptr->revision : cpu_to_le16(ACL_REVISION);
12861286

@@ -1298,7 +1298,7 @@ static int build_sec_desc(struct smb_ntsd *pntsd, struct smb_ntsd *pnntsd,
12981298
*aclflag |= CIFS_ACL_DACL;
12991299
} else {
13001300
ndacloffset = sizeof(struct smb_ntsd);
1301-
ndacl_ptr = (struct cifs_acl *)((char *)pnntsd + ndacloffset);
1301+
ndacl_ptr = (struct smb_acl *)((char *)pnntsd + ndacloffset);
13021302
ndacl_ptr->revision =
13031303
dacloffset ? dacl_ptr->revision : cpu_to_le16(ACL_REVISION);
13041304
ndacl_ptr->num_aces = dacl_ptr ? dacl_ptr->num_aces : 0;
@@ -1580,7 +1580,7 @@ id_mode_to_cifs_acl(struct inode *inode, const char *path, __u64 *pnmode,
15801580
__u32 secdesclen = 0;
15811581
__u32 nsecdesclen = 0;
15821582
__u32 dacloffset = 0;
1583-
struct cifs_acl *dacl_ptr = NULL;
1583+
struct smb_acl *dacl_ptr = NULL;
15841584
struct smb_ntsd *pntsd = NULL; /* acl obtained from server */
15851585
struct smb_ntsd *pnntsd = NULL; /* modified acl to be sent to server */
15861586
struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);
@@ -1633,7 +1633,7 @@ id_mode_to_cifs_acl(struct inode *inode, const char *path, __u64 *pnmode,
16331633
nsecdesclen = sizeof(struct smb_ntsd) + (sizeof(struct smb_sid) * 2);
16341634
dacloffset = le32_to_cpu(pntsd->dacloffset);
16351635
if (dacloffset) {
1636-
dacl_ptr = (struct cifs_acl *)((char *)pntsd + dacloffset);
1636+
dacl_ptr = (struct smb_acl *)((char *)pntsd + dacloffset);
16371637
if (mode_from_sid)
16381638
nsecdesclen +=
16391639
le32_to_cpu(dacl_ptr->num_aces) * sizeof(struct cifs_ace);

fs/smb/client/cifsacl.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
* owner, group and world).
3535
*/
3636
#define DEFAULT_SEC_DESC_LEN (sizeof(struct smb_ntsd) + \
37-
sizeof(struct cifs_acl) + \
37+
sizeof(struct smb_acl) + \
3838
(sizeof(struct cifs_ace) * 4))
3939

4040
/*
@@ -74,7 +74,7 @@ struct smb_sid {
7474
/* size of a struct smb_sid, sans sub_auth array */
7575
#define CIFS_SID_BASE_SIZE (1 + 1 + NUM_AUTHS)
7676

77-
struct cifs_acl {
77+
struct smb_acl {
7878
__le16 revision; /* revision level */
7979
__le16 size;
8080
__le32 num_aces;

0 commit comments

Comments
 (0)