[SCM] Samba Shared Repository - branch master updated

Ralph Böhme slow at samba.org
Fri May 4 23:39:02 UTC 2018


The branch, master has been updated
       via  30e6b59 s3: VFS: Remove SMB_VFS_WRITE() function and all implementations.
       via  98f0306 s3: torture: Remove the last user of SMB_VFS_WRITE.
       via  532ff3a s3: VFS: ceph: Replace the lseek/write ftruncate extend with pwrite.
       via  25bad32 s3: VFS: Remove vfs_write_data(). No longer used.
       via  394ac90 s3: smbd: Remove the handling of offset == -1 in real_write_file().
       via  23f4b3f s3: VFS: default: Remove recursion into the VFS inside the default pwrite call.
       via  90bd746 s3: VFS: default: Remove fallback if we don't have HAVE_PWRITE set. Samba doesn't work without pwrite.
       via  c1bcf1e s3: VFS: Remove SMB_VFS_READ() function and all implementations.
       via  75fde60 s3: torture: Make cmd_read use read_file().
       via  2bea110 s3: printing: Remove the LSEEK in printing_pread_data() and use read_file() instead.
       via  70eb533 s3: printing: Now we never pass an offset of -1, remove the off_t==-1 protections from printing_pread_data().
       via  9bf5d0d s3: printing: Use offset tracking in printing_pread_data() to remove the seek in handle_ne_file().
       via  a87328e s3: printing: Use passed in offset, and offset tracking in printing_pread_data() to remove seeks from handle_pe_file().
       via  0c736ae s3: printing: Add existing offset position as a parameter to handle_pe_file(), handle_ne_file()
       via  09aaed2 s3: printing: Use auto-updating of offset in printing_pread_data() to remove offset tracking in get_file_version().
       via  4b580ee s3: printing: Make printing_pread_data() update the offset paramter, if not passed in as -1.
       via  b927b53 s3: printing: Rename printing_read_data() -> printing_pread_data() and add an offset parameter.
       via  e943c5d s3: printing: Rename vfs_read_data() -> printing_read_data().
       via  43d9168 s3: printing: Move handle_ne_file code into a separate function.
       via  6a42a24 s3: printing: Split handling of PE file into separate function.
       via  631bca9 s3: printing: Reformatting of parts of this file to modern coding standards.
      from  d1730d6 netlogon: Allow zero-GUID to act the same as NULL in GetDCNameEx2

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 30e6b5999bf0be297de74dc991beeccfe4af6088
Author: Jeremy Allison <jra at samba.org>
Date:   Wed May 2 16:56:33 2018 -0700

    s3: VFS: Remove SMB_VFS_WRITE() function and all implementations.
    
    All code in Samba now uses SMB_VFS_PWRITE or SMB_VFS_PWRITE_SEND.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    
    Autobuild-User(master): Ralph Böhme <slow at samba.org>
    Autobuild-Date(master): Sat May  5 01:38:07 CEST 2018 on sn-devel-144

commit 98f03064f75466929295b8854182977c7162e360
Author: Jeremy Allison <jra at samba.org>
Date:   Wed May 2 16:49:56 2018 -0700

    s3: torture: Remove the last user of SMB_VFS_WRITE.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 532ff3a5b9580f75ee770fc7da7ba7fc43b5a91f
Author: Jeremy Allison <jra at samba.org>
Date:   Wed May 2 16:47:22 2018 -0700

    s3: VFS: ceph: Replace the lseek/write ftruncate extend with pwrite.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 25bad32993150a49a767aca87c7d234314ba7210
Author: Jeremy Allison <jra at samba.org>
Date:   Wed May 2 16:44:23 2018 -0700

    s3: VFS: Remove vfs_write_data(). No longer used.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 394ac908c19bd54e6869865ddff44e2382aedb48
Author: Jeremy Allison <jra at samba.org>
Date:   Wed May 2 16:39:16 2018 -0700

    s3: smbd: Remove the handling of offset == -1 in real_write_file().
    
    All SMB1/2/3 offsets over the wire are absolute.
    
    The only caller with offset == -1 is on a print-spool file
    in reply_printwrite(), and write_file() redirects this
    to print_spool_write(), which correctly handles the -1.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 23f4b3f0ed1b5883b50b390292e06587c2a6e27b
