summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2004-01-06 01:21:59 +0000
committerJeremy Allison <jra@samba.org>2004-01-06 01:21:59 +0000
commit827c68deb89b5bd14324c57db14274b36a0790d7 (patch)
tree018ea2e604f64a73899744fced6a41086c90e512 /examples
parent35f843a1be9a703328eee3241bc24416cca945e0 (diff)
downloadsamba-827c68deb89b5bd14324c57db14274b36a0790d7.tar.gz
samba-827c68deb89b5bd14324c57db14274b36a0790d7.tar.bz2
samba-827c68deb89b5bd14324c57db14274b36a0790d7.zip
Patch based on work from James Peach <jpeach@sgi.com> to convert over to
using pread/pwrite. Modified a little to ensure fsp->pos is correct. Fix for #889. Jeremy. (This used to be commit 3a24dc868d95c9bcc2ac3a0dbd50e6e226ac0841)
Diffstat (limited to 'examples')
-rw-r--r--examples/VFS/skel_opaque.c12
-rw-r--r--examples/VFS/skel_transparent.c10
2 files changed, 22 insertions, 0 deletions
diff --git a/examples/VFS/skel_opaque.c b/examples/VFS/skel_opaque.c
index de82801d85..310d305cee 100644
--- a/examples/VFS/skel_opaque.c
+++ b/examples/VFS/skel_opaque.c
@@ -111,11 +111,21 @@ static ssize_t skel_read(vfs_handle_struct *handle, files_struct *fsp, int fd, v
return vfswrap_read(NULL, fsp, fd, data, n);
}
+static ssize_t skel_pread(vfs_handle_struct *handle, struct files_struct *fsp, int fd, void *data, size_t n, SMB_OFF_T offset)
+{
+ return vfswrap_pread(NULL, fsp, fd, data, n, offset);
+}
+
static ssize_t skel_write(vfs_handle_struct *handle, files_struct *fsp, int fd, const void *data, size_t n)
{
return vfswrap_write(NULL, fsp, fd, data, n);
}
+ssize_t skel_pwrite(vfs_handle_struct *handle, struct files_struct *fsp, int fd, const void *data, size_t n, SMB_OFF_T offset)
+{
+ return vfswrap_pwrite(NULL, fsp, fd, data, n, offset);
+}
+
static SMB_OFF_T skel_lseek(vfs_handle_struct *handle, files_struct *fsp, int filedes, SMB_OFF_T offset, int whence)
{
return vfswrap_lseek(NULL, fsp, filedes, offset, whence);
@@ -488,7 +498,9 @@ static vfs_op_tuple skel_op_tuples[] = {
{SMB_VFS_OP(skel_open), SMB_VFS_OP_OPEN, SMB_VFS_LAYER_OPAQUE},
{SMB_VFS_OP(skel_close), SMB_VFS_OP_CLOSE, SMB_VFS_LAYER_OPAQUE},
{SMB_VFS_OP(skel_read), SMB_VFS_OP_READ, SMB_VFS_LAYER_OPAQUE},
+ {SMB_VFS_OP(skel_pread), SMB_VFS_OP_PREAD, SMB_VFS_LAYER_OPAQUE},
{SMB_VFS_OP(skel_write), SMB_VFS_OP_WRITE, SMB_VFS_LAYER_OPAQUE},
+ {SMB_VFS_OP(skel_pwrite), SMB_VFS_OP_PWRITE, SMB_VFS_LAYER_OPAQUE},
{SMB_VFS_OP(skel_lseek), SMB_VFS_OP_LSEEK, SMB_VFS_LAYER_OPAQUE},
{SMB_VFS_OP(skel_rename), SMB_VFS_OP_RENAME, SMB_VFS_LAYER_OPAQUE},
{SMB_VFS_OP(skel_fsync), SMB_VFS_OP_FSYNC, SMB_VFS_LAYER_OPAQUE},
diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c
index 7a326741c5..448390e72f 100644
--- a/examples/VFS/skel_transparent.c
+++ b/examples/VFS/skel_transparent.c
@@ -110,11 +110,21 @@ static ssize_t skel_read(vfs_handle_struct *handle, files_struct *fsp, int fd, v
return SMB_VFS_NEXT_READ(handle, fsp, fd, data, n);
}
+static ssize_t skel_pread(vfs_handle_struct *handle, files_struct *fsp, int fd, void *data, size_t n, SMB_OFF_T offset)
+{
+ return SMB_VFS_NEXT_PREAD(handle, fsp, fd, data, n, offset);
+}
+
static ssize_t skel_write(vfs_handle_struct *handle, files_struct *fsp, int fd, const void *data, size_t n)
{
return SMB_VFS_NEXT_WRITE(handle, fsp, fd, data, n);
}
+static ssize_t skel_pwrite(vfs_handle_struct *handle, files_struct *fsp, int fd, const void *data, size_t n, SMB_OFF_T offset)
+{
+ return SMB_VFS_NEXT_PWRITE(handle, fsp, fd, data, n, offset);
+}
+
static SMB_OFF_T skel_lseek(vfs_handle_struct *handle, files_struct *fsp, int filedes, SMB_OFF_T offset, int whence)
{
return SMB_VFS_NEXT_LSEEK(handle, fsp, filedes, offset, whence);