From: Jeremy Allison Date: Wed, 2 May 2018 23:44:23 +0000 (-0700) Subject: s3: VFS: Remove vfs_write_data(). No longer used. X-Git-Tag: ldb-1.4.0~408 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=25bad32993150a49a767aca87c7d234314ba7210;p=thirdparty%2Fsamba.git s3: VFS: Remove vfs_write_data(). No longer used. Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c index a96122a15b2..395f7b87da6 100644 --- a/source3/printing/nt_printing.c +++ b/source3/printing/nt_printing.c @@ -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, diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h index 81350469c28..2f315ce0565 100644 --- a/source3/smbd/proto.h +++ b/source3/smbd/proto.h @@ -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, diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c index 9e9a9e88164..aa01b1b07f0 100644 --- a/source3/smbd/vfs.c +++ b/source3/smbd/vfs.c @@ -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,