Rev 653: allow sync on close to be disabled,
using "syncops:onclose = no" in http://samba.org/~tridge/3_0-ctdb
tridge at samba.org
tridge at samba.org
Fri Oct 19 02:19:10 GMT 2007
------------------------------------------------------------
revno: 653
revision-id: tridge at samba.org-20071019021909-vevb5d1gar3bwy0v
parent: tridge at samba.org-20071018042739-pkht3q9o2wrcka6d
committer: Andrew Tridgell <tridge at samba.org>
branch nick: s3-ctdb-tridge
timestamp: Fri 2007-10-19 12:19:09 +1000
message:
allow sync on close to be disabled, using "syncops:onclose = no"
modified:
source/modules/vfs_syncops.c vfs_syncops.c-20071016091912-7y95np83tib2zgxn-1
=== modified file 'source/modules/vfs_syncops.c'
--- a/source/modules/vfs_syncops.c 2007-10-16 10:24:59 +0000
+++ b/source/modules/vfs_syncops.c 2007-10-19 02:19:09 +0000
@@ -33,6 +33,8 @@
operations safely.
*/
+static bool sync_onclose;
+
/*
given a filename, find the parent directory
*/
@@ -153,7 +155,7 @@
/* close needs to be handled specially */
static int syncops_close(vfs_handle_struct *handle, files_struct *fsp, int fd)
{
- if (fsp->can_write) {
+ if (fsp->can_write && sync_onclose) {
/* ideally we'd only do this if we have written some
data, but there is no flag for that in fsp yet. */
fsync(fd);
@@ -190,5 +192,7 @@
if (!NT_STATUS_IS_OK(ret))
return ret;
+ sync_onclose = lp_parm_bool(-1, "syncops", "onclose", True);
+
return ret;
}
More information about the samba-cvs
mailing list