Rename the profile enums with a SAMBA_ prefix to avoid conflict with system files.
authorJeremy Allison <jra@samba.org>
Fri, 22 Nov 2013 05:33:33 +0000 (21:33 -0800)
committerJeremy Allison <jra@samba.org>
Fri, 22 Nov 2013 16:56:38 +0000 (08:56 -0800)
WRITE_FLUSH is defined in fs.h in Linux.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
source3/include/smb.h
source3/include/smbprofile.h
source3/smbd/close.c
source3/smbd/fileio.c
source3/smbd/oplock.c
source3/smbd/reply.c
source3/smbd/vfs.c
source3/utils/status_profile.c

index 52e1d7d5db79cb120ed1b4f16b482b4ec30f0efa..34900db62a9533b3e346b4072ece245666d708fa 100644 (file)
@@ -897,15 +897,15 @@ struct smb_extended_info {
  */
 
 enum flush_reason_enum {
-    SEEK_FLUSH,
-    READ_FLUSH,
-    WRITE_FLUSH,
-    READRAW_FLUSH,
-    OPLOCK_RELEASE_FLUSH,
-    CLOSE_FLUSH,
-    SYNC_FLUSH,
-    SIZECHANGE_FLUSH,
+    SAMBA_SEEK_FLUSH,
+    SAMBA_READ_FLUSH,
+    SAMBA_WRITE_FLUSH,
+    SAMBA_READRAW_FLUSH,
+    SAMBA_OPLOCK_RELEASE_FLUSH,
+    SAMBA_CLOSE_FLUSH,
+    SAMBA_SYNC_FLUSH,
+    SAMBA_SIZECHANGE_FLUSH,
     /* NUM_FLUSH_REASONS must remain the last value in the enumeration. */
-    NUM_FLUSH_REASONS};
+    SAMBA_NUM_FLUSH_REASONS};
 
 #endif /* _SMB_H */
index 79410e597f742b7840a2ae3281b2c0f5e45591c5..8ecbc301238810977660ca35dd56a8b01bce06dd 100644 (file)
@@ -870,7 +870,7 @@ struct profile_stats {
        unsigned writecache_non_oplock_writes;
        unsigned writecache_direct_writes;
        unsigned writecache_init_writes;
-       unsigned writecache_flushed_writes[NUM_FLUSH_REASONS];
+       unsigned writecache_flushed_writes[SAMBA_NUM_FLUSH_REASONS];
        unsigned writecache_num_perfect_writes;
        unsigned writecache_num_write_caches;
        unsigned writecache_allocated_write_caches;
index 6153066018f3d4c3e53221d60a6762ccd4faa512..02babb7a9efbb310de977523dae013a960ba99a0 100644 (file)
@@ -148,7 +148,7 @@ static NTSTATUS close_filestruct(files_struct *fsp)
        NTSTATUS status = NT_STATUS_OK;
 
        if (fsp->fh->fd != -1) {
-               if(flush_write_cache(fsp, CLOSE_FLUSH) == -1) {
+               if(flush_write_cache(fsp, SAMBA_CLOSE_FLUSH) == -1) {
                        status = map_nt_error_from_unix(errno);
                }
                delete_write_cache(fsp);
index 96eb24b0732a673e814acc99aef1f9aa256d6df6..9ac4ae41c16980d95774a31d1ec8e380b8fc86b0 100644 (file)
@@ -82,7 +82,7 @@ ssize_t read_file(files_struct *fsp,char *data,off_t pos,size_t n)
                return n;
        }
 
-       flush_write_cache(fsp, READ_FLUSH);
+       flush_write_cache(fsp, SAMBA_READ_FLUSH);
 
        fsp->fh->pos = pos;
 
@@ -379,13 +379,13 @@ nonop=%u allocated=%u active=%u direct=%u perfect=%u readhits=%u\n",
                        profile_p->writecache_read_hits ));
 
                DEBUG(3,("WRITECACHE: Flushes SEEK=%d, READ=%d, WRITE=%d, READRAW=%d, OPLOCK=%d, CLOSE=%d, SYNC=%d\n",
-                       profile_p->writecache_flushed_writes[SEEK_FLUSH],
-                       profile_p->writecache_flushed_writes[READ_FLUSH],
-                       profile_p->writecache_flushed_writes[WRITE_FLUSH],
-                       profile_p->writecache_flushed_writes[READRAW_FLUSH],
-                       profile_p->writecache_flushed_writes[OPLOCK_RELEASE_FLUSH],
-                       profile_p->writecache_flushed_writes[CLOSE_FLUSH],
-                       profile_p->writecache_flushed_writes[SYNC_FLUSH] ));
+                       profile_p->writecache_flushed_writes[SAMBA_SEEK_FLUSH],
+                       profile_p->writecache_flushed_writes[SAMBA_READ_FLUSH],
+                       profile_p->writecache_flushed_writes[SAMBA_WRITE_FLUSH],
+                       profile_p->writecache_flushed_writes[SAMBA_READRAW_FLUSH],
+                       profile_p->writecache_flushed_writes[SAMBA_OPLOCK_RELEASE_FLUSH],
+                       profile_p->writecache_flushed_writes[SAMBA_CLOSE_FLUSH],
+                       profile_p->writecache_flushed_writes[SAMBA_SYNC_FLUSH] ));
        }
 #endif
 
@@ -393,7 +393,7 @@ nonop=%u allocated=%u active=%u direct=%u perfect=%u readhits=%u\n",
                /* If we're using receivefile don't
                 * deal with a write cache.
                 */
-               flush_write_cache(fsp, WRITE_FLUSH);
+               flush_write_cache(fsp, SAMBA_WRITE_FLUSH);
                delete_write_cache(fsp);
                wcp = NULL;
        }
@@ -689,7 +689,7 @@ nonop=%u allocated=%u active=%u direct=%u perfect=%u readhits=%u\n",
                                  +-----------------------+--------+
                         */
 
-                       flush_write_cache(fsp, WRITE_FLUSH);
+                       flush_write_cache(fsp, SAMBA_WRITE_FLUSH);
                        wcp->offset = wcp->file_size;
                        wcp->data_size = pos - wcp->file_size + 1;
                        memset(wcp->data, '\0', wcp->data_size);
@@ -793,12 +793,12 @@ cache: fd = %d, off=%.0f, size=%u\n", fsp->fh->fd, (double)wcp->offset, (unsigne
                }
 
                if (cache_flush_needed) {
-                       DEBUG(3,("WRITE_FLUSH:%d: due to noncontinuous write: fd = %d, size = %.0f, pos = %.0f, \
+                       DEBUG(3,("SAMBA_WRITE_FLUSH:%d: due to noncontinuous write: fd = %d, size = %.0f, pos = %.0f, \
 n = %u, wcp->offset=%.0f, wcp->data_size=%u\n",
                                write_path, fsp->fh->fd, (double)wcp->file_size, (double)pos, (unsigned int)n,
                                (double)wcp->offset, (unsigned int)wcp->data_size ));
 
-                       flush_write_cache(fsp, WRITE_FLUSH);
+                       flush_write_cache(fsp, SAMBA_WRITE_FLUSH);
                }
        }
 
