diff options
author | Jeremy Allison <jra@samba.org> | 2004-01-06 01:22:14 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2004-01-06 01:22:14 +0000 |
commit | 0d44747df99f2168a063feedad5039f222746f61 (patch) | |
tree | 0ddeca47e4408a6fb7b86357a128caac373f028e /examples/VFS | |
parent | 1fa073b55bca9bbc66b86e652e491cc44656071e (diff) | |
download | samba-0d44747df99f2168a063feedad5039f222746f61.tar.gz samba-0d44747df99f2168a063feedad5039f222746f61.tar.bz2 samba-0d44747df99f2168a063feedad5039f222746f61.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 019aaaf0df091c3f67048f591e70d4353a02bb9b)
Diffstat (limited to 'examples/VFS')
-rw-r--r-- | examples/VFS/skel_opaque.c | 12 | ||||
-rw-r--r-- | examples/VFS/skel_transparent.c | 10 |
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); |