From: "J. Bruce Fields" <bfields@fieldses.org>
To: Christoph Hellwig <hch@infradead.org>
Cc: linux-nfs@vger.kernel.org
Subject: Re: sharing protocol defintions between client and server?
Date: Thu, 14 Nov 2013 14:35:24 -0500 [thread overview]
Message-ID: <20131114193524.GD21152@fieldses.org> (raw)
In-Reply-To: <20131114164046.GA32275@infradead.org>
On Thu, Nov 14, 2013 at 08:40:46AM -0800, Christoph Hellwig wrote:
> On Thu, Nov 14, 2013 at 10:05:46AM -0500, J. Bruce Fields wrote:
> > On Wed, Nov 13, 2013 at 08:21:16AM -0800, Christoph Hellwig wrote:
> > > >From a lot of the recent work it seems like there's basically no
> > > sharing of protocol definitions between the Linux NFS client and
> > > server, which seems fairly annoying to me.
> >
> > What are you thinking of exactly?
> >
> > I suspect that there could be more sharing.
>
> To make it easy I'll just quote from the SEEK patches.
>
> client:
>
> +struct nfs42_seek_args {
> + struct nfs4_sequence_args seq_args;
> +
> + struct nfs_fh *sa_fh;
> + nfs4_stateid *sa_stateid;
> + u64 sa_offset;
> + u32 sa_what;
> +};
> +
> +struct nfs42_seek_res {
> + struct nfs4_sequence_res seq_res;
> + unsigned int status;
> +
> + u32 sr_eof;
> + u32 sr_whence;
> + u64 sr_offset;
> + u64 sr_length;
> + u32 sr_allocated;
> +};
> +#endif
>
> server:
>
> +struct nfsd4_seek {
> + /* request */
> + stateid_t seek_stateid;
> + loff_t seek_offset;
> + u32 seek_whence;
> +
> + /* response */
> + u64 seek_pos;
> + u32 seek_eof;
> + u64 seek_length;
> + u32 seek_allocated;
> +};
>
> note that a lot of server operations also seem to have separate
> args and result substrutures. In general I'd love to have one
> structure for the actual on-the wire operation in a header, and then
> client and server could build in-memory versions around them.
>
> Of course just generating those from the XDR would be even better.
Sometimes a lot of those fields are unused. And we can currently do
things like read/write directly from/to the data structures these are
eventually going to end up in.
So in theory the existing code might be more efficient.
In practice I don't know if it is. And it'd be nice to be able to
autogenerate huge swaths of boring code.
--b.
> Maybe I'll play around with doing a krpcgen that we can initially
> just use for producing the structures, for which it should be
> pretty clear benefit. If we're lucky we might be to also move
> some marshalling/unmarshalling over to it later.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2013-11-14 19:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-13 16:21 sharing protocol defintions between client and server? Christoph Hellwig
2013-11-14 15:05 ` J. Bruce Fields
2013-11-14 16:40 ` Christoph Hellwig
2013-11-14 19:35 ` J. Bruce Fields [this message]
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=20131114193524.GD21152@fieldses.org \
--to=bfields@fieldses.org \
--cc=hch@infradead.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).