Re: [PATCH 23/50] nfsd4: "backfill" using write_bytes_to_xdr_buf

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Mar 22, 2014 at 11:51:54PM -0700, Christoph Hellwig wrote:
> Looks good, but shouldn't there be an abstract function to skip writing
> into an XDR buf instead of the pointer increment as well?

So you're talking about the earlier spot in the code where we've got a

	p++; /* to be filled in later? */

I'm not convinced it'd be worth it, but maybe.

> I wonder if the XDR buf internal should even be entirely hidden to the
> consummers and it should only be accessed through procedural interfaces?

By the end of the series, most xdr encoding looks like

	p = xdr_reserve_space(xdr, <nbytes>);

	*p++ = cpu_to_be32(<some value>);
	p = xdr_encode_something_more_complicated(p, <some struct>);
	...

It doesn't require the encoders to know much about xdr_buf's.

The main exception is read, especially the splice case.  We could
probably do better there, I just haven't thought much about it yet.

Hm, but maybe what you're asking for here is just a
write_bytes_to_xdr_buf wrapper that takes the xdr_stream instead of an
xdr_buf, and a corresponding function to read xdr->buf->len when we want
an offset?  OK, maybe so.

--b.
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux