From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f193.google.com (mail-lj1-f193.google.com [209.85.208.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id E151C469710 for ; Mon, 25 May 2020 18:26:08 +0300 (MSK) Received: by mail-lj1-f193.google.com with SMTP id o14so21210029ljp.4 for ; Mon, 25 May 2020 08:26:08 -0700 (PDT) Date: Mon, 25 May 2020 18:26:05 +0300 From: Cyrill Gorcunov Message-ID: <20200525152605.GD2464@grain> References: <0f65635ef9ee95131ac0e83b0b70e8c204a322b8.1589968157.git.kyukhin@tarantool.org> <20200523183032.GB2714@atlas> <20200525131354.junz5joymznc6r6j@tarantool.org> <20200525143419.GA33892@atlas> <20200525151848.GC2464@grain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200525151848.GC2464@grain> Subject: Re: [Tarantool-patches] [PATCH 1/2] Copy DSO module before load instead of symlink-ing List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Konstantin Osipov Cc: tarantool-patches@dev.tarantool.org On Mon, May 25, 2020 at 06:18:48PM +0300, Cyrill Gorcunov wrote: > On Mon, May 25, 2020 at 05:34:19PM +0300, Konstantin Osipov wrote: > > > > > + off_t pos, left; > > > + for (left = st.st_size, pos = 0; left > 0;) { > > > + off_t ret = eio_sendfile_sync(dest_fd, source_fd, pos, > > > + st.st_size); > > > > I wonder why do you use eio_sendfile_sync()? > > > > I don't know why coio_copyfile uses it BTW. Why is eio_sendfile() > > not enough? > > ``` > eio_ssize_t > eio_sendfile_sync (int ofd, int ifd, off_t offset, size_t count) > { > return eio__sendfile (ofd, ifd, offset, count); > } > ``` > > They are simply alias to each other. If you meant that there is no need for a loop, then indeed, looks like eio__sendfile can handle partial writes by self. Still it comes from commit commit 04bf646f359cdf9ef0e07121b4d316c5d5d6213e Author: Cyrill Gorcunov Date: Thu Apr 18 23:49:58 2019 +0300 core/coio_file: Use eio_sendfile_sync instead of a chunk mode eio library provides a portable version of sendfile syscall which works a way more efficient than explicit copying file by 4K chunks. we've left this cycle here to be able to test partial transfers. Probably worth to simply drop it off by now, the commit is more than year old and I think we can assume that everything is tested enoough and we don't need error injection in this code anymore.