*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "includes.h"
* per-fsp data to make sure we only ever do this once. If pread is being
* emulated by seek/read/seek, when this will suck quite a lot.
*/
-static BOOL prime_cache(
+static bool prime_cache(
struct vfs_handle_struct * handle,
files_struct * fsp,
int fd,
SMB_VFS_LSEEK(fsp, fd, offset, SEEK_SET);
}
- return SMB_VFS_NEXT_READ(handle, fsp, fd, data, count);
+ return SMB_VFS_NEXT_READ(handle, fsp, data, count);
}
static ssize_t cprime_pread(
vfs_handle_struct * handle,
files_struct * fsp,
- int fd,
void * data,
size_t count,
SMB_OFF_T offset)
{
if (g_readbuf) {
- prime_cache(handle, fsp, fd, offset, count);
+ prime_cache(handle, fsp, fsp->fh->fd, offset, count);
}
- return SMB_VFS_NEXT_PREAD(handle, fsp, fd, data, count, offset);
+ return SMB_VFS_NEXT_PREAD(handle, fsp, data, count, offset);
}
static vfs_op_tuple cprime_ops [] =
* -------------------------------------------------------------------------
*/
+NTSTATUS vfs_cacheprime_init(void);
NTSTATUS vfs_cacheprime_init(void)
{
return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, MODULE, cprime_ops);