コード例 #1
0
ファイル: vfs_prealloc.c プロジェクト: Arkhont/samba
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;
}
コード例 #2
0
ファイル: vfs_prealloc.c プロジェクト: aosm/samba
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;
}
コード例 #3
0
ファイル: skel_transparent.c プロジェクト: 0x24bin/winexe-1
static int skel_ftruncate(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_T offset)
{
	return SMB_VFS_NEXT_FTRUNCATE(handle, fsp, offset);
}