linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: manual merge of the cel tree with the nfs tree
@ 2020-12-15  0:41 Stephen Rothwell
  2020-12-17  1:52 ` Stephen Rothwell
  0 siblings, 1 reply; 2+ messages in thread
From: Stephen Rothwell @ 2020-12-15  0:41 UTC (permalink / raw)
  To: Chuck Lever, Trond Myklebust
  Cc: Linux Kernel Mailing List, Linux Next Mailing List, Trond Myklebust

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

Hi all,

Today's linux-next merge of the cel tree got a conflict in:

  include/linux/sunrpc/xdr.h

between commits:

  9a20f6f4e6ba ("SUNRPC: Fixes for xdr_align_data()")
  c4f2f591f02c ("SUNRPC: Fix xdr_expand_hole()")
  f8d0e60f1056 ("SUNRPC: Cleanup - constify a number of xdr_buf helpers")

from the nfs tree and commits:

  5a7e702670ad ("SUNRPC: Adjust synopsis of xdr_buf_subsegment()")
  c1346a1216ab ("NFSD: Replace the internals of the READ_BUF() macro")

from the cel tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc include/linux/sunrpc/xdr.h
index 68d49fdc4ee9,9b35ce50cf2b..000000000000
--- a/include/linux/sunrpc/xdr.h
+++ b/include/linux/sunrpc/xdr.h
@@@ -182,14 -182,15 +182,15 @@@ xdr_adjust_iovec(struct kvec *iov, __be
   * XDR buffer helper functions
   */
  extern void xdr_shift_buf(struct xdr_buf *, size_t);
 -extern void xdr_buf_from_iov(struct kvec *, struct xdr_buf *);
 +extern void xdr_buf_from_iov(const struct kvec *, struct xdr_buf *);
- extern int xdr_buf_subsegment(const struct xdr_buf *, struct xdr_buf *, unsigned int, unsigned int);
+ extern int xdr_buf_subsegment(const struct xdr_buf *buf, struct xdr_buf *subbuf,
+ 			      unsigned int base, unsigned int len);
  extern void xdr_buf_trim(struct xdr_buf *, unsigned int);
 -extern int read_bytes_from_xdr_buf(struct xdr_buf *, unsigned int, void *, unsigned int);
 -extern int write_bytes_to_xdr_buf(struct xdr_buf *, unsigned int, void *, unsigned int);
 +extern int read_bytes_from_xdr_buf(const struct xdr_buf *, unsigned int, void *, unsigned int);
 +extern int write_bytes_to_xdr_buf(const struct xdr_buf *, unsigned int, void *, unsigned int);
  
 -extern int xdr_encode_word(struct xdr_buf *, unsigned int, u32);
 -extern int xdr_decode_word(struct xdr_buf *, unsigned int, u32 *);
 +extern int xdr_encode_word(const struct xdr_buf *, unsigned int, u32);
 +extern int xdr_decode_word(const struct xdr_buf *, unsigned int, u32 *);
  
  struct xdr_array2_desc;
  typedef int (*xdr_xcode_elem_t)(struct xdr_array2_desc *desc, void *elem);
@@@ -250,10 -251,54 +251,54 @@@ extern void xdr_init_decode_pages(struc
  extern __be32 *xdr_inline_decode(struct xdr_stream *xdr, size_t nbytes);
  extern unsigned int xdr_read_pages(struct xdr_stream *xdr, unsigned int len);
  extern void xdr_enter_page(struct xdr_stream *xdr, unsigned int len);
 -extern int xdr_process_buf(struct xdr_buf *buf, unsigned int offset, unsigned int len, int (*actor)(struct scatterlist *, void *), void *data);
 -extern uint64_t xdr_align_data(struct xdr_stream *, uint64_t, uint32_t);
 -extern uint64_t xdr_expand_hole(struct xdr_stream *, uint64_t, uint64_t);
 +extern int xdr_process_buf(const struct xdr_buf *buf, unsigned int offset, unsigned int len, int (*actor)(struct scatterlist *, void *), void *data);
 +extern unsigned int xdr_align_data(struct xdr_stream *, unsigned int offset, unsigned int length);
 +extern unsigned int xdr_expand_hole(struct xdr_stream *, unsigned int offset, unsigned int length);
+ extern bool xdr_stream_subsegment(struct xdr_stream *xdr, struct xdr_buf *subbuf,
+ 				  unsigned int len);
+ 
+ /**
+  * xdr_set_scratch_buffer - Attach a scratch buffer for decoding data.
+  * @xdr: pointer to xdr_stream struct
+  * @buf: pointer to an empty buffer
+  * @buflen: size of 'buf'
+  *
+  * The scratch buffer is used when decoding from an array of pages.
+  * If an xdr_inline_decode() call spans across page boundaries, then
+  * we copy the data into the scratch buffer in order to allow linear
+  * access.
+  */
+ static inline void
+ xdr_set_scratch_buffer(struct xdr_stream *xdr, void *buf, size_t buflen)
+ {
+ 	xdr->scratch.iov_base = buf;
+ 	xdr->scratch.iov_len = buflen;
+ }
+ 
+ /**
+  * xdr_set_scratch_page - Attach a scratch buffer for decoding data
+  * @xdr: pointer to xdr_stream struct
+  * @page: an anonymous page
+  *
+  * See xdr_set_scratch_buffer().
+  */
+ static inline void
+ xdr_set_scratch_page(struct xdr_stream *xdr, struct page *page)
+ {
+ 	xdr_set_scratch_buffer(xdr, page_address(page), PAGE_SIZE);
+ }
+ 
+ /**
+  * xdr_reset_scratch_buffer - Clear scratch buffer information
+  * @xdr: pointer to xdr_stream struct
+  *
+  * See xdr_set_scratch_buffer().
+  */
+ static inline void
+ xdr_reset_scratch_buffer(struct xdr_stream *xdr)
+ {
+ 	xdr_set_scratch_buffer(xdr, NULL, 0);
+ }
  
  /**
   * xdr_stream_remaining - Return the number of bytes remaining in the stream

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: linux-next: manual merge of the cel tree with the nfs tree
  2020-12-15  0:41 linux-next: manual merge of the cel tree with the nfs tree Stephen Rothwell
@ 2020-12-17  1:52 ` Stephen Rothwell
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Rothwell @ 2020-12-17  1:52 UTC (permalink / raw)
  To: Trond Myklebust
  Cc: Chuck Lever, Linux Kernel Mailing List, Linux Next Mailing List,
	Trond Myklebust

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

