WRITE_FLUSH is defined in fs.h in Linux.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
*/
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 */
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;
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);
return n;
}
- flush_write_cache(fsp, READ_FLUSH);
+ flush_write_cache(fsp, SAMBA_READ_FLUSH);
fsp->fh->pos = pos;
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
/* 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;
}
+-----------------------+--------+
*/
- 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);
}
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);
}
}
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);
}
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);
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) {
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. */
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);
}
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,
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;
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);