summaryrefslogtreecommitdiff
path: root/source3/modules/vfs_gpfs.c
diff options
context:
space:
mode:
authorChristian Ambach <christian.ambach@de.ibm.com>2010-10-08 13:43:17 +0200
committerVolker Lendecke <vlendec@samba.org>2010-10-13 13:34:25 +0000
commitbeb5afea54e279e348779c5b01070803ed59c775 (patch)
treeff8d62a67e97c08dfecd038ed0271926137f4645 /source3/modules/vfs_gpfs.c
parent22018b8b887c2677d30bbb4589f800197edf0e98 (diff)
downloadsamba-beb5afea54e279e348779c5b01070803ed59c775.tar.gz
samba-beb5afea54e279e348779c5b01070803ed59c775.tar.bz2
samba-beb5afea54e279e348779c5b01070803ed59c775.zip
s3:gpfs: Add support for the gpfs_ftruncate call
ported from the v3-4-ctdb branch to master This used to be commit 1f138cc9f4a Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Wed Oct 13 13:34:25 UTC 2010 on sn-devel-104
Diffstat (limited to 'source3/modules/vfs_gpfs.c')
-rw-r--r--source3/modules/vfs_gpfs.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/source3/modules/vfs_gpfs.c b/source3/modules/vfs_gpfs.c
index be035a83bc..8fbfbdfa9b 100644
--- a/source3/modules/vfs_gpfs.c
+++ b/source3/modules/vfs_gpfs.c
@@ -1128,6 +1128,18 @@ static int vfs_gpfs_ntimes(struct vfs_handle_struct *handle,
}
+static int vfs_gpfs_ftruncate(vfs_handle_struct *handle, files_struct *fsp,
+ SMB_OFF_T len)
+{
+ int result;
+
+ result = smbd_gpfs_ftruncate(fsp->fh->fd, len);
+ if ((result == -1) && (errno == ENOSYS)) {
+ return SMB_VFS_NEXT_FTRUNCATE(handle, fsp, len);
+ }
+ return result;
+}
+
int vfs_gpfs_connect(struct vfs_handle_struct *handle, const char *service,
const char *user)
{
@@ -1180,6 +1192,7 @@ static struct vfs_fn_pointers vfs_gpfs_fns = {
.fstat = vfs_gpfs_fstat,
.lstat = vfs_gpfs_lstat,
.ntimes = vfs_gpfs_ntimes,
+ .ftruncate = vfs_gpfs_ftruncate
};
NTSTATUS vfs_gpfs_init(void);