From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org ([140.211.166.183]:51442 "EHLO smtp.gentoo.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753671AbcHSAzg (ORCPT ); Thu, 18 Aug 2016 20:55:36 -0400 Date: Thu, 18 Aug 2016 09:00:26 -0700 From: Mike Frysinger To: Jeff Layton Cc: libc-alpha@sourceware.org, linux-fsdevel@vger.kernel.org, chrubis@suse.cz Subject: Re: [glibc PATCH] fcntl-linux.h: add F_OFD_*32 constants Message-ID: <20160818160026.GI21655@vapier.lan> References: <1471521815-4340-1-git-send-email-jlayton@redhat.com> <20160818130431.GH21655@vapier.lan> <1471528199.2504.5.camel@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="7SrMUQONj8Rl9QNG" Content-Disposition: inline In-Reply-To: <1471528199.2504.5.camel@redhat.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: --7SrMUQONj8Rl9QNG Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 18 Aug 2016 09:49, Jeff Layton wrote: > On Thu, 2016-08-18 at 06:04 -0700, Mike Frysinger wrote: > > On 18 Aug 2016 08:03, Jeff Layton wrote: > > > --- a/sysdeps/unix/sysv/linux/bits/fcntl-linux.h > > > +++ b/sysdeps/unix/sysv/linux/bits/fcntl-linux.h > > > @@ -127,11 +127,20 @@ > > > =C2=A0=C2=A0=C2=A0=C2=A0This means that they are inherited across for= k or clone with CLONE_FILES > > > =C2=A0=C2=A0=C2=A0=C2=A0like BSD (flock) locks, and they are only rel= eased automatically when the > > > =C2=A0=C2=A0=C2=A0=C2=A0last reference to the the file description ag= ainst which they were acquired > > > -=C2=A0=C2=A0=C2=A0is put. */ > > > +=C2=A0=C2=A0=C2=A0is put.=C2=A0=C2=A0*/ > > > =C2=A0#ifdef __USE_GNU > > > > > -# define F_OFD_GETLK 36 > > > > > -# define F_OFD_SETLK 37 > > > > > -# define F_OFD_SETLKW 38 > > > +# if __OFF_T_MATCHES_OFF64_T || defined __USE_FILE_OFFSET64 > > > > > +#=C2=A0=C2=A0define F_OFD_GETLK 36 > > > > > +#=C2=A0=C2=A0define F_OFD_SETLK 37 > > > > > +#=C2=A0=C2=A0define F_OFD_SETLKW 38 > > > +# else > > > > > +#=C2=A0=C2=A0define F_OFD_GETLK32 39 > > > > > +#=C2=A0=C2=A0define F_OFD_SETLK32 40 > > > > > +#=C2=A0=C2=A0define F_OFD_SETLKW32 41 > > > > > +#=C2=A0=C2=A0define F_OFD_GETLK F_OFD_GETLK32 > > > > > +#=C2=A0=C2=A0define F_OFD_SETLK F_OFD_SETLK32 > > > > > +#=C2=A0=C2=A0define F_OFD_SETLKW F_OFD_SETLKW32 > > > +# endif > > > =C2=A0#endif > >=20 > > i think we should define *64 and *32 variants all the time, and > > then route the F_OFD_GETLK/etc... to them based on compile mode. >=20 > Sorry, I don't quite understand here. The whole point is that the > existing F_OFD_* constants are already implicitly 64-bit. Why do we > need separate constants postfixed with "64" that no one will ever use? you're making them not explicitly 64-bit when off_t!=3Doff64_t. all the other commands in this file have used the convention: : automatically 32-bit or 64-bit 64: always 64-bit so the header would do: #define F_OFD_GETLK64 36 #define F_OFD_SETLK64 37 #define F_OFD_SETLKW64 38 #if __OFF_T_MATCHES_OFF64_T || defined __USE_FILE_OFFSET64 # define F_OFD_GETLK F_OFD_GETLK64 # define F_OFD_SETLK F_OFD_SETLK64 # define F_OFD_SETLKW F_OFD_SETLKW64 #else # define F_OFD_GETLK 39 # define F_OFD_SETLK 40 # define F_OFD_SETLKW 41 #endif the defines deviate a bit from the names used on the kernel side, but we've already done that, and you're proposed patch does too. -mike --7SrMUQONj8Rl9QNG Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXtduaAAoJEEFjO5/oN/WBQbIP/iXa7oH8fpH5oWcU145Ko3MG ShoYCnh/xwwF554Yd9oMYrwEJKxTReaIlehniLULtKq7A0di73ZW7hkMpkEND9f9 OprnL+znekAK7xUrprQrgYL7j+0UdPVcZBHv/uGwUrap+drfqWzF7AuFaLqNNbGl wx/SvHuo2SZusicbCvcUg6DNiVdyKKBlZDof+F9QTelmAJ0ScUPcFVHOl3VTGolM 1ytJ//Rf1MMtXkjA36Dy8I9Z1hzzYheP4QFh3QdhHWbVbb/FiNjIV1EAegxRpQkE mMJSJB2avdt6GXLvmPxSD+iqMlgpwzdp8HyBF22s5vrWQuBjvUbcihzqUcZwEMzr eBiNAyRiAx/NEIXR0Uxe9VLw00Vh0mTuy19RloYO69fNXcAl28FvJI5XOaCTQzWo P/O7UBY0mwKB7DrXAPsZkj+CSh/vRw47e25xmiVS9Rash90CJ0bgnwLS1bFhVrO4 zh4UB4svC2/dQaBuCcop4tERZoVX9xuHI/0vTgoF28+G94ORgchJKptJiegLH9Im bitGQbt9GveUxuFPMGa4K2wIm2Fv6wSjDHxpYTaRL54jgJK5Famx8ahXFTHPYZhH DH8u+kbKNaUC5/7eLUYhAg2Q4g4v+hzsXGvmkZ4jMYQ189bDlLv2YT1RRzUuiuQe zkqUt/9T8VFcXuK4Hxgx =WfIy -----END PGP SIGNATURE----- --7SrMUQONj8Rl9QNG--