Author: Jeremy Allison <jra at samba.org>
Date:   Wed May 2 16:38:05 2018 -0700

    s3: VFS: default: Remove recursion into the VFS inside the default pwrite call.
    
    We already know we're at the POSIX level here.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 90bd74640f0a79c1d1c2c0a5fee92e62700232e9
Author: Jeremy Allison <jra at samba.org>
Date:   Wed May 2 16:35:41 2018 -0700

    s3: VFS: default: Remove fallback if we don't have HAVE_PWRITE set. Samba doesn't work without pwrite.
    
    Start of the changes to remove synchronous VFS write.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit c1bcf1e7fd93a1dbedb210e624f99773a6f3d6f9
Author: Jeremy Allison <jra at samba.org>
Date:   Tue May 1 12:05:44 2018 -0700

    s3: VFS: Remove SMB_VFS_READ() function and all implementations.
    
    All code in Samba now uses SMB_VFS_PREAD or SMB_VFS_PREAD_SEND.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 75fde601be6058b98cac214e3f97e82cfcd2f4fe
Author: Jeremy Allison <jra at samba.org>
Date:   Tue May 1 11:53:10 2018 -0700

    s3: torture: Make cmd_read use read_file().
    
    Removed last user of SMB_VFS_READ.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 2bea1103e5d322515eac7ddae5e1444ceb5e7b97
Author: Jeremy Allison <jra at samba.org>
Date:   Tue May 1 11:51:43 2018 -0700

    s3: printing: Remove the LSEEK in printing_pread_data() and use read_file() instead.
    
    Removes last-but-one user of SMB_VFS_READ.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 70eb53366995e842f0f29733979a13b6738ffb1a
Author: Jeremy Allison <jra at samba.org>
Date:   Tue May 1 11:47:24 2018 -0700

    s3: printing: Now we never pass an offset of -1, remove the off_t==-1 protections from printing_pread_data().
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 9bf5d0da9516635eef5af246a3c7b5f3b0648f74
Author: Jeremy Allison <jra at samba.org>
Date:   Tue May 1 11:19:49 2018 -0700

    s3: printing: Use offset tracking in printing_pread_data() to remove the seek in handle_ne_file().
    
    Uses the fact that: lseek(fd, 0, SEEK_CUR) is merely getting the current file position,
    which we have already tracked in in_pos.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit a87328edee55c4e71b468da8642689bb24b6bb1d
Author: Jeremy Allison <jra at samba.org>
Date:   Tue May 1 11:16:02 2018 -0700

    s3: printing: Use passed in offset, and offset tracking in printing_pread_data() to remove seeks from handle_pe_file().
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 0c736ae06821b46ca4c541982de3cf8af48c50ba
Author: Jeremy Allison <jra at samba.org>
Date:   Tue May 1 11:11:01 2018 -0700

    s3: printing: Add existing offset position as a parameter to handle_pe_file(), handle_ne_file()
    
    Not yet used.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 09aaed21091144c48586fdc97233166b2402f6b4
Author: Jeremy Allison <jra at samba.org>
Date:   Tue May 1 11:08:40 2018 -0700

    s3: printing: Use auto-updating of offset in printing_pread_data() to remove offset tracking in get_file_version().
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 4b580ee94e8b40ed260d215766d8692ceb2cda13
Author: Jeremy Allison <jra at samba.org>
Date:   Wed May 2 13:45:44 2018 -0700

    s3: printing: Make printing_pread_data() update the offset paramter, if not passed in as -1.
    
    As all callers pass -1 here, still not used.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit b927b53ad221d258ddddde4561752271923edf63
