All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@sandeen.net>
To: xfs@oss.sgi.com
Subject: Re: [PATCH xfsprogs 2/2] linux.h: Define xfs_off_t as int64_t
Date: Sat, 30 Jul 2016 11:36:12 -0500	[thread overview]
Message-ID: <05dd3ff7-1784-9f9c-4d9e-170372d60e28@sandeen.net> (raw)
In-Reply-To: <20160730133737.GB5895@nyan>

On 7/30/16 8:37 AM, Felix Janda wrote:
> int64_t is guaranteed to have the correct size and signedness and is
> always avaible because linux.h has a <inttypes.h> include.
> 
> Fixes compilation error "unkown type name 'off64_t'" on linux when the
> public header <xfs.h> is included without _LARGEFILE64_SOURCE or
> _GNU_SOURCE defined. This bug was introduced in commit
> cb898f157f8410a03cf5f3400baa1df9e5eecd33.

Ok, I think that makes sense.  So the progression was:

Originally:	typedef loff_t         xfs_off_t;

(But, "musl does not know loff_t")

Next:		typedef off64_t        xfs_off_t;

(But, can break compilation w/o special defines)

Now:		typedef int64_t	       xfs_off_t;

which... I guess... satisfies everyone?  A comment
about why this, and not loff_t, might be worthwhile.

So I have to ask, seeing __int64_t right below this
int64_t; what's the difference/point in that?  Does
this need the __int64_t treatment for any other reason,
can you tell?

Just trying to avoid a 3rd change down the road.  ;)

Thanks,
-Eric

> Signed-off-by: Felix Janda <felix.janda@posteo.de>
> ---
>  include/linux.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/linux.h b/include/linux.h
> index 5614719..7653cac 100644
> --- a/include/linux.h
> +++ b/include/linux.h
> @@ -137,7 +137,7 @@ platform_discard_blocks(int fd, uint64_t start, uint64_t len)
>  #define EFSCORRUPTED	EUCLEAN	/* Filesystem is corrupted */
>  #define EFSBADCRC	EBADMSG	/* Bad CRC detected */
>  
> -typedef off64_t		xfs_off_t;
> +typedef int64_t		xfs_off_t;
>  typedef __uint64_t	xfs_ino_t;
>  typedef __uint32_t	xfs_dev_t;
>  typedef __int64_t	xfs_daddr_t;
> 

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  reply	other threads:[~2016-07-30 16:36 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-30 13:37 [PATCH xfsprogs 2/2] linux.h: Define xfs_off_t as int64_t Felix Janda
2016-07-30 16:36 ` Eric Sandeen [this message]
2016-08-01  6:24 ` Christoph Hellwig
2016-08-01  6:54   ` Felix Janda
2016-08-04  0:47     ` Dave Chinner
2016-08-05  8:02       ` Felix Janda
2016-08-05 11:52         ` Dave Chinner
2016-08-05 13:09           ` Felix Janda
2016-08-05 22:44             ` Dave Chinner
2016-08-06  8:38               ` Felix Janda
2016-08-06  9:13                 ` Felix Janda
2016-08-06 23:18                 ` Dave Chinner
2016-08-07  7:09                   ` Felix Janda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=05dd3ff7-1784-9f9c-4d9e-170372d60e28@sandeen.net \
    --to=sandeen@sandeen.net \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.