summaryrefslogtreecommitdiff
path: root/source3/modules
diff options
context:
space:
mode:
authorChristof Schmitt <cs@samba.org>2018-05-14 14:33:15 -0700
committerJeremy Allison <jra@samba.org>2019-04-22 23:00:41 +0000
commit0b203d94471002d67d23333ecef72f7c6788464b (patch)
tree942cd446ba15c4167e81da610c098fb6955b33a0 /source3/modules
parentef35d4d8cd4e1e8d1ad1d7ae60f1bc199f12085d (diff)
downloadsamba-0b203d94471002d67d23333ecef72f7c6788464b.tar.gz
vfs_gpfs: Remove usage of gpfs_prealloc
All supported versions of GPFS now support fallocate. Use the default codepath instead of the API call. Keep the function stub as it will be used for a check later. Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/modules')
-rw-r--r--source3/modules/vfs_gpfs.c40
1 files changed, 3 insertions, 37 deletions
diff --git a/source3/modules/vfs_gpfs.c b/source3/modules/vfs_gpfs.c
index d86d0996fcd..4de8720e940 100644
--- a/source3/modules/vfs_gpfs.c
+++ b/source3/modules/vfs_gpfs.c
@@ -48,7 +48,6 @@ struct gpfs_config_data {
bool ftruncate;
bool getrealfilename;
bool dfreequota;
- bool prealloc;
bool acl;
bool settimes;
bool recalls;
@@ -1944,40 +1943,10 @@ static int vfs_gpfs_ntimes(struct vfs_handle_struct *handle,
}
static int vfs_gpfs_fallocate(struct vfs_handle_struct *handle,
- struct files_struct *fsp, uint32_t mode,
- off_t offset, off_t len)
+ struct files_struct *fsp, uint32_t mode,
+ off_t offset, off_t len)
{
- int ret;
- struct gpfs_config_data *config;
-
- SMB_VFS_HANDLE_GET_DATA(handle, config,
- struct gpfs_config_data,
- return -1);
-
- if (!config->prealloc) {
- /* you should better not run fallocate() on GPFS at all */
- errno = ENOTSUP;
- return -1;
- }
-
- if (mode != 0) {
- DEBUG(10, ("unmapped fallocate flags: %lx\n",
- (unsigned long)mode));
- errno = ENOTSUP;
- return -1;
- }
-
- ret = gpfswrap_prealloc(fsp->fh->fd, offset, len);
-
- if (ret == -1 && errno != ENOSYS) {
- DEBUG(0, ("GPFS prealloc failed: %s\n", strerror(errno)));
- } else if (ret == -1 && errno == ENOSYS) {
- DEBUG(10, ("GPFS prealloc not supported.\n"));
- } else {
- DEBUG(10, ("GPFS prealloc succeeded.\n"));
- }
-
- return ret;
+ return SMB_VFS_NEXT_FALLOCATE(handle, fsp, mode, offset, len);
}
static int vfs_gpfs_ftruncate(vfs_handle_struct *handle, files_struct *fsp,
@@ -2152,9 +2121,6 @@ static int vfs_gpfs_connect(struct vfs_handle_struct *handle,
config->dfreequota = lp_parm_bool(SNUM(handle->conn), "gpfs",
"dfreequota", false);
- config->prealloc = lp_parm_bool(SNUM(handle->conn), "gpfs",
- "prealloc", true);
-
config->acl = lp_parm_bool(SNUM(handle->conn), "gpfs", "acl", true);
config->settimes = lp_parm_bool(SNUM(handle->conn), "gpfs",