Author: Jeremy Allison <jra at samba.org>
Date:   Tue May 1 11:38:49 2018 -0700

    s3: printing: Rename printing_read_data() -> printing_pread_data() and add an offset parameter.
    
    Currently pass -1 as the offset, so it's not used.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit e943c5db1f2177acadd1c5d7e24fa37482264baa
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Apr 30 16:04:23 2018 -0700

    s3: printing: Rename vfs_read_data() -> printing_read_data().
    
    This is an internal printing call, nothing to do with the VFS.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 43d9168569fa432982b344a2c4866b4ca0dc942a
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Apr 30 15:50:14 2018 -0700

    s3: printing: Move handle_ne_file code into a separate function.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 6a42a24b27d8691be894c39df4f9fdb83aefa754
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Apr 30 15:06:39 2018 -0700

    s3: printing: Split handling of PE file into separate function.
    
    This is *horrible* old code...
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 631bca9e92e9aa7380140ff9e603d40fda9e3e66
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Apr 30 11:57:52 2018 -0700

    s3: printing: Reformatting of parts of this file to modern coding standards.
    
    This should not change the code behavior in any way, it is just being
    done to make it easier for me to move this code to calling the
    standard read_file() function later on, which takes a file offset
    to read from (and uses pread internally).
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 examples/VFS/skel_opaque.c       |  16 --
 examples/VFS/skel_transparent.c  |  14 -
 source3/include/vfs.h            |  11 +-
 source3/include/vfs_macros.h     |  10 -
 source3/modules/vfs_cacheprime.c |  18 --
 source3/modules/vfs_ceph.c       |  39 +--
 source3/modules/vfs_commit.c     |  19 --
 source3/modules/vfs_default.c    |  44 +--
 source3/modules/vfs_full_audit.c |  28 --
 source3/modules/vfs_glusterfs.c  |  14 -
 source3/modules/vfs_time_audit.c |  41 ---
 source3/printing/nt_printing.c   | 597 ++++++++++++++++++++++++++-------------
 source3/smbd/fileio.c            |  16 +-
 source3/smbd/proto.h             |   4 -
 source3/smbd/vfs.c               |  62 ----
 source3/torture/cmd_vfs.c        |   4 +-
 16 files changed, 420 insertions(+), 517 deletions(-)


Changeset truncated at 500 lines:

diff --git a/examples/VFS/skel_opaque.c b/examples/VFS/skel_opaque.c
index 41215cc..5529ec7 100644
--- a/examples/VFS/skel_opaque.c
+++ b/examples/VFS/skel_opaque.c
@@ -220,13 +220,6 @@ static int skel_close_fn(vfs_handle_struct *handle, files_struct *fsp)
 	return -1;
 }
 