@@ -1027,7 +1027,7 @@ NTSTATUS sync_file(connection_struct *conn, files_struct *fsp, bool write_throug
 
        if (lp_strict_sync(SNUM(conn)) &&
            (lp_syncalways(SNUM(conn)) || write_through)) {
-               int ret = flush_write_cache(fsp, SYNC_FLUSH);
+               int ret = flush_write_cache(fsp, SAMBA_SYNC_FLUSH);
                if (ret == -1) {
                        return map_nt_error_from_unix(errno);
                }
index 312855d22a53fea00e56eba9bef02006feba480f..02cd0bbc45b655369c56e14d53acf9a57fa2a9fe 100644 (file)
@@ -114,7 +114,7 @@ static void release_file_oplock(files_struct *fsp)
        fsp->oplock_type = NO_OPLOCK;
        fsp->sent_oplock_break = NO_BREAK_SENT;
 
-       flush_write_cache(fsp, OPLOCK_RELEASE_FLUSH);
+       flush_write_cache(fsp, SAMBA_OPLOCK_RELEASE_FLUSH);
        delete_write_cache(fsp);
 
        TALLOC_FREE(fsp->oplock_timeout);
index b160290345c85a33c3f3fc6b06a46849661dfd1e..ffbfabbca51cb041045b6594e873097a8bdfda47 100644 (file)
@@ -3390,7 +3390,7 @@ void reply_readbraw(struct smb_request *req)
                return;
        }
 
-       flush_write_cache(fsp, READRAW_FLUSH);
+       flush_write_cache(fsp, SAMBA_READRAW_FLUSH);
 
        startpos = IVAL_TO_SMB_OFF_T(req->vwv+1, 0);
        if(req->wct == 10) {
@@ -4888,7 +4888,7 @@ void reply_lseek(struct smb_request *req)
                return;
        }
 
-       flush_write_cache(fsp, SEEK_FLUSH);
+       flush_write_cache(fsp, SAMBA_SEEK_FLUSH);
 
        mode = SVAL(req->vwv+1, 0) & 3;
        /* NB. This doesn't use IVAL_TO_SMB_OFF_T as startpos can be signed in this case. */
index ca6500cf8cc69564cb16edb7cc62f00eaed9a826..de0cc97205697487630400d24697e8a39c6e02ef 100644 (file)
@@ -551,7 +551,7 @@ int vfs_allocate_file_space(files_struct *fsp, uint64_t len)
 
                contend_level2_oplocks_begin(fsp, LEVEL2_CONTEND_ALLOC_SHRINK);
 
-               flush_write_cache(fsp, SIZECHANGE_FLUSH);
+               flush_write_cache(fsp, SAMBA_SIZECHANGE_FLUSH);
                if ((ret = SMB_VFS_FTRUNCATE(fsp, (off_t)len)) != -1) {
                        set_filelen_write_cache(fsp, len);
                }
@@ -616,7 +616,7 @@ int vfs_set_filelen(files_struct *fsp, off_t len)
 
        DEBUG(10,("vfs_set_filelen: ftruncate %s to len %.0f\n",
                  fsp_str_dbg(fsp), (double)len));
-       flush_write_cache(fsp, SIZECHANGE_FLUSH);
+       flush_write_cache(fsp, SAMBA_SIZECHANGE_FLUSH);
        if ((ret = SMB_VFS_FTRUNCATE(fsp, len)) != -1) {
                set_filelen_write_cache(fsp, len);
                notify_fname(fsp->conn, NOTIFY_ACTION_MODIFIED,
@@ -705,7 +705,7 @@ int vfs_fill_sparse(files_struct *fsp, off_t len)
 
        contend_level2_oplocks_begin(fsp, LEVEL2_CONTEND_FILL_SPARSE);
 
-       flush_write_cache(fsp, SIZECHANGE_FLUSH);
+       flush_write_cache(fsp, SAMBA_SIZECHANGE_FLUSH);
 
        offset = fsp->fsp_name->st.st_ex_size;
        num_to_write = len - fsp->fsp_name->st.st_ex_size;
index 0f722196a51f697dcb9f64f4c894a893e77fa22d..0923bae24999b55a627a82e2ac0ea845af950b29 100644 (file)
@@ -136,14 +136,14 @@ bool status_profile_dump(bool verbose)
        d_printf("non_oplock_writes:              %u\n", profile_p->writecache_non_oplock_writes);
        d_printf("direct_writes:                  %u\n", profile_p->writecache_direct_writes);
        d_printf("init_writes:                    %u\n", profile_p->writecache_init_writes);
-       d_printf("flushed_writes[SEEK]:           %u\n", profile_p->writecache_flushed_writes[SEEK_FLUSH]);
-       d_printf("flushed_writes[READ]:           %u\n", profile_p->writecache_flushed_writes[READ_FLUSH]);
-       d_printf("flushed_writes[WRITE]:          %u\n", profile_p->writecache_flushed_writes[WRITE_FLUSH]);
-       d_printf("flushed_writes[READRAW]:        %u\n", profile_p->writecache_flushed_writes[READRAW_FLUSH]);
-       d_printf("flushed_writes[OPLOCK_RELEASE]: %u\n", profile_p->writecache_flushed_writes[OPLOCK_RELEASE_FLUSH]);
-       d_printf("flushed_writes[CLOSE]:          %u\n", profile_p->writecache_flushed_writes[CLOSE_FLUSH]);
-       d_printf("flushed_writes[SYNC]:           %u\n", profile_p->writecache_flushed_writes[SYNC_FLUSH]);
-       d_printf("flushed_writes[SIZECHANGE]:     %u\n", profile_p->writecache_flushed_writes[SIZECHANGE_FLUSH]);
+       d_printf("flushed_writes[SEEK]:           %u\n", profile_p->writecache_flushed_writes[SAMBA_SEEK_FLUSH]);
+       d_printf("flushed_writes[READ]:           %u\n", profile_p->writecache_flushed_writes[SAMBA_READ_FLUSH]);
+       d_printf("flushed_writes[WRITE]:          %u\n", profile_p->writecache_flushed_writes[SAMBA_WRITE_FLUSH]);
+       d_printf("flushed_writes[READRAW]:        %u\n", profile_p->writecache_flushed_writes[SAMBA_READRAW_FLUSH]);
+       d_printf("flushed_writes[OPLOCK_RELEASE]: %u\n", profile_p->writecache_flushed_writes[SAMBA_OPLOCK_RELEASE_FLUSH]);
+       d_printf("flushed_writes[CLOSE]:          %u\n", profile_p->writecache_flushed_writes[SAMBA_CLOSE_FLUSH]);
+       d_printf("flushed_writes[SYNC]:           %u\n", profile_p->writecache_flushed_writes[SAMBA_SYNC_FLUSH]);
+       d_printf("flushed_writes[SIZECHANGE]:     %u\n", profile_p->writecache_flushed_writes[SAMBA_SIZECHANGE_FLUSH]);
        d_printf("num_perfect_writes:             %u\n", profile_p->writecache_num_perfect_writes);
        d_printf("num_write_caches:               %u\n", profile_p->writecache_num_write_caches);
        d_printf("allocated_write_caches:         %u\n", profile_p->writecache_allocated_write_caches);