mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@kernel.org>
To: Chuck Lever III <chuck.lever@oracle.com>
Cc: Neil Brown <neilb@suse.de>, Dai Ngo <dai.ngo@oracle.com>,
	Olga Kornievskaia <okorniev@redhat.com>,
	Tom Talpey <tom@talpey.com>, Trond Myklebust <trondmy@kernel.org>,
	Anna Schumaker <anna@kernel.org>, Tom Haynes <loghyr@gmail.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	 Linux NFS Mailing List <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH 1/3] nfsd: bring in support for delstid draft XDR encoding
Date: Mon, 19 Aug 2024 16:04:26 -0400	[thread overview]
Message-ID: <b7d76076fe593b0c24ce983db9a0dbacc9fbfa5d.camel@kernel.org> (raw)
In-Reply-To: <3DB9A299-B55F-45BB-8B28-65F44F14F6A2@oracle.com>

On Mon, 2024-08-19 at 19:50 +0000, Chuck Lever III wrote:
> 
> 
> > On Aug 19, 2024, at 9:26 AM, Jeff Layton <jlayton@kernel.org>
> > wrote:
> > 
> > I'm playing with the new version now and it seems to be much
> > improved.
> > Only two real bugs I've hit at this point:
> > 
> > 1/ Some of the struct specifications need to be typedefs as well.
> > For
> > instance, the delstid draft refers to "nfstime4", but the
> > autogenerated
> > struct definition doesn't have the typedef for it. It may be best
> > to
> > just add typedefs for all of these sorts of structs.
> 
> What's the specific symptom? I've been able to catenate nfs4_1.x
> and delstid.x, xdrgen builds the header and source without tossing
> any exceptions, and gcc compiles it without complaint.
> 


Basically, I was getting this when I'd convert nfs4_1.x to a header:

struct nfstime4 {
        int64_t seconds;
        uint32_t nseconds;
};

...but the delstid header has these:

typedef nfstime4 fattr4_time_deleg_access;

typedef nfstime4 fattr4_time_deleg_modify;


...nothing defined nfstime4 in this case.

> AFAICT, xdrgen will add "struct" where it's necessary.
> 
> I've been squirrelly about using "typedef" too often because
> the Linux kernel's coding style is to avoid C typedefs for
> shorthand structure names.
> 

Oh, ok. I didn't concatenate the files like you did and just generated
the delstid files separately from the nfs4_1 ones. I guess that throws
off the dependency tracking that you're doing here for typedefs.

> 
> > 2/ xdrgen_encode_nfstime4 want a pointer to the nfstime4, but the
> > autogenerated code for xdrgen_encode_fattr4_time_deleg_access and
> > xdrgen_encode_fattr4_time_deleg_modify try to pass it by value
> > instead.
> 
> Here's my generated copy of xdrgen_encode_fattr_time_deleg_access:
> 
> /* typedef fattr4_time_deleg_access */
> static bool
> __maybe_unused                                                     
> xdrgen_encode_fattr4_time_deleg_access(struct xdr_stream *xdr, const
> fattr4_time_deleg_access value)
> {
> 	/* (basic) */
> 	return xdrgen_encode_nfstime4(xdr, &value);
> };
> 
> Looks like it does the right thing...?

Probably another side-effect of it not knowing what to do with nfstime4
when I convert the delstid draft. Concatenating them seems unwieldy but
I guess that would work. I do like being able to keep generated code
from different files separate though.

-- 
Jeff Layton <jlayton@kernel.org>

  reply	other threads:[~2024-08-19 20:04 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-16 12:42 [PATCH 0/3] nfsd: implement OPEN_XOR_DELEGATION part of delstid draft Jeff Layton
2024-08-16 12:42 ` [PATCH 1/3] nfsd: bring in support for delstid draft XDR encoding Jeff Layton
2024-08-16 15:17   ` Chuck Lever
2024-08-16 15:45     ` Jeff Layton
2024-08-16 16:16       ` Chuck Lever
2024-08-16 16:34         ` Jeff Layton
2024-08-19  0:04   ` NeilBrown
2024-08-19 11:44     ` Jeff Layton
2024-08-19 13:21       ` Chuck Lever III
2024-08-19 13:26         ` Jeff Layton
2024-08-19 13:28           ` Chuck Lever III
2024-08-19 19:50           ` Chuck Lever III
2024-08-19 20:04             ` Jeff Layton [this message]
2024-08-19 23:16               ` Chuck Lever III
2024-08-20 12:18                 ` Jeff Layton
2024-08-16 12:42 ` [PATCH 2/3] nfsd: add support for FATTR4_OPEN_ARGUMENTS Jeff Layton
2024-08-16 12:42 ` [PATCH 3/3] nfsd: implement OPEN_ARGS_SHARE_ACCESS_WANT_OPEN_XOR_DELEGATION Jeff Layton

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=b7d76076fe593b0c24ce983db9a0dbacc9fbfa5d.camel@kernel.org \
    --to=jlayton@kernel.org \
    --cc=anna@kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=dai.ngo@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=loghyr@gmail.com \
    --cc=neilb@suse.de \
    --cc=okorniev@redhat.com \
    --cc=tom@talpey.com \
    --cc=trondmy@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

all inboxes | Powered by JetHome®