*/
#include "includes.h"
+#include "smbd/globals.h"
static bool setup_write_cache(files_struct *, SMB_OFF_T);
return(ret);
}
-/* how many write cache buffers have been allocated */
-static unsigned int allocated_write_caches;
-
/****************************************************************************
*Really* write to a file.
****************************************************************************/
{
int delay;
+ if (fsp->posix_open) {
+ /* Don't use delayed writes on POSIX files. */
+ return;
+ }
+
if (fsp->write_time_forced) {
/* No point - "sticky" write times
* in effect.
void trigger_write_time_update_immediate(struct files_struct *fsp)
{
+ if (fsp->posix_open) {
+ /* Don't use delayed writes on POSIX files. */
+ return;
+ }
+
if (fsp->write_time_forced) {
/*
* No point - "sticky" write times
int write_path = -1;
if (fsp->print_file) {
- fstring sharename;
uint32 jobid;
- if (!rap_to_pjobid(fsp->rap_print_jobid, sharename, &jobid)) {
+ if (!rap_to_pjobid(fsp->rap_print_jobid, NULL, &jobid)) {
DEBUG(3,("write_file: Unable to map RAP jobid %u to jobid.\n",
(unsigned int)fsp->rap_print_jobid ));
errno = EBADF;
*/
if (EXCLUSIVE_OPLOCK_TYPE(fsp->oplock_type) && !wcp) {
- setup_write_cache(fsp, st.st_size);
+ setup_write_cache(fsp, st.st_ex_size);
wcp = fsp->wcp;
}
}
* the shared memory area whilst doing this.
*/
- release_level_2_oplocks_on_change(fsp);
+ /* This should actually be improved to span the write. */
+ contend_level2_oplocks_begin(fsp, LEVEL2_CONTEND_WRITE);
+ contend_level2_oplocks_end(fsp, LEVEL2_CONTEND_WRITE);
#ifdef WITH_PROFILE
if (profile_p && profile_p->writecache_total_writes % 500 == 0) {
int fsp_stat(files_struct *fsp, SMB_STRUCT_STAT *pst)
{
if (fsp->fh->fd == -1) {
- return SMB_VFS_STAT(fsp->conn, fsp->fsp_name, pst);
+ return vfs_stat_smb_fname(fsp->conn, fsp->fsp_name, pst);
} else {
return SMB_VFS_FSTAT(fsp, pst);
}