static int prealloc_ftruncate(vfs_handle_struct * handle, files_struct * fsp, SMB_OFF_T offset) { SMB_OFF_T *psize; int ret = SMB_VFS_NEXT_FTRUNCATE(handle, fsp, offset); /* Maintain the allocated space even in the face of truncates. */ if ((psize = VFS_FETCH_FSP_EXTENSION(handle, fsp))) { preallocate_space(fsp->fh->fd, *psize); } return ret; }
static int prealloc_ftruncate(vfs_handle_struct * handle, files_struct * fsp, int fd, SMB_OFF_T offset) { SMB_OFF_T *psize; int ret = SMB_VFS_NEXT_FTRUNCATE(handle, fsp, fd, offset); /* Maintain the allocated space even in the face of truncates. If the * truncate succeeded, we know that the current file size is the size * the caller requested. */ if (ret == 0 ) { if ((psize = VFS_FETCH_FSP_EXTENSION(handle, fsp))) { preallocate_space(fd, offset, *psize); } } return ret; }
static int skel_ftruncate(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_T offset) { return SMB_VFS_NEXT_FTRUNCATE(handle, fsp, offset); }