summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Ambach <ambi@samba.org>2011-11-24 13:39:01 +0100
committerChristian Ambach <ambi@samba.org>2011-11-24 15:52:09 +0100
commitdb1abd4d2d6f83a4c9729019ed91c7a92c66529c (patch)
tree2250e1d85e5c43ad2b6474e96d7e682805f5db30
parent9f1eb8ab8ef17a48653f3af51cfd2e678b032595 (diff)
downloadsamba-db1abd4d2d6f83a4c9729019ed91c7a92c66529c.tar.gz
samba-db1abd4d2d6f83a4c9729019ed91c7a92c66529c.tar.bz2
samba-db1abd4d2d6f83a4c9729019ed91c7a92c66529c.zip
s3:vfs:gpfs convert syncio parameter
convert syncio parameter to be stored in the VFS handle data this removes the need to go through lp_parm_bool() on each open
-rw-r--r--source3/modules/vfs_gpfs.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/source3/modules/vfs_gpfs.c b/source3/modules/vfs_gpfs.c
index 0a684e0d8e..9d09777cad 100644
--- a/source3/modules/vfs_gpfs.c
+++ b/source3/modules/vfs_gpfs.c
@@ -38,6 +38,7 @@ struct gpfs_config_data {
bool sharemodes;
bool leases;
bool hsm;
+ bool syncio;
};
@@ -1275,6 +1276,9 @@ int vfs_gpfs_connect(struct vfs_handle_struct *handle, const char *service,
config->hsm = lp_parm_bool(SNUM(handle->conn), "gpfs",
"hsm", false);
+ config->syncio = lp_parm_bool(SNUM(handle->conn), "gpfs",
+ "syncio", false);
+
SMB_VFS_HANDLE_SET_DATA(handle, config,
NULL, struct gpfs_config_data,
return -1);
@@ -1304,8 +1308,13 @@ static int vfs_gpfs_open(struct vfs_handle_struct *handle,
struct smb_filename *smb_fname, files_struct *fsp,
int flags, mode_t mode)
{
- if (lp_parm_bool(fsp->conn->params->service, "gpfs", "syncio",
- false)) {
+ struct gpfs_config_data *config;
+
+ SMB_VFS_HANDLE_GET_DATA(handle, config,
+ struct gpfs_config_data,
+ return -1);
+
+ if (config->syncio) {
flags |= O_SYNC;
}
return SMB_VFS_NEXT_OPEN(handle, smb_fname, fsp, flags, mode);