From: "Chuck Lever" Subject: Re: [PATCH 9/9] SUNRPC: skb_read_bits is the same as xs_tcp_copy_data Date: Fri, 13 Oct 2006 15:13:33 -0400 Message-ID: <76bd70e30610131213n7f034666x2dde84287a5aa9eb@mail.gmail.com> References: <20061012211247.8734.23147.stgit@ingres.dsl.sfldmi.ameritech.net> <20061012211523.8734.63869.stgit@ingres.dsl.sfldmi.ameritech.net> <20061013072516.GA13531@infradead.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Cc: nfs@lists.sourceforge.net, trond.myklebust@fys.uio.no Return-path: Received: from sc8-sf-mx2-b.sourceforge.net ([10.3.1.92] helo=mail.sourceforge.net) by sc8-sf-list2-new.sourceforge.net with esmtp (Exim 4.43) id 1GYSTP-0003rR-3Q for nfs@lists.sourceforge.net; Fri, 13 Oct 2006 12:13:35 -0700 Received: from ug-out-1314.google.com ([66.249.92.171]) by mail.sourceforge.net with esmtp (Exim 4.44) id 1GYSTP-0001vv-Bi for nfs@lists.sourceforge.net; Fri, 13 Oct 2006 12:13:35 -0700 Received: by ug-out-1314.google.com with SMTP id p27so484569ugc for ; Fri, 13 Oct 2006 12:13:34 -0700 (PDT) To: "Christoph Hellwig" In-Reply-To: <20061013072516.GA13531@infradead.org> List-Id: "Discussion of NFS under Linux development, interoperability, and testing." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: nfs-bounces@lists.sourceforge.net Errors-To: nfs-bounces@lists.sourceforge.net On 10/13/06, Christoph Hellwig wrote: > On Thu, Oct 12, 2006 at 05:15:23PM -0400, Chuck Lever wrote: > > Clean-up: eliminate xs_tcp_copy_data -- it's exactly the same logic as the > > common routine skb_read_bits. The UDP and TCP socket read code now share > > the same routine for copying data into an xdr_buf. > > Looks good, but skb_read_bits is a pretty bad name for a public function > in sunrpc code. OK... the name is historical, but can easily be changed. But see below. > > diff --git a/net/sunrpc/socklib.c b/net/sunrpc/socklib.c > > index 6f17527..9d20136 100644 > > --- a/net/sunrpc/socklib.c > > +++ b/net/sunrpc/socklib.c > > @@ -24,16 +24,17 @@ #include > > * Possibly called several times to iterate over an sk_buff and copy > > * data out of it. > > */ > > -static size_t skb_read_bits(skb_reader_t *desc, void *to, size_t len) > > +size_t skb_read_bits(skb_reader_t *desc, void *to, size_t len) > > { > > if (len > desc->count) > > len = desc->count; > > - if (skb_copy_bits(desc->skb, desc->offset, to, len)) > > + if (unlikely(skb_copy_bits(desc->skb, desc->offset, to, len))) > > return 0; > > desc->count -= len; > > desc->offset += len; > > return len; > > } > > But given that this code doesn't contain any sunrpc specifics it could > as well move to net/core/skbuff.c That sounds OK. I can also adopt whatever EXPORT_SYMBOL convention is used there (to address Trond's question about EXPORT_SYMBOL_GPL). -- "We who cut mere stones must always be envisioning cathedrals" -- Quarry worker's creed ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ NFS maillist - NFS@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nfs