#include "includes.h"
#include "system/filesys.h"
#include "smbd/smbd.h"
-#include "system/filesys.h"
/* Extent preallocation module.
*
#define MODULE "prealloc"
static int module_debug;
-static int preallocate_space(int fd, SMB_OFF_T size)
+static int preallocate_space(int fd, off_t size)
{
int err;
#ifndef HAVE_GPFS
mode_t mode)
{
int fd;
- off64_t size = 0;
+ off_t size = 0;
const char * dot;
char fext[10];
if (dot && *++dot) {
if (strlen(dot) < sizeof(fext)) {
strncpy(fext, dot, sizeof(fext));
- strnorm(fext, CASE_LOWER);
+ if (!strnorm(fext, CASE_LOWER)) {
+ goto normal_open;
+ }
}
}
* truncate calls specially.
*/
if ((flags & O_CREAT) || (flags & O_TRUNC)) {
- SMB_OFF_T * psize;
+ off_t * psize;
- psize = VFS_ADD_FSP_EXTENSION(handle, fsp, SMB_OFF_T, NULL);
+ psize = VFS_ADD_FSP_EXTENSION(handle, fsp, off_t, NULL);
if (psize == NULL || *psize == -1) {
return fd;
}
static int prealloc_ftruncate(vfs_handle_struct * handle,
files_struct * fsp,
- SMB_OFF_T offset)
+ off_t offset)
{
- SMB_OFF_T *psize;
+ off_t *psize;
int ret = SMB_VFS_NEXT_FTRUNCATE(handle, fsp, offset);
/* Maintain the allocated space even in the face of truncates. */
static struct vfs_fn_pointers prealloc_fns = {
.open_fn = prealloc_open,
- .ftruncate = prealloc_ftruncate,
+ .ftruncate_fn = prealloc_ftruncate,
.connect_fn = prealloc_connect,
};