Skip to content

Commit f9e3009

Browse files
ChenXiaoSongSasha Levin
authored andcommitted
smb/client: rename cifs_ntsd to smb_ntsd
[ Upstream commit 3651487 ] 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_ntsd/struct smb_ntsd/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 c7f4a55 commit f9e3009

File tree

9 files changed

+49
-49
lines changed

9 files changed

+49
-49
lines changed

fs/smb/client/cifsacl.c

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -515,8 +515,8 @@ exit_cifs_idmap(void)
515515
}
516516

517517
/* copy ntsd, owner sid, and group sid from a security descriptor to another */
518-
static __u32 copy_sec_desc(const struct cifs_ntsd *pntsd,
519-
struct cifs_ntsd *pnntsd,
518+
static __u32 copy_sec_desc(const struct smb_ntsd *pntsd,
519+
struct smb_ntsd *pnntsd,
520520
__u32 sidsoffset,
521521
struct cifs_sid *pownersid,
522522
struct cifs_sid *pgrpsid)
@@ -527,7 +527,7 @@ static __u32 copy_sec_desc(const struct cifs_ntsd *pntsd,
527527
/* copy security descriptor control portion */
528528
pnntsd->revision = pntsd->revision;
529529
pnntsd->type = pntsd->type;
530-
pnntsd->dacloffset = cpu_to_le32(sizeof(struct cifs_ntsd));
530+
pnntsd->dacloffset = cpu_to_le32(sizeof(struct smb_ntsd));
531531
pnntsd->sacloffset = 0;
532532
pnntsd->osidoffset = cpu_to_le32(sidsoffset);
533533
pnntsd->gsidoffset = cpu_to_le32(sidsoffset + sizeof(struct cifs_sid));
@@ -1191,7 +1191,7 @@ static int parse_sid(struct cifs_sid *psid, char *end_of_acl)
11911191

11921192
/* Convert CIFS ACL to POSIX form */
11931193
static int parse_sec_desc(struct cifs_sb_info *cifs_sb,
1194-
struct cifs_ntsd *pntsd, int acl_len, struct cifs_fattr *fattr,
1194+
struct smb_ntsd *pntsd, int acl_len, struct cifs_fattr *fattr,
11951195
bool get_mode_from_special_sid)
11961196
{
11971197
int rc = 0;
@@ -1249,7 +1249,7 @@ static int parse_sec_desc(struct cifs_sb_info *cifs_sb,
12491249
}
12501250

12511251
/* Convert permission bits from mode to equivalent CIFS ACL */
1252-
static int build_sec_desc(struct cifs_ntsd *pntsd, struct cifs_ntsd *pnntsd,
1252+
static int build_sec_desc(struct smb_ntsd *pntsd, struct smb_ntsd *pnntsd,
12531253
__u32 secdesclen, __u32 *pnsecdesclen, __u64 *pnmode, kuid_t uid, kgid_t gid,
12541254
bool mode_from_sid, bool id_from_sid, int *aclflag)
12551255
{
@@ -1279,7 +1279,7 @@ static int build_sec_desc(struct cifs_ntsd *pntsd, struct cifs_ntsd *pnntsd,
12791279
le32_to_cpu(pntsd->gsidoffset));
12801280

12811281
if (pnmode && *pnmode != NO_CHANGE_64) { /* chmod */
1282-
ndacloffset = sizeof(struct cifs_ntsd);
1282+
ndacloffset = sizeof(struct smb_ntsd);
12831283
ndacl_ptr = (struct cifs_acl *)((char *)pnntsd + ndacloffset);
12841284
ndacl_ptr->revision =
12851285
dacloffset ? dacl_ptr->revision : cpu_to_le16(ACL_REVISION);
@@ -1297,7 +1297,7 @@ static int build_sec_desc(struct cifs_ntsd *pntsd, struct cifs_ntsd *pnntsd,
12971297

12981298
*aclflag |= CIFS_ACL_DACL;
12991299
} else {
1300-
ndacloffset = sizeof(struct cifs_ntsd);
1300+
ndacloffset = sizeof(struct smb_ntsd);
13011301
ndacl_ptr = (struct cifs_acl *)((char *)pnntsd + ndacloffset);
13021302
ndacl_ptr->revision =
13031303
dacloffset ? dacl_ptr->revision : cpu_to_le16(ACL_REVISION);
@@ -1385,11 +1385,11 @@ static int build_sec_desc(struct cifs_ntsd *pntsd, struct cifs_ntsd *pnntsd,
13851385
}
13861386

13871387
#ifdef CONFIG_CIFS_ALLOW_INSECURE_LEGACY
1388-
struct cifs_ntsd *get_cifs_acl_by_fid(struct cifs_sb_info *cifs_sb,
1388+
struct smb_ntsd *get_cifs_acl_by_fid(struct cifs_sb_info *cifs_sb,
13891389
const struct cifs_fid *cifsfid, u32 *pacllen,
13901390
u32 __maybe_unused unused)
13911391
{
1392-
struct cifs_ntsd *pntsd = NULL;
1392+
struct smb_ntsd *pntsd = NULL;
13931393
unsigned int xid;
13941394
int rc;
13951395
struct tcon_link *tlink = cifs_sb_tlink(cifs_sb);
@@ -1410,10 +1410,10 @@ struct cifs_ntsd *get_cifs_acl_by_fid(struct cifs_sb_info *cifs_sb,
14101410
return pntsd;
14111411
}
14121412

1413-
static struct cifs_ntsd *get_cifs_acl_by_path(struct cifs_sb_info *cifs_sb,
1413+
static struct smb_ntsd *get_cifs_acl_by_path(struct cifs_sb_info *cifs_sb,
14141414
const char *path, u32 *pacllen)
14151415
{
1416-
struct cifs_ntsd *pntsd = NULL;
1416+
struct smb_ntsd *pntsd = NULL;
14171417
int oplock = 0;
14181418
unsigned int xid;
14191419
int rc;
@@ -1454,11 +1454,11 @@ static struct cifs_ntsd *get_cifs_acl_by_path(struct cifs_sb_info *cifs_sb,
14541454
}
14551455

14561456
/* Retrieve an ACL from the server */
1457-
struct cifs_ntsd *get_cifs_acl(struct cifs_sb_info *cifs_sb,
1457+
struct smb_ntsd *get_cifs_acl(struct cifs_sb_info *cifs_sb,
14581458
struct inode *inode, const char *path,
14591459
u32 *pacllen, u32 info)
14601460
{
1461-
struct cifs_ntsd *pntsd = NULL;
1461+
struct smb_ntsd *pntsd = NULL;
14621462
struct cifsFileInfo *open_file = NULL;
14631463

14641464
if (inode)
@@ -1472,7 +1472,7 @@ struct cifs_ntsd *get_cifs_acl(struct cifs_sb_info *cifs_sb,
14721472
}
14731473

14741474
/* Set an ACL on the server */
1475-
int set_cifs_acl(struct cifs_ntsd *pnntsd, __u32 acllen,
1475+
int set_cifs_acl(struct smb_ntsd *pnntsd, __u32 acllen,
14761476
struct inode *inode, const char *path, int aclflag)
14771477
{
14781478
int oplock = 0;
@@ -1528,7 +1528,7 @@ cifs_acl_to_fattr(struct cifs_sb_info *cifs_sb, struct cifs_fattr *fattr,
15281528
struct inode *inode, bool mode_from_special_sid,
15291529
const char *path, const struct cifs_fid *pfid)
15301530
{
1531-
struct cifs_ntsd *pntsd = NULL;
1531+
struct smb_ntsd *pntsd = NULL;
15321532
u32 acllen = 0;
15331533
int rc = 0;
15341534
struct tcon_link *tlink = cifs_sb_tlink(cifs_sb);
@@ -1581,8 +1581,8 @@ id_mode_to_cifs_acl(struct inode *inode, const char *path, __u64 *pnmode,
15811581
__u32 nsecdesclen = 0;
15821582
__u32 dacloffset = 0;
15831583
struct cifs_acl *dacl_ptr = NULL;
1584-
struct cifs_ntsd *pntsd = NULL; /* acl obtained from server */
1585-
struct cifs_ntsd *pnntsd = NULL; /* modified acl to be sent to server */
1584+
struct smb_ntsd *pntsd = NULL; /* acl obtained from server */
1585+
struct smb_ntsd *pnntsd = NULL; /* modified acl to be sent to server */
15861586
struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);
15871587
struct tcon_link *tlink = cifs_sb_tlink(cifs_sb);
15881588
struct smb_version_operations *ops;
@@ -1630,7 +1630,7 @@ id_mode_to_cifs_acl(struct inode *inode, const char *path, __u64 *pnmode,
16301630
nsecdesclen += 5 * sizeof(struct cifs_ace);
16311631
} else { /* chown */
16321632
/* When ownership changes, changes new owner sid length could be different */
1633-
nsecdesclen = sizeof(struct cifs_ntsd) + (sizeof(struct cifs_sid) * 2);
1633+
nsecdesclen = sizeof(struct smb_ntsd) + (sizeof(struct cifs_sid) * 2);
16341634
dacloffset = le32_to_cpu(pntsd->dacloffset);
16351635
if (dacloffset) {
16361636
dacl_ptr = (struct cifs_acl *)((char *)pntsd + dacloffset);

fs/smb/client/cifsacl.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
* Security Descriptor length containing DACL with 3 ACEs (one each for
3434
* owner, group and world).
3535
*/
36-
#define DEFAULT_SEC_DESC_LEN (sizeof(struct cifs_ntsd) + \
36+
#define DEFAULT_SEC_DESC_LEN (sizeof(struct smb_ntsd) + \
3737
sizeof(struct cifs_acl) + \
3838
(sizeof(struct cifs_ace) * 4))
3939

@@ -55,7 +55,7 @@
5555
#define SID_STRING_BASE_SIZE (2 + 3 + 15 + 1)
5656
#define SID_STRING_SUBAUTH_SIZE (11) /* size of a single subauth string */
5757

58-
struct cifs_ntsd {
58+
struct smb_ntsd {
5959
__le16 revision; /* revision level */
6060
__le16 type;
6161
__le32 osidoffset;
@@ -194,6 +194,6 @@ struct owner_group_sids {
194194
* Minimum security descriptor can be one without any SACL and DACL and can
195195
* consist of revision, type, and two sids of minimum size for owner and group
196196
*/
197-
#define MIN_SEC_DESC_LEN (sizeof(struct cifs_ntsd) + (2 * MIN_SID_LEN))
197+
#define MIN_SEC_DESC_LEN (sizeof(struct smb_ntsd) + (2 * MIN_SID_LEN))
198198

199199
#endif /* _CIFSACL_H */

fs/smb/client/cifsglob.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -539,12 +539,12 @@ struct smb_version_operations {
539539
int (*set_EA)(const unsigned int, struct cifs_tcon *, const char *,
540540
const char *, const void *, const __u16,
541541
const struct nls_table *, struct cifs_sb_info *);
542-
struct cifs_ntsd * (*get_acl)(struct cifs_sb_info *, struct inode *,
543-
const char *, u32 *, u32);
544-
struct cifs_ntsd * (*get_acl_by_fid)(struct cifs_sb_info *,
545-
const struct cifs_fid *, u32 *, u32);
546-
int (*set_acl)(struct cifs_ntsd *, __u32, struct inode *, const char *,
547-
int);
542+
struct smb_ntsd * (*get_acl)(struct cifs_sb_info *cifssb, struct inode *ino,
543+
const char *patch, u32 *plen, u32 info);
544+
struct smb_ntsd * (*get_acl_by_fid)(struct cifs_sb_info *cifssmb,
545+
const struct cifs_fid *pfid, u32 *plen, u32 info);
546+
int (*set_acl)(struct smb_ntsd *pntsd, __u32 len, struct inode *ino, const char *path,
547+
int flag);
548548
/* writepages retry size */
549549
unsigned int (*wp_retry_size)(struct inode *);
550550
/* get mtu credits */

fs/smb/client/cifsproto.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -231,16 +231,16 @@ extern int cifs_acl_to_fattr(struct cifs_sb_info *cifs_sb,
231231
const char *path, const struct cifs_fid *pfid);
232232
extern int id_mode_to_cifs_acl(struct inode *inode, const char *path, __u64 *pnmode,
233233
kuid_t uid, kgid_t gid);
234-
extern struct cifs_ntsd *get_cifs_acl(struct cifs_sb_info *, struct inode *,
235-
const char *, u32 *, u32);
236-
extern struct cifs_ntsd *get_cifs_acl_by_fid(struct cifs_sb_info *,
237-
const struct cifs_fid *, u32 *, u32);
234+
extern struct smb_ntsd *get_cifs_acl(struct cifs_sb_info *cifssmb, struct inode *ino,
235+
const char *path, u32 *plen, u32 info);
236+
extern struct smb_ntsd *get_cifs_acl_by_fid(struct cifs_sb_info *cifssb,
237+
const struct cifs_fid *pfid, u32 *plen, u32 info);
238238
extern struct posix_acl *cifs_get_acl(struct mnt_idmap *idmap,
239239
struct dentry *dentry, int type);
240240
extern int cifs_set_acl(struct mnt_idmap *idmap,
241241
struct dentry *dentry, struct posix_acl *acl, int type);
242-
extern int set_cifs_acl(struct cifs_ntsd *, __u32, struct inode *,
243-
const char *, int);
242+
extern int set_cifs_acl(struct smb_ntsd *pntsd, __u32 len, struct inode *ino,
243+
const char *path, int flag);
244244
extern unsigned int setup_authusers_ACE(struct cifs_ace *pace);
245245
extern unsigned int setup_special_mode_ACE(struct cifs_ace *pace, __u64 nmode);
246246
extern unsigned int setup_special_user_owner_ACE(struct cifs_ace *pace);
@@ -568,9 +568,9 @@ extern int CIFSSMBSetEA(const unsigned int xid, struct cifs_tcon *tcon,
568568
const struct nls_table *nls_codepage,
569569
struct cifs_sb_info *cifs_sb);
570570
extern int CIFSSMBGetCIFSACL(const unsigned int xid, struct cifs_tcon *tcon,
571-
__u16 fid, struct cifs_ntsd **acl_inf, __u32 *buflen);
571+
__u16 fid, struct smb_ntsd **acl_inf, __u32 *buflen);
572572
extern int CIFSSMBSetCIFSACL(const unsigned int, struct cifs_tcon *, __u16,
573-
struct cifs_ntsd *, __u32, int);
573+
struct smb_ntsd *pntsd, __u32 len, int aclflag);
574574
extern int cifs_do_get_acl(const unsigned int xid, struct cifs_tcon *tcon,
575575
const unsigned char *searchName,
576576
struct posix_acl **acl, const int acl_type,

fs/smb/client/cifssmb.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3385,7 +3385,7 @@ validate_ntransact(char *buf, char **ppparm, char **ppdata,
33853385
/* Get Security Descriptor (by handle) from remote server for a file or dir */
33863386
int
33873387
CIFSSMBGetCIFSACL(const unsigned int xid, struct cifs_tcon *tcon, __u16 fid,
3388-
struct cifs_ntsd **acl_inf, __u32 *pbuflen)
3388+
struct smb_ntsd **acl_inf, __u32 *pbuflen)
33893389
{
33903390
int rc = 0;
33913391
int buf_type = 0;
@@ -3455,7 +3455,7 @@ CIFSSMBGetCIFSACL(const unsigned int xid, struct cifs_tcon *tcon, __u16 fid,
34553455

34563456
/* check if buffer is big enough for the acl
34573457
header followed by the smallest SID */
3458-
if ((*pbuflen < sizeof(struct cifs_ntsd) + 8) ||
3458+
if ((*pbuflen < sizeof(struct smb_ntsd) + 8) ||
34593459
(*pbuflen >= 64 * 1024)) {
34603460
cifs_dbg(VFS, "bad acl length %d\n", *pbuflen);
34613461
rc = -EINVAL;
@@ -3475,7 +3475,7 @@ CIFSSMBGetCIFSACL(const unsigned int xid, struct cifs_tcon *tcon, __u16 fid,
34753475

34763476
int
34773477
CIFSSMBSetCIFSACL(const unsigned int xid, struct cifs_tcon *tcon, __u16 fid,
3478-
struct cifs_ntsd *pntsd, __u32 acllen, int aclflag)
3478+
struct smb_ntsd *pntsd, __u32 acllen, int aclflag)
34793479
{
34803480
__u16 byte_count, param_count, data_count, param_offset, data_offset;
34813481
int rc = 0;

fs/smb/client/smb2ops.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3001,11 +3001,11 @@ smb2_get_dfs_refer(const unsigned int xid, struct cifs_ses *ses,
30013001
return rc;
30023002
}
30033003

3004-
static struct cifs_ntsd *
3004+
static struct smb_ntsd *
30053005
get_smb2_acl_by_fid(struct cifs_sb_info *cifs_sb,
30063006
const struct cifs_fid *cifsfid, u32 *pacllen, u32 info)
30073007
{
3008-
struct cifs_ntsd *pntsd = NULL;
3008+
struct smb_ntsd *pntsd = NULL;
30093009
unsigned int xid;
30103010
int rc = -EOPNOTSUPP;
30113011
struct tcon_link *tlink = cifs_sb_tlink(cifs_sb);
@@ -3030,11 +3030,11 @@ get_smb2_acl_by_fid(struct cifs_sb_info *cifs_sb,
30303030

30313031
}
30323032

3033-
static struct cifs_ntsd *
3033+
static struct smb_ntsd *
30343034
get_smb2_acl_by_path(struct cifs_sb_info *cifs_sb,
30353035
const char *path, u32 *pacllen, u32 info)
30363036
{
3037-
struct cifs_ntsd *pntsd = NULL;
3037+
struct smb_ntsd *pntsd = NULL;
30383038
u8 oplock = SMB2_OPLOCK_LEVEL_NONE;
30393039
unsigned int xid;
30403040
int rc;
@@ -3097,7 +3097,7 @@ get_smb2_acl_by_path(struct cifs_sb_info *cifs_sb,
30973097
}
30983098

30993099
static int
3100-
set_smb2_acl(struct cifs_ntsd *pnntsd, __u32 acllen,
3100+
set_smb2_acl(struct smb_ntsd *pnntsd, __u32 acllen,
31013101
struct inode *inode, const char *path, int aclflag)
31023102
{
31033103
u8 oplock = SMB2_OPLOCK_LEVEL_NONE;
@@ -3155,12 +3155,12 @@ set_smb2_acl(struct cifs_ntsd *pnntsd, __u32 acllen,
31553155
}
31563156

31573157
/* Retrieve an ACL from the server */
3158-
static struct cifs_ntsd *
3158+
static struct smb_ntsd *
31593159
get_smb2_acl(struct cifs_sb_info *cifs_sb,
31603160
struct inode *inode, const char *path,
31613161
u32 *pacllen, u32 info)
31623162
{
3163-
struct cifs_ntsd *pntsd = NULL;
3163+
struct smb_ntsd *pntsd = NULL;
31643164
struct cifsFileInfo *open_file = NULL;
31653165

31663166
if (inode && !(info & SACL_SECINFO))

fs/smb/client/smb2pdu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5626,7 +5626,7 @@ SMB2_set_eof(const unsigned int xid, struct cifs_tcon *tcon, u64 persistent_fid,
56265626
int
56275627
SMB2_set_acl(const unsigned int xid, struct cifs_tcon *tcon,
56285628
u64 persistent_fid, u64 volatile_fid,
5629-
struct cifs_ntsd *pnntsd, int pacllen, int aclflag)
5629+
struct smb_ntsd *pnntsd, int pacllen, int aclflag)
56305630
{
56315631
return send_set_info(xid, tcon, persistent_fid, volatile_fid,
56325632
current->tgid, 0, SMB2_O_INFO_SECURITY, aclflag,

fs/smb/client/smb2proto.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ extern int SMB2_set_info_init(struct cifs_tcon *tcon,
247247
extern void SMB2_set_info_free(struct smb_rqst *rqst);
248248
extern int SMB2_set_acl(const unsigned int xid, struct cifs_tcon *tcon,
249249
u64 persistent_fid, u64 volatile_fid,
250-
struct cifs_ntsd *pnntsd, int pacllen, int aclflag);
250+
struct smb_ntsd *pnntsd, int pacllen, int aclflag);
251251
extern int SMB2_set_ea(const unsigned int xid, struct cifs_tcon *tcon,
252252
u64 persistent_fid, u64 volatile_fid,
253253
struct smb2_file_full_ea_info *buf, int len);

fs/smb/client/xattr.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ static int cifs_xattr_set(const struct xattr_handler *handler,
162162
case XATTR_CIFS_ACL:
163163
case XATTR_CIFS_NTSD:
164164
case XATTR_CIFS_NTSD_FULL: {
165-
struct cifs_ntsd *pacl;
165+
struct smb_ntsd *pacl;
166166

167167
if (!value)
168168
goto out;
@@ -315,7 +315,7 @@ static int cifs_xattr_get(const struct xattr_handler *handler,
315315
* fetch owner and DACL otherwise
316316
*/
317317
u32 acllen, extra_info;
318-
struct cifs_ntsd *pacl;
318+
struct smb_ntsd *pacl;
319319

320320
if (pTcon->ses->server->ops->get_acl == NULL)
321321
goto out; /* rc already EOPNOTSUPP */

0 commit comments

Comments
 (0)