From db1abd4d2d6f83a4c9729019ed91c7a92c66529c Mon Sep 17 00:00:00 2001 From: Christian Ambach Date: Thu, 24 Nov 2011 13:39:01 +0100 Subject: 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 --- source3/modules/vfs_gpfs.c | 13 +++++++++++-- 1 file 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); -- cgit