-static ssize_t skel_vfs_read(vfs_handle_struct *handle, files_struct *fsp,
-			     void *data, size_t n)
-{
-	errno = ENOSYS;
-	return -1;
-}
-
 static ssize_t skel_pread(vfs_handle_struct *handle, files_struct *fsp,
 			  void *data, size_t n, off_t offset)
 {
@@ -250,13 +243,6 @@ static ssize_t skel_pread_recv(struct tevent_req *req,
 	return -1;
 }
 
-static ssize_t skel_write(vfs_handle_struct *handle, files_struct *fsp,
-			  const void *data, size_t n)
-{
-	errno = ENOSYS;
-	return -1;
-}
-
 static ssize_t skel_pwrite(vfs_handle_struct *handle, files_struct *fsp,
 			   const void *data, size_t n, off_t offset)
 {
@@ -949,11 +935,9 @@ struct vfs_fn_pointers skel_opaque_fns = {
 	.open_fn = skel_open,
 	.create_file_fn = skel_create_file,
 	.close_fn = skel_close_fn,
-	.read_fn = skel_vfs_read,
 	.pread_fn = skel_pread,
 	.pread_send_fn = skel_pread_send,
 	.pread_recv_fn = skel_pread_recv,
-	.write_fn = skel_write,
 	.pwrite_fn = skel_pwrite,
 	.pwrite_send_fn = skel_pwrite_send,
 	.pwrite_recv_fn = skel_pwrite_recv,
diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c
index 7a82a55..fde24fb 100644
--- a/examples/VFS/skel_transparent.c
+++ b/examples/VFS/skel_transparent.c
@@ -229,12 +229,6 @@ static int skel_close_fn(vfs_handle_struct *handle, files_struct *fsp)
 	return SMB_VFS_NEXT_CLOSE(handle, fsp);
 }
 
-static ssize_t skel_vfs_read(vfs_handle_struct *handle, files_struct *fsp,
-			     void *data, size_t n)
-{
-	return SMB_VFS_NEXT_READ(handle, fsp, data, n);
-}
-
 static ssize_t skel_pread(vfs_handle_struct *handle, files_struct *fsp,
 			  void *data, size_t n, off_t offset)
 {
@@ -295,12 +289,6 @@ static ssize_t skel_pread_recv(struct tevent_req *req,
 	return state->ret;
 }
 
-static ssize_t skel_write(vfs_handle_struct *handle, files_struct *fsp,
-			  const void *data, size_t n)
-{
-	return SMB_VFS_NEXT_WRITE(handle, fsp, data, n);
-}
-
 static ssize_t skel_pwrite(vfs_handle_struct *handle, files_struct *fsp,
 			   const void *data, size_t n, off_t offset)
 {
@@ -1123,11 +1111,9 @@ struct vfs_fn_pointers skel_transparent_fns = {
 	.open_fn = skel_open,
 	.create_file_fn = skel_create_file,
 	.close_fn = skel_close_fn,
-	.read_fn = skel_vfs_read,
 	.pread_fn = skel_pread,
 	.pread_send_fn = skel_pread_send,
 	.pread_recv_fn = skel_pread_recv,
-	.write_fn = skel_write,
 	.pwrite_fn = skel_pwrite,
 	.pwrite_send_fn = skel_pwrite_send,
 	.pwrite_recv_fn = skel_pwrite_recv,
diff --git a/source3/include/vfs.h b/source3/include/vfs.h
index 6f940ed..cc7948a 100644
--- a/source3/include/vfs.h
+++ b/source3/include/vfs.h
@@ -247,6 +247,10 @@
 /* Version 38 - Remove SMB_VFS_INIT_SEARCH_OP */
 /* Version 39 - Remove SMB_VFS_FSYNC
 		Only implement async versions. */
+/* Version 39 - Remove SMB_VFS_READ
+		All users are now pread or async versions. */
+/* Version 39 - Remove SMB_VFS_WRITE
+		All users are now pwrite or async versions. */
 
 #define SMB_VFS_INTERFACE_VERSION 39
 
@@ -685,7 +689,6 @@ struct vfs_fn_pointers {
 				   const struct smb2_create_blobs *in_context_blobs,
 				   struct smb2_create_blobs *out_context_blobs);
 	int (*close_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp);
-	ssize_t (*read_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, void *data, size_t n);
 	ssize_t (*pread_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, void *data, size_t n, off_t offset);
 	struct tevent_req *(*pread_send_fn)(struct vfs_handle_struct *handle,
 					    TALLOC_CTX *mem_ctx,
@@ -694,7 +697,6 @@ struct vfs_fn_pointers {
 					    void *data,
 					    size_t n, off_t offset);
 	ssize_t (*pread_recv_fn)(struct tevent_req *req, struct vfs_aio_state *state);
-	ssize_t (*write_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, const void *data, size_t n);
 	ssize_t (*pwrite_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, const void *data, size_t n, off_t offset);
 	struct tevent_req *(*pwrite_send_fn)(struct vfs_handle_struct *handle,
 					     TALLOC_CTX *mem_ctx,
@@ -1170,8 +1172,6 @@ NTSTATUS smb_vfs_call_create_file(struct vfs_handle_struct *handle,
 				  struct smb2_create_blobs *out_context_blobs);
 int smb_vfs_call_close(struct vfs_handle_struct *handle,
 		       struct files_struct *fsp);
-ssize_t smb_vfs_call_read(struct vfs_handle_struct *handle,
-			  struct files_struct *fsp, void *data, size_t n);
 ssize_t smb_vfs_call_pread(struct vfs_handle_struct *handle,
 			   struct files_struct *fsp, void *data, size_t n,
 			   off_t offset);
@@ -1183,9 +1183,6 @@ struct tevent_req *smb_vfs_call_pread_send(struct vfs_handle_struct *handle,
 					   size_t n, off_t offset);
 ssize_t SMB_VFS_PREAD_RECV(struct tevent_req *req, struct vfs_aio_state *state);
 
-ssize_t smb_vfs_call_write(struct vfs_handle_struct *handle,
-			   struct files_struct *fsp, const void *data,
-			   size_t n);
 ssize_t smb_vfs_call_pwrite(struct vfs_handle_struct *handle,
 			    struct files_struct *fsp, const void *data,
 			    size_t n, off_t offset);
diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h
index dcf788e..d483613 100644
--- a/source3/include/vfs_macros.h
+++ b/source3/include/vfs_macros.h
@@ -146,11 +146,6 @@
 #define SMB_VFS_NEXT_CLOSE(handle, fsp) \
 	smb_vfs_call_close((handle)->next, (fsp))
 
-#define SMB_VFS_READ(fsp, data, n) \
-	smb_vfs_call_read((fsp)->conn->vfs_handles, (fsp), (data), (n))
-#define SMB_VFS_NEXT_READ(handle, fsp, data, n) \
-	smb_vfs_call_read((handle)->next, (fsp), (data), (n))
-
 #define SMB_VFS_PREAD(fsp, data, n, off) \
 	smb_vfs_call_pread((fsp)->conn->vfs_handles, (fsp), (data), (n), (off))
 #define SMB_VFS_NEXT_PREAD(handle, fsp, data, n, off) \
@@ -163,11 +158,6 @@
 	smb_vfs_call_pread_send((handle)->next, (mem_ctx), (ev), (fsp), \
 				(data), (n), (off))
 
-#define SMB_VFS_WRITE(fsp, data, n) \
-	smb_vfs_call_write((fsp)->conn->vfs_handles, (fsp), (data), (n))
-#define SMB_VFS_NEXT_WRITE(handle, fsp, data, n) \
-	smb_vfs_call_write((handle)->next, (fsp), (data), (n))
-
 #define SMB_VFS_PWRITE(fsp, data, n, off) \
 	smb_vfs_call_pwrite((fsp)->conn->vfs_handles, (fsp), (data), (n), (off))
 #define SMB_VFS_NEXT_PWRITE(handle, fsp, data, n, off) \
diff --git a/source3/modules/vfs_cacheprime.c b/source3/modules/vfs_cacheprime.c
index 5a8b8e0..c8b33d6 100644
--- a/source3/modules/vfs_cacheprime.c
+++ b/source3/modules/vfs_cacheprime.c
@@ -146,23 +146,6 @@ static ssize_t cprime_sendfile(
                                      header, offset, count);
 }
 
-static ssize_t cprime_read(
-                vfs_handle_struct * handle,
-                files_struct *      fsp,
-                void *              data,
-                size_t              count)
-{
-        off_t offset;
-
-        offset = SMB_VFS_LSEEK(fsp, 0, SEEK_CUR);
-        if (offset >= 0 && g_readbuf)  {
-                prime_cache(handle, fsp, offset, count);
-                SMB_VFS_LSEEK(fsp, offset, SEEK_SET);
-        }
-
-        return SMB_VFS_NEXT_READ(handle, fsp, data, count);
-}
-
 static ssize_t cprime_pread(
                 vfs_handle_struct * handle,
                 files_struct *      fsp,
@@ -180,7 +163,6 @@ static ssize_t cprime_pread(
 static struct vfs_fn_pointers vfs_cacheprime_fns = {
     .sendfile_fn = cprime_sendfile,
     .pread_fn = cprime_pread,
-    .read_fn = cprime_read,
     .connect_fn = cprime_connect,
 };
 
diff --git a/source3/modules/vfs_ceph.c b/source3/modules/vfs_ceph.c
index 2062fe4..e49e7a6 100644
--- a/source3/modules/vfs_ceph.c
+++ b/source3/modules/vfs_ceph.c
@@ -458,18 +458,6 @@ static int cephwrap_close(struct vfs_handle_struct *handle, files_struct *fsp)
 	WRAP_RETURN(result);
 }
 
-static ssize_t cephwrap_read(struct vfs_handle_struct *handle, files_struct *fsp, void *data, size_t n)
-{
-	ssize_t result;
-
-	DBG_DEBUG("[CEPH] read(%p, %p, %p, %llu)\n", handle, fsp, data, llu(n));
-
-	/* Using -1 for the offset means read/write rather than pread/pwrite */
-	result = ceph_read(handle->data, fsp->fh->fd, data, n, -1);
-	DBG_DEBUG("[CEPH] read(...) = %llu\n", llu(result));
-	WRAP_RETURN(result);
-}
-
 static ssize_t cephwrap_pread(struct vfs_handle_struct *handle, files_struct *fsp, void *data,
 			size_t n, off_t offset)
 {
@@ -483,22 +471,6 @@ static ssize_t cephwrap_pread(struct vfs_handle_struct *handle, files_struct *fs
 }
 
 
-static ssize_t cephwrap_write(struct vfs_handle_struct *handle, files_struct *fsp, const void *data, size_t n)
-{
-	ssize_t result;
-
-	DBG_DEBUG("[CEPH] write(%p, %p, %p, %llu)\n", handle, fsp, data, llu(n));
-
-	result = ceph_write(handle->data, fsp->fh->fd, data, n, -1);
-
-	DBG_DEBUG("[CEPH] write(...) = %llu\n", llu(result));
-	if (result < 0) {
-		WRAP_RETURN(result);
-	}
-	fsp->fh->pos += result;
-	return result;
-}
-
 static ssize_t cephwrap_pwrite(struct vfs_handle_struct *handle, files_struct *fsp, const void *data,
 			size_t n, off_t offset)
 {
@@ -1125,15 +1097,10 @@ static int cephwrap_ftruncate(struct vfs_handle_struct *handle, files_struct *fs
 		goto done;
 	}
 
-	if (SMB_VFS_LSEEK(fsp, len-1, SEEK_SET) != len -1)
-		goto done;
-
-	if (SMB_VFS_WRITE(fsp, &c, 1)!=1)
+	if (SMB_VFS_PWRITE(fsp, &c, 1, len-1)!=1) {
 		goto done;
+	}
 
-	/* Seek to where we were */
-	if (SMB_VFS_LSEEK(fsp, currpos, SEEK_SET) != currpos)
-		goto done;
 	result = 0;
 
   done:
@@ -1474,9 +1441,7 @@ static struct vfs_fn_pointers ceph_fns = {
 
 	.open_fn = cephwrap_open,
 	.close_fn = cephwrap_close,
-	.read_fn = cephwrap_read,
 	.pread_fn = cephwrap_pread,
-	.write_fn = cephwrap_write,
 	.pwrite_fn = cephwrap_pwrite,
 	.lseek_fn = cephwrap_lseek,
 	.sendfile_fn = cephwrap_sendfile,
diff --git a/source3/modules/vfs_commit.c b/source3/modules/vfs_commit.c
index aa9c87d..a11f9e2 100644
--- a/source3/modules/vfs_commit.c
+++ b/source3/modules/vfs_commit.c
@@ -248,24 +248,6 @@ static int commit_open(
         return fd;
 }
 
-static ssize_t commit_write(
-        vfs_handle_struct * handle,
-        files_struct *      fsp,
-        const void *        data,
-        size_t              count)
-{
-        ssize_t ret;
-        ret = SMB_VFS_NEXT_WRITE(handle, fsp, data, count);
-
-        if (ret > 0) {
-                if (commit(handle, fsp, fsp->fh->pos, ret) == -1) {
-                        return -1;
-                }
-        }
-
-        return ret;
-}
-
 static ssize_t commit_pwrite(
         vfs_handle_struct * handle,
         files_struct *      fsp,
@@ -395,7 +377,6 @@ static int commit_ftruncate(
 static struct vfs_fn_pointers vfs_commit_fns = {
         .open_fn = commit_open,
         .close_fn = commit_close,
-        .write_fn = commit_write,
         .pwrite_fn = commit_pwrite,
         .pwrite_send_fn = commit_pwrite_send,
         .pwrite_recv_fn = commit_pwrite_recv,
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index 56dd5c7..e335e27 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -614,16 +614,6 @@ static int vfswrap_close(vfs_handle_struct *handle, files_struct *fsp)
 	return result;
 }
 
-static ssize_t vfswrap_read(vfs_handle_struct *handle, files_struct *fsp, void *data, size_t n)
-{
-	ssize_t result;
-
-	START_PROFILE_BYTES(syscall_read, n);
-	result = sys_read(fsp->fh->fd, data, n);
-	END_PROFILE_BYTES(syscall_read);
-	return result;
-}
-
 static ssize_t vfswrap_pread(vfs_handle_struct *handle, files_struct *fsp, void *data,
 			size_t n, off_t offset)
 {
@@ -648,16 +638,6 @@ static ssize_t vfswrap_pread(vfs_handle_struct *handle, files_struct *fsp, void
 	return result;
 }
 
-static ssize_t vfswrap_write(vfs_handle_struct *handle, files_struct *fsp, const void *data, size_t n)
-{
-	ssize_t result;
-
-	START_PROFILE_BYTES(syscall_write, n);
-	result = sys_write(fsp->fh->fd, data, n);
-	END_PROFILE_BYTES(syscall_write);
-	return result;
-}
-
 static ssize_t vfswrap_pwrite(vfs_handle_struct *handle, files_struct *fsp, const void *data,
 			size_t n, off_t offset)
 {
@@ -670,28 +650,12 @@ static ssize_t vfswrap_pwrite(vfs_handle_struct *handle, files_struct *fsp, cons
 
 	if (result == -1 && errno == ESPIPE) {
 		/* Maintain the fiction that pipes can be sought on. */
-		result = SMB_VFS_WRITE(fsp, data, n);
+		result = sys_write(fsp->fh->fd, data, n);
 	}
 
 #else /* HAVE_PWRITE */
-	off_t   curr;
-	int         lerrno;
-
-	curr = SMB_VFS_LSEEK(fsp, 0, SEEK_CUR);
-	if (curr == -1) {
-		return -1;
-	}
-
-	if (SMB_VFS_LSEEK(fsp, offset, SEEK_SET) == -1) {
-		return -1;
-	}
-
-	result = SMB_VFS_WRITE(fsp, data, n);
-	lerrno = errno;
-
-	SMB_VFS_LSEEK(fsp, curr, SEEK_SET);
-	errno = lerrno;
-
+	errno = ENOSYS;
+	result = -1;
 #endif /* HAVE_PWRITE */
 
 	return result;
@@ -2990,11 +2954,9 @@ static struct vfs_fn_pointers vfs_default_fns = {
 	.open_fn = vfswrap_open,
 	.create_file_fn = vfswrap_create_file,
 	.close_fn = vfswrap_close,
-	.read_fn = vfswrap_read,
 	.pread_fn = vfswrap_pread,
 	.pread_send_fn = vfswrap_pread_send,
 	.pread_recv_fn = vfswrap_pread_recv,
-	.write_fn = vfswrap_write,
 	.pwrite_fn = vfswrap_pwrite,
 	.pwrite_send_fn = vfswrap_pwrite_send,
 	.pwrite_recv_fn = vfswrap_pwrite_recv,
diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c
index 45d6544..ee8dbbc 100644
--- a/source3/modules/vfs_full_audit.c
+++ b/source3/modules/vfs_full_audit.c
@@ -1032,19 +1032,6 @@ static int smb_full_audit_close(vfs_handle_struct *handle, files_struct *fsp)
 	return result;
 }
 
-static ssize_t smb_full_audit_read(vfs_handle_struct *handle, files_struct *fsp,
-			  void *data, size_t n)
-{
-	ssize_t result;
-
-	result = SMB_VFS_NEXT_READ(handle, fsp, data, n);
-
-	do_log(SMB_VFS_OP_READ, (result >= 0), handle, "%s",
-	       fsp_str_do_log(fsp));
-
-	return result;
-}
-
 static ssize_t smb_full_audit_pread(vfs_handle_struct *handle, files_struct *fsp,
 			   void *data, size_t n, off_t offset)
 {
@@ -1129,19 +1116,6 @@ static ssize_t smb_full_audit_pread_recv(struct tevent_req *req,
 	return state->ret;
 }
 
-static ssize_t smb_full_audit_write(vfs_handle_struct *handle, files_struct *fsp,
-			   const void *data, size_t n)
-{
-	ssize_t result;
-
-	result = SMB_VFS_NEXT_WRITE(handle, fsp, data, n);
-
-	do_log(SMB_VFS_OP_WRITE, (result >= 0), handle, "%s",
-	       fsp_str_do_log(fsp));
-
-	return result;
-}
-
 static ssize_t smb_full_audit_pwrite(vfs_handle_struct *handle, files_struct *fsp,
 			    const void *data, size_t n,
 			    off_t offset)
@@ -2507,11 +2481,9 @@ static struct vfs_fn_pointers vfs_full_audit_fns = {
 	.open_fn = smb_full_audit_open,
 	.create_file_fn = smb_full_audit_create_file,
 	.close_fn = smb_full_audit_close,
-	.read_fn = smb_full_audit_read,
 	.pread_fn = smb_full_audit_pread,
 	.pread_send_fn = smb_full_audit_pread_send,
 	.pread_recv_fn = smb_full_audit_pread_recv,
-	.write_fn = smb_full_audit_write,
 	.pwrite_fn = smb_full_audit_pwrite,
 	.pwrite_send_fn = smb_full_audit_pwrite_send,
 	.pwrite_recv_fn = smb_full_audit_pwrite_recv,
diff --git a/source3/modules/vfs_glusterfs.c b/source3/modules/vfs_glusterfs.c
index 5878c14..b022e98 100644
--- a/source3/modules/vfs_glusterfs.c
+++ b/source3/modules/vfs_glusterfs.c
@@ -592,12 +592,6 @@ static int vfs_gluster_close(struct vfs_handle_struct *handle,
 	return glfs_close(glfd);
 }
 
-static ssize_t vfs_gluster_read(struct vfs_handle_struct *handle,
-				files_struct *fsp, void *data, size_t n)
-{
-	return glfs_read(*(glfs_fd_t **)VFS_FETCH_FSP_EXTENSION(handle, fsp), data, n, 0);
-}
-
 static ssize_t vfs_gluster_pread(struct vfs_handle_struct *handle,
 				 files_struct *fsp, void *data, size_t n,
 				 off_t offset)
@@ -887,12 +881,6 @@ static ssize_t vfs_gluster_recv(struct tevent_req *req,
 	return ret;
 }
 
-static ssize_t vfs_gluster_write(struct vfs_handle_struct *handle,
-				 files_struct *fsp, const void *data, size_t n)
-{
-	return glfs_write(*(glfs_fd_t **)VFS_FETCH_FSP_EXTENSION(handle, fsp), data, n, 0);
-}
-
 static ssize_t vfs_gluster_pwrite(struct vfs_handle_struct *handle,
 				  files_struct *fsp, const void *data,
 				  size_t n, off_t offset)
@@ -1453,11 +1441,9 @@ static struct vfs_fn_pointers glusterfs_fns = {
 	.open_fn = vfs_gluster_open,
 	.create_file_fn = NULL,
 	.close_fn = vfs_gluster_close,
-	.read_fn = vfs_gluster_read,
 	.pread_fn = vfs_gluster_pread,
 	.pread_send_fn = vfs_gluster_pread_send,
 	.pread_recv_fn = vfs_gluster_recv,
-	.write_fn = vfs_gluster_write,
 	.pwrite_fn = vfs_gluster_pwrite,
 	.pwrite_send_fn = vfs_gluster_pwrite_send,
 	.pwrite_recv_fn = vfs_gluster_recv,
diff --git a/source3/modules/vfs_time_audit.c b/source3/modules/vfs_time_audit.c
index 383f49b..084c209 100644
--- a/source3/modules/vfs_time_audit.c
+++ b/source3/modules/vfs_time_audit.c
@@ -648,25 +648,6 @@ static int smb_time_audit_close(vfs_handle_struct *handle, files_struct *fsp)
 	return result;
 }
 
-static ssize_t smb_time_audit_read(vfs_handle_struct *handle,


-- 
Samba Shared Repository



More information about the samba-cvs mailing list