s3: VFS: Remove vfs_write_data(). No longer used.
authorJeremy Allison <jra@samba.org>
Wed, 2 May 2018 23:44:23 +0000 (16:44 -0700)
committerRalph Boehme <slow@samba.org>
Fri, 4 May 2018 20:34:25 +0000 (22:34 +0200)
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/printing/nt_printing.c
source3/smbd/proto.h
source3/smbd/vfs.c

index a96122a15b206b61842c43b36dbc4dabb24571aa..395f7b87da624d0572d79c2cabde128aba6179f5 100644 (file)
@@ -313,7 +313,6 @@ const char *get_short_archi(const char *long_archi)
 
 /****************************************************************************
  Read data from fsp on the vfs.
- (note: EINTR re-read differs from vfs_write_data)
 ****************************************************************************/
 
 static ssize_t printing_pread_data(files_struct *fsp,
index 81350469c28e1ce771fa5ee6b47d48b8779aa3f2..2f315ce056503844895fd4a52b79afb92e484ab8 100644 (file)
@@ -1228,10 +1228,6 @@ void sys_utmp_yield(const char *username, const char *hostname,
 bool vfs_init_custom(connection_struct *conn, const char *vfs_object);
 bool smbd_vfs_init(connection_struct *conn);
 NTSTATUS vfs_file_exist(connection_struct *conn, struct smb_filename *smb_fname);
-ssize_t vfs_write_data(struct smb_request *req,
-                       files_struct *fsp,
-                       const char *buffer,
-                       size_t N);
 ssize_t vfs_pwrite_data(struct smb_request *req,
                        files_struct *fsp,
                        const char *buffer,
index 9e9a9e88164c24831da9d7e6b7ec98b8a7ced231..aa01b1b07f00c3c398d0ee083a7487e864d4c5cb 100644 (file)
@@ -398,53 +398,6 @@ NTSTATUS vfs_file_exist(connection_struct *conn, struct smb_filename *smb_fname)
        return NT_STATUS_OBJECT_NAME_NOT_FOUND;
 }
 
-/****************************************************************************
- Write data to a fd on the vfs.
-****************************************************************************/
-
-ssize_t vfs_write_data(struct smb_request *req,
-                       files_struct *fsp,
-                       const char *buffer,
-                       size_t N)
-{
-       size_t total=0;
-       ssize_t ret;
-
-       if (req && req->unread_bytes) {
-               int sockfd = req->xconn->transport.sock;
-               int old_flags;
-               SMB_ASSERT(req->unread_bytes == N);
-               /* VFS_RECVFILE must drain the socket
-                * before returning. */
-               req->unread_bytes = 0;
-               /* Ensure the socket is blocking. */
-               old_flags = fcntl(sockfd, F_GETFL, 0);
-               if (set_blocking(sockfd, true) == -1) {
-                       return (ssize_t)-1;
-               }
-               ret = SMB_VFS_RECVFILE(sockfd,
-                                       fsp,
-                                       (off_t)-1,
-                                       N);
-               if (fcntl(sockfd, F_SETFL, old_flags) == -1) {
-                       return (ssize_t)-1;
-               }
-               return ret;
-       }
-
-       while (total < N) {
-               ret = SMB_VFS_WRITE(fsp, buffer + total, N - total);
-
-               if (ret == -1)
-                       return -1;
-               if (ret == 0)
-                       return total;
-
-               total += ret;
-       }
-       return (ssize_t)total;
-}
-
 ssize_t vfs_pwrite_data(struct smb_request *req,
                        files_struct *fsp,
                        const char *buffer,