Remove redundant parameter fd from SMB_VFS_READ().
[samba.git] / source3 / modules / vfs_cacheprime.c
index 196441c4ddaeb4cb1b311efde3986cfc5efdeb57..4ac78437c303131d050bb33f1b28dc634afe64b8 100644 (file)
@@ -3,7 +3,7 @@
  *
  * 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,
@@ -12,8 +12,7 @@
  * 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"
@@ -46,7 +45,7 @@ static void * g_readbuf = NULL;
  * 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,
@@ -155,22 +154,21 @@ static ssize_t cprime_read(
                 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 [] =
@@ -192,6 +190,7 @@ 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);