]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:smbd: rename get_FileIndex() to get_fs_file_id()
authorRalph Boehme <slow@samba.org>
Fri, 28 Jun 2019 08:12:44 +0000 (10:12 +0200)
committerJeremy Allison <jra@samba.org>
Mon, 1 Jul 2019 21:43:24 +0000 (21:43 +0000)
Also rename all variable used to store the result of the renamed
get_fs_file_id() in the callers.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/proto.h
source3/smbd/smb2_create.c
source3/smbd/trans2.c

index a0424388bec247bddb8542a41a0b1fc29401a9f6..23c59000da15ac43bef2c390dcb5fcae33c76ebd 100644 (file)
@@ -1161,7 +1161,7 @@ int sys_statvfs(const char *path, vfs_statvfs_struct *statbuf);
 NTSTATUS check_access_fsp(const struct files_struct *fsp,
                          uint32_t access_mask);
 uint64_t smb_roundup(connection_struct *conn, uint64_t val);
-uint64_t get_FileIndex(connection_struct *conn, const SMB_STRUCT_STAT *psbuf);
+uint64_t get_fs_file_id(connection_struct *conn, const SMB_STRUCT_STAT *psbuf);
 void aapl_force_zero_file_id(struct smbd_server_connection *sconn);
 bool samba_private_attr_name(const char *unix_ea_name);
 NTSTATUS get_ea_value(TALLOC_CTX *mem_ctx, connection_struct *conn,
index 96a50741af9f5a6c0734f971d035b6f2d9519b96..55dfb148c8ef1c7dbbea32bdc6a5e5637b9b40d3 100644 (file)
@@ -1389,8 +1389,8 @@ static void smbd_smb2_create_after_exec(struct tevent_req *req)
 
        if (state->qfid != NULL) {
                uint8_t p[32];
-               uint64_t file_index = get_FileIndex(state->result->conn,
-                                                   &state->result->fsp_name->st);
+               uint64_t file_id = get_fs_file_id(state->result->conn,
+                                                 &state->result->fsp_name->st);
                DATA_BLOB blob = data_blob_const(p, sizeof(p));
 
                ZERO_STRUCT(p);
@@ -1399,7 +1399,7 @@ static void smbd_smb2_create_after_exec(struct tevent_req *req)
                   the MS plugfest. The first 8 bytes are the "volume index"
                   == inode, the second 8 bytes are the "volume id",
                   == dev. This will be updated in the SMB2 doc. */
-               SBVAL(p, 0, file_index);
+               SBVAL(p, 0, file_id);
                SIVAL(p, 8, state->result->fsp_name->st.st_ex_dev);/* FileIndexHigh */
 
                status = smb2_create_blob_add(state->out_context_blobs,
index 02a6d4b24071d7455c7c4ad8dcd254a7ea4b8f14..a268e97218f9a8055e629282669788861671a427 100644 (file)
@@ -219,18 +219,18 @@ uint64_t smb_roundup(connection_struct *conn, uint64_t val)
  mangle as we used to do.
 ********************************************************************/
 
-uint64_t get_FileIndex(connection_struct *conn, const SMB_STRUCT_STAT *psbuf)
+uint64_t get_fs_file_id(connection_struct *conn, const SMB_STRUCT_STAT *psbuf)
 {
-       uint64_t file_index;
+       uint64_t file_id;
        if (conn->sconn->aapl_zero_file_id) {
                return 0;
        }
        if (conn->base_share_dev == psbuf->st_ex_dev) {
                return (uint64_t)psbuf->st_ex_ino;
        }
-       file_index = ((psbuf->st_ex_ino) & UINT32_MAX); /* FileIndexLow */
-       file_index |= ((uint64_t)((psbuf->st_ex_dev) & UINT32_MAX)) << 32; /* FileIndexHigh */
-       return file_index;
+       file_id = ((psbuf->st_ex_ino) & UINT32_MAX); /* FileIDLow */
+       file_id |= ((uint64_t)((psbuf->st_ex_dev) & UINT32_MAX)) << 32; /* FileIDHigh */
+       return file_id;
 }
 
 
@@ -1836,7 +1836,7 @@ static NTSTATUS smbd_marshall_dir_entry(TALLOC_CTX *ctx,
        uint32_t reskey=0;
        uint64_t file_size = 0;
        uint64_t allocation_size = 0;
-       uint64_t file_index = 0;
+       uint64_t file_id = 0;
        size_t len = 0;
        struct timespec mdate_ts = {0};
        struct timespec adate_ts = {0};
@@ -1863,7 +1863,7 @@ static NTSTATUS smbd_marshall_dir_entry(TALLOC_CTX *ctx,
                }
        }
 
-       file_index = get_FileIndex(conn, &smb_fname->st);
+       file_id = get_fs_file_id(conn, &smb_fname->st);
 
        mdate_ts = smb_fname->st.st_ex_mtime;
        adate_ts = smb_fname->st.st_ex_atime;
@@ -2281,7 +2281,7 @@ static NTSTATUS smbd_marshall_dir_entry(TALLOC_CTX *ctx,
                }
                p += 4;
                SIVAL(p,0,0); p += 4; /* Unknown - reserved ? */
-               SBVAL(p,0,file_index); p += 8;
+               SBVAL(p,0,file_id); p += 8;
                status = srvstr_push(base_data, flags2, p,
                                  fname, PTR_DIFF(end_data, p),
                                  STR_TERMINATE_ASCII, &len);
@@ -2402,7 +2402,7 @@ static NTSTATUS smbd_marshall_dir_entry(TALLOC_CTX *ctx,
                }
                p += 2;
 
-               SBVAL(p,0,file_index); p += 8;
+               SBVAL(p,0,file_id); p += 8;
                status = srvstr_push(base_data, flags2, p,
                                  fname, PTR_DIFF(end_data, p),
                                  STR_TERMINATE_ASCII, &len);
@@ -5110,7 +5110,7 @@ NTSTATUS smbd_do_qfilepathinfo(connection_struct *conn,
        uint64_t file_size = 0;
        uint64_t pos = 0;
        uint64_t allocation_size = 0;
-       uint64_t file_index = 0;
+       uint64_t file_id = 0;
        uint32_t access_mask = 0;
        size_t len = 0;
 
@@ -5231,7 +5231,7 @@ NTSTATUS smbd_do_qfilepathinfo(connection_struct *conn,
 
           I think this causes us to fail the IFSKIT
           BasicFileInformationTest. -tpot */
-       file_index = get_FileIndex(conn, psbuf);
+       file_id = get_fs_file_id(conn, psbuf);
 
        *fixed_portion = 0;
 
@@ -5575,7 +5575,7 @@ NTSTATUS smbd_do_qfilepathinfo(connection_struct *conn,
                        SCVAL(pdata,    0x3C, delete_pending);
                        SCVAL(pdata,    0x3D, (mode&FILE_ATTRIBUTE_DIRECTORY)?1:0);
                        SSVAL(pdata,    0x3E, 0); /* padding */
-                       SBVAL(pdata,    0x40, file_index);
+                       SBVAL(pdata,    0x40, file_id);
                        SIVAL(pdata,    0x48, ea_size);
                        SIVAL(pdata,    0x4C, access_mask);
                        SBVAL(pdata,    0x50, pos);
@@ -5600,7 +5600,7 @@ NTSTATUS smbd_do_qfilepathinfo(connection_struct *conn,
                case SMB_FILE_INTERNAL_INFORMATION:
 
                        DEBUG(10,("smbd_do_qfilepathinfo: SMB_FILE_INTERNAL_INFORMATION\n"));
-                       SBVAL(pdata, 0, file_index);
+                       SBVAL(pdata, 0, file_id);
                        data_size = 8;
                        *fixed_portion = 8;
                        break;