summaryrefslogtreecommitdiff
path: root/source3/modules
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-12-22 15:54:41 +0100
committerChristian Ambach <ambi@samba.org>2012-02-10 17:54:10 +0100
commit8ad2b6a55e23922570659a4e4fb88e1b7d710772 (patch)
tree3dface856c1d77472228cd5e949553b45117d842 /source3/modules
parent89a4f66826a2e614bd782dcaff72ea3650229142 (diff)
downloadsamba-8ad2b6a55e23922570659a4e4fb88e1b7d710772.tar.gz
samba-8ad2b6a55e23922570659a4e4fb88e1b7d710772.tar.bz2
samba-8ad2b6a55e23922570659a4e4fb88e1b7d710772.zip
s3:vfs_gpfs: make "gpfs:ftruncate" a per share option
metze Signed-off-by: Christian Ambach <ambi@samba.org>
Diffstat (limited to 'source3/modules')
-rw-r--r--source3/modules/gpfs.c4
-rw-r--r--source3/modules/vfs_gpfs.c13
2 files changed, 14 insertions, 3 deletions
diff --git a/source3/modules/gpfs.c b/source3/modules/gpfs.c
index b31d9b0d53..57a5a0c9fb 100644
--- a/source3/modules/gpfs.c
+++ b/source3/modules/gpfs.c
@@ -26,7 +26,6 @@
#include "vfs_gpfs.h"
static bool gpfs_getrealfilename;
-static bool gpfs_do_ftruncate;
static int (*gpfs_set_share_fn)(int fd, unsigned int allow, unsigned int deny);
static int (*gpfs_set_lease_fn)(int fd, unsigned int leaseType);
@@ -135,7 +134,7 @@ int smbd_gpfs_putacl(char *pathname, int flags, void *acl)
int smbd_gpfs_ftruncate(int fd, gpfs_off64_t length)
{
- if (!gpfs_do_ftruncate || (gpfs_ftruncate_fn == NULL)) {
+ if (gpfs_ftruncate_fn == NULL) {
errno = ENOSYS;
return -1;
}
@@ -265,7 +264,6 @@ void init_gpfs(void)
gpfs_getrealfilename = lp_parm_bool(-1, "gpfs", "getrealfilename",
True);
- gpfs_do_ftruncate = lp_parm_bool(-1, "gpfs", "ftruncate", True);
return;
}
diff --git a/source3/modules/vfs_gpfs.c b/source3/modules/vfs_gpfs.c
index 0f084f8578..088d8c0d6b 100644
--- a/source3/modules/vfs_gpfs.c
+++ b/source3/modules/vfs_gpfs.c
@@ -40,6 +40,7 @@ struct gpfs_config_data {
bool hsm;
bool syncio;
bool winattr;
+ bool ftruncate;
};
@@ -1246,6 +1247,15 @@ static int vfs_gpfs_ftruncate(vfs_handle_struct *handle, files_struct *fsp,
SMB_OFF_T len)
{
int result;
+ struct gpfs_config_data *config;
+
+ SMB_VFS_HANDLE_GET_DATA(handle, config,
+ struct gpfs_config_data,
+ return -1);
+
+ if (!config->ftruncate) {
+ return SMB_VFS_NEXT_FTRUNCATE(handle, fsp, len);
+ }
result = smbd_gpfs_ftruncate(fsp->fh->fd, len);
if ((result == -1) && (errno == ENOSYS)) {
@@ -1350,6 +1360,9 @@ int vfs_gpfs_connect(struct vfs_handle_struct *handle, const char *service,
config->winattr = lp_parm_bool(SNUM(handle->conn), "gpfs",
"winattr", false);
+ config->ftruncate = lp_parm_bool(SNUM(handle->conn), "gpfs",
+ "ftruncate", true);
+
SMB_VFS_HANDLE_SET_DATA(handle, config,
NULL, struct gpfs_config_data,
return -1);