]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
cifs: Remove symlink member from cifs_open_info_data union
authorPali Rohár <pali@kernel.org>
Thu, 26 Dec 2024 13:50:38 +0000 (14:50 +0100)
committerSteve French <stfrench@microsoft.com>
Wed, 29 Jan 2025 23:19:52 +0000 (17:19 -0600)
Member 'symlink' is part of the union in struct cifs_open_info_data. Its
value is assigned on few places, but is always read through another union
member 'reparse_point'. So to make code more readable, always use only
'reparse_point' member and drop whole union structure. No function change.

Signed-off-by: Pali Rohár <pali@kernel.org>
Acked-by: Paulo Alcantara (Red Hat) <pc@manguebit.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/cifsglob.h
fs/smb/client/inode.c
fs/smb/client/smb1ops.c

index 63f23a845e15dbcd824b3e99d98dafcb38714654..2266b5b9a19fb7f77085b53f9e6ec2153a55f2f6 100644 (file)
@@ -215,10 +215,7 @@ struct cifs_cred {
 
 struct cifs_open_info_data {
        bool adjust_tz;
-       union {
-               bool reparse_point;
-               bool symlink;
-       };
+       bool reparse_point;
        struct {
                /* ioctl response buffer */
                struct {
index 93e9188b2632fdea3da95ef6d4507970c17451af..8896c88320c8dec1de251dbb4f3d0b38e25c1b8e 100644 (file)
@@ -990,7 +990,7 @@ cifs_get_file_info(struct file *filp)
                /* TODO: add support to query reparse tag */
                data.adjust_tz = false;
                if (data.symlink_target) {
-                       data.symlink = true;
+                       data.reparse_point = true;
                        data.reparse.tag = IO_REPARSE_TAG_SYMLINK;
                }
                path = build_path_from_dentry(dentry, page);
index 55014c22f08283ad02b25768ba0d27d90b123bba..236289ff14eddd9455ecf0112fdc05ac95b43c1e 100644 (file)
@@ -551,7 +551,7 @@ static int cifs_query_path_info(const unsigned int xid,
        int rc;
        FILE_ALL_INFO fi = {};
 
-       data->symlink = false;
+       data->reparse_point = false;
        data->adjust_tz = false;
 
        /* could do find first instead but this returns more info */
@@ -592,7 +592,7 @@ static int cifs_query_path_info(const unsigned int xid,
                /* Need to check if this is a symbolic link or not */
                tmprc = CIFS_open(xid, &oparms, &oplock, NULL);
                if (tmprc == -EOPNOTSUPP)
-                       data->symlink = true;
+                       data->reparse_point = true;
                else if (tmprc == 0)
                        CIFSSMBClose(xid, tcon, fid.netfid);
        }