]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
cifs: Remove struct reparse_posix_data from struct cifs_open_info_data
authorPali Rohár <pali@kernel.org>
Sat, 28 Sep 2024 12:13:44 +0000 (14:13 +0200)
committerSteve French <stfrench@microsoft.com>
Wed, 29 Jan 2025 23:12:56 +0000 (17:12 -0600)
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>
fs/smb/client/cifsglob.h
fs/smb/client/reparse.c

index 49ffc040f736c7b9715afe099ea0cfcfdd33c595..63f23a845e15dbcd824b3e99d98dafcb38714654 100644 (file)
@@ -226,10 +226,7 @@ struct cifs_open_info_data {
                        struct kvec iov;
                } io;
                __u32 tag;
-               union {
-                       struct reparse_data_buffer *buf;
-                       struct reparse_posix_data *posix;
-               };
+               struct reparse_data_buffer *buf;
        } reparse;
        struct {
                __u8            eas[SMB2_WSL_MAX_QUERY_EA_RESP_SIZE];
index 0e47b8e097a09659243a23ce060a81abe29fcccc..77f891f718c0c5d9ac406dea2386b86ca1707778 100644 (file)
@@ -294,7 +294,7 @@ static int mknod_nfs(unsigned int xid, struct inode *inode,
 
        data = (struct cifs_open_info_data) {
                .reparse_point = true,
-               .reparse = { .tag = IO_REPARSE_TAG_NFS, .posix = p, },
+               .reparse = { .tag = IO_REPARSE_TAG_NFS, .buf = (struct reparse_data_buffer *)p, },
        };
 
        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,
                                   struct cifs_fattr *fattr,
                                   struct cifs_open_info_data *data)
 {
-       struct reparse_posix_data *buf = data->reparse.posix;
-
+       struct reparse_posix_data *buf = (struct reparse_posix_data *)data->reparse.buf;
 
        if (buf == NULL)
                return true;