Skip to content

Commit 65cccce

Browse files
paliSteve French
authored andcommitted
cifs: Remove struct reparse_posix_data from struct cifs_open_info_data
Linux SMB client already supports more reparse point types but only the reparse_posix_data is defined in union of struct cifs_open_info_data. This union is currently used as implicit casting between point types. With this code style, it hides information that union is used for pointer casting, and just in mknod_nfs() and posix_reparse_to_fattr() functions. Other reparse point buffers do not use this kind of casting. So remove reparse_posix_data from reparse part of struct cifs_open_info_data and for all cases of reparse buffer use just struct reparse_data_buffer *buf. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent 24cf729 commit 65cccce

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

fs/smb/client/cifsglob.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,10 +226,7 @@ struct cifs_open_info_data {
226226
struct kvec iov;
227227
} io;
228228
__u32 tag;
229-
union {
230-
struct reparse_data_buffer *buf;
231-
struct reparse_posix_data *posix;
232-
};
229+
struct reparse_data_buffer *buf;
233230
} reparse;
234231
struct {
235232
__u8 eas[SMB2_WSL_MAX_QUERY_EA_RESP_SIZE];

fs/smb/client/reparse.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ static int mknod_nfs(unsigned int xid, struct inode *inode,
294294

295295
data = (struct cifs_open_info_data) {
296296
.reparse_point = true,
297-
.reparse = { .tag = IO_REPARSE_TAG_NFS, .posix = p, },
297+
.reparse = { .tag = IO_REPARSE_TAG_NFS, .buf = (struct reparse_data_buffer *)p, },
298298
};
299299

300300
new = smb2_get_reparse_inode(&data, inode->i_sb, xid,
@@ -816,8 +816,7 @@ static bool posix_reparse_to_fattr(struct cifs_sb_info *cifs_sb,
816816
struct cifs_fattr *fattr,
817817
struct cifs_open_info_data *data)
818818
{
819-
struct reparse_posix_data *buf = data->reparse.posix;
820-
819+
struct reparse_posix_data *buf = (struct reparse_posix_data *)data->reparse.buf;
821820

822821
if (buf == NULL)
823822
return true;

0 commit comments

Comments
 (0)