From owner-svn-src-all@freebsd.org Sat Dec 14 17:26:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7DE641D2B0E; Sat, 14 Dec 2019 17:26:43 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47ZvbR1BT4z4Ymw; Sat, 14 Dec 2019 17:26:42 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id xBEHQSLl099003 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sat, 14 Dec 2019 19:26:31 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua xBEHQSLl099003 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id xBEHQS8x099002; Sat, 14 Dec 2019 19:26:28 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 14 Dec 2019 19:26:28 +0200 From: Konstantin Belousov To: Edward Tomasz Napierala Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r355754 - in head/sys: amd64/linux amd64/linux32 arm64/linux compat/linux i386/linux Message-ID: <20191214172628.GX2744@kib.kiev.ua> References: <201912141337.xBEDbH4Z010771@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201912141337.xBEDbH4Z010771@repo.freebsd.org> User-Agent: Mutt/1.12.2 (2019-09-21) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.3 X-Spam-Checker-Version: SpamAssassin 3.4.3 (2019-12-06) on tom.home X-Rspamd-Queue-Id: 47ZvbR1BT4z4Ymw X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2019 17:26:43 -0000 On Sat, Dec 14, 2019 at 01:37:17PM +0000, Edward Tomasz Napierala wrote: > Author: trasz > Date: Sat Dec 14 13:37:17 2019 > New Revision: 355754 > URL: https://svnweb.freebsd.org/changeset/base/355754 > > Log: > Add sync_file_range(2) implementation to linux(4); it's a thin wrapper > over the usual fsync(2). > > This silences some warnings when running "apt-get upgrade". > > Reviewed by: brooks, emaste > MFC after: 2 weeks > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D22371 > > Modified: > head/sys/amd64/linux/linux_dummy.c > head/sys/amd64/linux32/linux32_dummy.c > head/sys/arm64/linux/linux_dummy.c > head/sys/compat/linux/linux_file.c > head/sys/compat/linux/linux_file.h > head/sys/i386/linux/linux_dummy.c > > Modified: head/sys/amd64/linux/linux_dummy.c > ============================================================================== > --- head/sys/amd64/linux/linux_dummy.c Sat Dec 14 13:32:37 2019 (r355753) > +++ head/sys/amd64/linux/linux_dummy.c Sat Dec 14 13:37:17 2019 (r355754) > @@ -99,7 +99,6 @@ DUMMY(migrate_pages); > DUMMY(unshare); > /* Linux 2.6.17: */ > DUMMY(splice); > -DUMMY(sync_file_range); > DUMMY(tee); > DUMMY(vmsplice); > /* Linux 2.6.18: */ > > Modified: head/sys/amd64/linux32/linux32_dummy.c > ============================================================================== > --- head/sys/amd64/linux32/linux32_dummy.c Sat Dec 14 13:32:37 2019 (r355753) > +++ head/sys/amd64/linux32/linux32_dummy.c Sat Dec 14 13:37:17 2019 (r355754) > @@ -105,7 +105,6 @@ DUMMY(migrate_pages); > DUMMY(unshare); > /* Linux 2.6.17: */ > DUMMY(splice); > -DUMMY(sync_file_range); > DUMMY(tee); > DUMMY(vmsplice); > /* Linux 2.6.18: */ > > Modified: head/sys/arm64/linux/linux_dummy.c > ============================================================================== > --- head/sys/arm64/linux/linux_dummy.c Sat Dec 14 13:32:37 2019 (r355753) > +++ head/sys/arm64/linux/linux_dummy.c Sat Dec 14 13:37:17 2019 (r355754) > @@ -101,7 +101,6 @@ DUMMY(migrate_pages); > DUMMY(unshare); > /* Linux 2.6.17: */ > DUMMY(splice); > -DUMMY(sync_file_range); > DUMMY(tee); > DUMMY(vmsplice); > /* Linux 2.6.18: */ > > Modified: head/sys/compat/linux/linux_file.c > ============================================================================== > --- head/sys/compat/linux/linux_file.c Sat Dec 14 13:32:37 2019 (r355753) > +++ head/sys/compat/linux/linux_file.c Sat Dec 14 13:37:17 2019 (r355754) > @@ -908,6 +908,22 @@ linux_fdatasync(td, uap) > } > > int > +linux_sync_file_range(td, uap) > + struct thread *td; > + struct linux_sync_file_range_args *uap; Why use K&R definitions in 2019 ? > +{ > + > + if (uap->offset < 0 || uap->nbytes < 0 || > + (uap->flags & ~(LINUX_SYNC_FILE_RANGE_WAIT_BEFORE | > + LINUX_SYNC_FILE_RANGE_WRITE | > + LINUX_SYNC_FILE_RANGE_WAIT_AFTER)) != 0) { > + return (EINVAL); > + } > + > + return (kern_fsync(td, uap->fd, false)); > +} > + > +int > linux_pread(struct thread *td, struct linux_pread_args *uap) This function is defined using ANSI C method. > { > struct vnode *vp; > > Modified: head/sys/compat/linux/linux_file.h > ============================================================================== > --- head/sys/compat/linux/linux_file.h Sat Dec 14 13:32:37 2019 (r355753) > +++ head/sys/compat/linux/linux_file.h Sat Dec 14 13:37:17 2019 (r355754) > @@ -134,4 +134,11 @@ > #define LINUX_RENAME_EXCHANGE 0x00000002 > #define LINUX_RENAME_WHITEOUT 0x00000004 > > +/* > + * sync_file_range flags > + */ > +#define LINUX_SYNC_FILE_RANGE_WAIT_BEFORE 1 > +#define LINUX_SYNC_FILE_RANGE_WRITE 2 > +#define LINUX_SYNC_FILE_RANGE_WAIT_AFTER 4 > + > #endif /* !_LINUX_FILE_H_ */ > > Modified: head/sys/i386/linux/linux_dummy.c > ============================================================================== > --- head/sys/i386/linux/linux_dummy.c Sat Dec 14 13:32:37 2019 (r355753) > +++ head/sys/i386/linux/linux_dummy.c Sat Dec 14 13:37:17 2019 (r355754) > @@ -101,7 +101,6 @@ DUMMY(migrate_pages); > DUMMY(unshare); > /* Linux 2.6.17: */ > DUMMY(splice); > -DUMMY(sync_file_range); > DUMMY(tee); > DUMMY(vmsplice); > /* Linux 2.6.18: */