Hi all,

On Tue, 15 Dec 2020 11:41:50 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> 
> Today's linux-next merge of the cel tree got a conflict in:
> 
>   include/linux/sunrpc/xdr.h
> 
> between commits:
> 
>   9a20f6f4e6ba ("SUNRPC: Fixes for xdr_align_data()")
>   c4f2f591f02c ("SUNRPC: Fix xdr_expand_hole()")
>   f8d0e60f1056 ("SUNRPC: Cleanup - constify a number of xdr_buf helpers")
> 
> from the nfs tree and commits:
> 
>   5a7e702670ad ("SUNRPC: Adjust synopsis of xdr_buf_subsegment()")
>   c1346a1216ab ("NFSD: Replace the internals of the READ_BUF() macro")
> 
> from the cel tree.
> 
> I fixed it up (see below) and can carry the fix as necessary. This
> is now fixed as far as linux-next is concerned, but any non trivial
> conflicts should be mentioned to your upstream maintainer when your tree
> is submitted for merging.  You may also want to consider cooperating
> with the maintainer of the conflicting tree to minimise any particularly
> complex conflicts.
> 
> 
> diff --cc include/linux/sunrpc/xdr.h
> index 68d49fdc4ee9,9b35ce50cf2b..000000000000
> --- a/include/linux/sunrpc/xdr.h
> +++ b/include/linux/sunrpc/xdr.h
> @@@ -182,14 -182,15 +182,15 @@@ xdr_adjust_iovec(struct kvec *iov, __be
>    * XDR buffer helper functions
>    */
>   extern void xdr_shift_buf(struct xdr_buf *, size_t);
>  -extern void xdr_buf_from_iov(struct kvec *, struct xdr_buf *);
>  +extern void xdr_buf_from_iov(const struct kvec *, struct xdr_buf *);
> - extern int xdr_buf_subsegment(const struct xdr_buf *, struct xdr_buf *, unsigned int, unsigned int);
> + extern int xdr_buf_subsegment(const struct xdr_buf *buf, struct xdr_buf *subbuf,
> + 			      unsigned int base, unsigned int len);
>   extern void xdr_buf_trim(struct xdr_buf *, unsigned int);
>  -extern int read_bytes_from_xdr_buf(struct xdr_buf *, unsigned int, void *, unsigned int);
>  -extern int write_bytes_to_xdr_buf(struct xdr_buf *, unsigned int, void *, unsigned int);
>  +extern int read_bytes_from_xdr_buf(const struct xdr_buf *, unsigned int, void *, unsigned int);
>  +extern int write_bytes_to_xdr_buf(const struct xdr_buf *, unsigned int, void *, unsigned int);
>   
>  -extern int xdr_encode_word(struct xdr_buf *, unsigned int, u32);
>  -extern int xdr_decode_word(struct xdr_buf *, unsigned int, u32 *);
>  +extern int xdr_encode_word(const struct xdr_buf *, unsigned int, u32);
>  +extern int xdr_decode_word(const struct xdr_buf *, unsigned int, u32 *);
>   
>   struct xdr_array2_desc;
>   typedef int (*xdr_xcode_elem_t)(struct xdr_array2_desc *desc, void *elem);
> @@@ -250,10 -251,54 +251,54 @@@ extern void xdr_init_decode_pages(struc
>   extern __be32 *xdr_inline_decode(struct xdr_stream *xdr, size_t nbytes);
>   extern unsigned int xdr_read_pages(struct xdr_stream *xdr, unsigned int len);
>   extern void xdr_enter_page(struct xdr_stream *xdr, unsigned int len);
>  -extern int xdr_process_buf(struct xdr_buf *buf, unsigned int offset, unsigned int len, int (*actor)(struct scatterlist *, void *), void *data);
>  -extern uint64_t xdr_align_data(struct xdr_stream *, uint64_t, uint32_t);
>  -extern uint64_t xdr_expand_hole(struct xdr_stream *, uint64_t, uint64_t);
>  +extern int xdr_process_buf(const struct xdr_buf *buf, unsigned int offset, unsigned int len, int (*actor)(struct scatterlist *, void *), void *data);
>  +extern unsigned int xdr_align_data(struct xdr_stream *, unsigned int offset, unsigned int length);
>  +extern unsigned int xdr_expand_hole(struct xdr_stream *, unsigned int offset, unsigned int length);
> + extern bool xdr_stream_subsegment(struct xdr_stream *xdr, struct xdr_buf *subbuf,
> + 				  unsigned int len);
> + 
> + /**
> +  * xdr_set_scratch_buffer - Attach a scratch buffer for decoding data.
> +  * @xdr: pointer to xdr_stream struct
> +  * @buf: pointer to an empty buffer
> +  * @buflen: size of 'buf'
> +  *
> +  * The scratch buffer is used when decoding from an array of pages.
> +  * If an xdr_inline_decode() call spans across page boundaries, then
> +  * we copy the data into the scratch buffer in order to allow linear
> +  * access.
> +  */
> + static inline void
> + xdr_set_scratch_buffer(struct xdr_stream *xdr, void *buf, size_t buflen)
> + {
> + 	xdr->scratch.iov_base = buf;
> + 	xdr->scratch.iov_len = buflen;
> + }
> + 
> + /**
> +  * xdr_set_scratch_page - Attach a scratch buffer for decoding data
> +  * @xdr: pointer to xdr_stream struct
> +  * @page: an anonymous page
> +  *
> +  * See xdr_set_scratch_buffer().
> +  */
> + static inline void
> + xdr_set_scratch_page(struct xdr_stream *xdr, struct page *page)
> + {
> + 	xdr_set_scratch_buffer(xdr, page_address(page), PAGE_SIZE);
> + }
> + 
> + /**
> +  * xdr_reset_scratch_buffer - Clear scratch buffer information
> +  * @xdr: pointer to xdr_stream struct
> +  *
> +  * See xdr_set_scratch_buffer().
> +  */
> + static inline void
> + xdr_reset_scratch_buffer(struct xdr_stream *xdr)
> + {
> + 	xdr_set_scratch_buffer(xdr, NULL, 0);
> + }
>   
>   /**
>    * xdr_stream_remaining - Return the number of bytes remaining in the stream

This is now a conflict between the nfs tree and Linus' tree.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-12-17  1:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-15  0:41 linux-next: manual merge of the cel tree with the nfs tree Stephen Rothwell
2020-12-17  1:52 ` Stephen Rothwell

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).