linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Dmitry V. Levin" <ldv@altlinux.org>
To: "J. Bruce Fields" <bfields@fieldses.org>
Cc: Jeff Layton <jlayton@poochiereds.net>,
	linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] uapi: fix linux/nfsd/cld.h userspace compilation errors
Date: Fri, 10 Mar 2017 01:31:14 +0300	[thread overview]
Message-ID: <20170309223114.GA19081@altlinux.org> (raw)
In-Reply-To: <20170309210051.GH3929@fieldses.org>

[-- Attachment #1: Type: text/plain, Size: 3318 bytes --]

On Thu, Mar 09, 2017 at 04:00:51PM -0500, J. Bruce Fields wrote:
> Why aren't the unitX_t types OK here?

unitX_t types are not OK here because no UAPI header defines them,
include/uapi/linux/types.h defines only their __uX/__sX analogues.

For this reason most of UAPI headers use types provided by
<linux/types.h>, see e.g. include/uapi/linux/nfsd/nfsfh.h

There are few exceptions to this rule when headers are made portable
between linux and other operating systems.

> Anyway, assuming this is right I'll apply for 4.12.  (I'm assuming it's
> not urgent since this file's always been this way.)

This should be safe to apply for 4.11 as well, but it's surely not urgent.

> --b.
> 
> On Wed, Mar 01, 2017 at 03:12:03AM +0300, Dmitry V. Levin wrote:
> > Include <linux/types.h> and consistently use types it provides
> > to fix the following linux/nfsd/cld.h userspace compilation errors:
> > 
> > /usr/include/linux/nfsd/cld.h:40:2: error: unknown type name 'uint16_t'
> >   uint16_t cn_len;    /* length of cm_id */
> > /usr/include/linux/nfsd/cld.h:46:2: error: unknown type name 'uint8_t'
> >   uint8_t  cm_vers;  /* upcall version */
> > /usr/include/linux/nfsd/cld.h:47:2: error: unknown type name 'uint8_t'
> >   uint8_t  cm_cmd;   /* upcall command */
> > /usr/include/linux/nfsd/cld.h:48:2: error: unknown type name 'int16_t'
> >   int16_t  cm_status;  /* return code */
> > /usr/include/linux/nfsd/cld.h:49:2: error: unknown type name 'uint32_t'
> >   uint32_t cm_xid;   /* transaction id */
> > /usr/include/linux/nfsd/cld.h:51:3: error: unknown type name 'int64_t'
> >    int64_t  cm_gracetime; /* grace period start time */
> > 
> > Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
> > ---
> >  include/uapi/linux/nfsd/cld.h | 14 ++++++++------
> >  1 file changed, 8 insertions(+), 6 deletions(-)
> > 
> > diff --git a/include/uapi/linux/nfsd/cld.h b/include/uapi/linux/nfsd/cld.h
> > index f14a9ab..ec26027 100644
> > --- a/include/uapi/linux/nfsd/cld.h
> > +++ b/include/uapi/linux/nfsd/cld.h
> > @@ -22,6 +22,8 @@
> >  #ifndef _NFSD_CLD_H
> >  #define _NFSD_CLD_H
> >  
> > +#include <linux/types.h>
> > +
> >  /* latest upcall version available */
> >  #define CLD_UPCALL_VERSION 1
> >  
> > @@ -37,18 +39,18 @@ enum cld_command {
> >  
> >  /* representation of long-form NFSv4 client ID */
> >  struct cld_name {
> > -	uint16_t	cn_len;				/* length of cm_id */
> > +	__u16		cn_len;				/* length of cm_id */
> >  	unsigned char	cn_id[NFS4_OPAQUE_LIMIT];	/* client-provided */
> >  } __attribute__((packed));
> >  
> >  /* message struct for communication with userspace */
> >  struct cld_msg {
> > -	uint8_t		cm_vers;		/* upcall version */
> > -	uint8_t		cm_cmd;			/* upcall command */
> > -	int16_t		cm_status;		/* return code */
> > -	uint32_t	cm_xid;			/* transaction id */
> > +	__u8		cm_vers;		/* upcall version */
> > +	__u8		cm_cmd;			/* upcall command */
> > +	__s16		cm_status;		/* return code */
> > +	__u32		cm_xid;			/* transaction id */
> >  	union {
> > -		int64_t		cm_gracetime;	/* grace period start time */
> > +		__s64		cm_gracetime;	/* grace period start time */
> >  		struct cld_name	cm_name;
> >  	} __attribute__((packed)) cm_u;
> >  } __attribute__((packed));
> > -- 
> > ldv

-- 
ldv

[-- Attachment #2: Type: application/pgp-signature, Size: 801 bytes --]

  reply	other threads:[~2017-03-09 22:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-01  0:12 [PATCH] uapi: fix linux/nfsd/cld.h userspace compilation errors Dmitry V. Levin
2017-03-09 21:00 ` J. Bruce Fields
2017-03-09 22:31   ` Dmitry V. Levin [this message]
2017-03-10 17:36     ` J. Bruce Fields

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=20170309223114.GA19081@altlinux.org \
    --to=ldv@altlinux.org \
    --cc=bfields@fieldses.org \
    --cc=jlayton@poochiereds.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).