On Tue, Mar 6, 2018 at 10:22 AM, Sowmini Varadhan <sowmini.varad...@oracle.com> wrote: > Move the large block of code predicated on zcopy from > rds_message_copy_from_user into a new function, > rds_message_zcopy_from_user() > > Signed-off-by: Sowmini Varadhan <sowmini.varad...@oracle.com>
Acked-by: Willem de Bruijn <will...@google.com> > +int rds_message_copy_from_user(struct rds_message *rm, struct iov_iter *from, > + bool zcopy) > +{ > + unsigned long to_copy, nbytes; > + unsigned long sg_off; > + struct scatterlist *sg; > + int ret = 0; > + > + rm->m_inc.i_hdr.h_len = cpu_to_be32(iov_iter_count(from)); > + > + /* now allocate and copy in the data payload. */ > + sg = rm->data.op_sg; > + sg_off = 0; /* Dear gcc, sg->page will be null from kzalloc. */ The above lines appear both here and in rds_message_zcopy_from_user. Not strictly necessary, but not buggy, so no need to revise just for that.