public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [2.6 patch] net/sunrpc/xdr.c: remove xdr_decode_string()
  2005-10-06 14:13 [NFS] [RFC: 2.6 patch] net/sunrpc/: possible cleanups Lever, Charles
@ 2005-11-23  1:24 ` Adrian Bunk
  0 siblings, 0 replies; 6+ messages in thread
From: Adrian Bunk @ 2005-11-23  1:24 UTC (permalink / raw)
  To: Lever, Charles
  Cc: David Miller, neilb, trond.myklebust, linux-kernel, nfs, netdev

On Thu, Oct 06, 2005 at 07:13:14AM -0700, Lever, Charles wrote:

> actually, can we hold off on this change?  the RPC transport switch will
> eventually need most of those EXPORT_SYMBOLs.

Am I right to assume this will happen in the foreseeable future?

> the only harmless change i see below is removing xdr_decode_string(). 

Patch below.

cu
Adrian


<--  snip  -->


This patch removes ths unused function xdr_decode_string().


Signed-off-by: Adrian Bunk <bunk@stusta.de>

---

 include/linux/sunrpc/xdr.h |    1 -
 net/sunrpc/sunrpc_syms.c   |    1 -
 net/sunrpc/xdr.c           |   21 ---------------------
 3 files changed, 23 deletions(-)

--- linux-2.6.15-rc1-mm2-full/include/linux/sunrpc/xdr.h.old	2005-11-23 02:03:01.000000000 +0100
+++ linux-2.6.15-rc1-mm2-full/include/linux/sunrpc/xdr.h	2005-11-23 02:03:08.000000000 +0100
@@ -91,7 +91,6 @@
 u32 *	xdr_encode_opaque_fixed(u32 *p, const void *ptr, unsigned int len);
 u32 *	xdr_encode_opaque(u32 *p, const void *ptr, unsigned int len);
 u32 *	xdr_encode_string(u32 *p, const char *s);
-u32 *	xdr_decode_string(u32 *p, char **sp, int *lenp, int maxlen);
 u32 *	xdr_decode_string_inplace(u32 *p, char **sp, int *lenp, int maxlen);
 u32 *	xdr_encode_netobj(u32 *p, const struct xdr_netobj *);
 u32 *	xdr_decode_netobj(u32 *p, struct xdr_netobj *);
--- linux-2.6.15-rc1-mm2-full/net/sunrpc/xdr.c.old	2005-11-23 02:03:17.000000000 +0100
+++ linux-2.6.15-rc1-mm2-full/net/sunrpc/xdr.c	2005-11-23 02:03:27.000000000 +0100
@@ -93,27 +93,6 @@
 }
 
 u32 *
-xdr_decode_string(u32 *p, char **sp, int *lenp, int maxlen)
-{
-	unsigned int	len;
-	char		*string;
-
-	if ((len = ntohl(*p++)) > maxlen)
-		return NULL;
-	if (lenp)
-		*lenp = len;
-	if ((len % 4) != 0) {
-		string = (char *) p;
-	} else {
-		string = (char *) (p - 1);
-		memmove(string, p, len);
-	}
-	string[len] = '\0';
-	*sp = string;
-	return p + XDR_QUADLEN(len);
-}
-
-u32 *
 xdr_decode_string_inplace(u32 *p, char **sp, int *lenp, int maxlen)
 {
 	unsigned int	len;
--- linux-2.6.15-rc1-mm2-full/net/sunrpc/sunrpc_syms.c.old	2005-11-23 02:03:35.000000000 +0100
+++ linux-2.6.15-rc1-mm2-full/net/sunrpc/sunrpc_syms.c	2005-11-23 02:03:38.000000000 +0100
@@ -120,7 +120,6 @@
 
 /* Generic XDR */
 EXPORT_SYMBOL(xdr_encode_string);
-EXPORT_SYMBOL(xdr_decode_string);
 EXPORT_SYMBOL(xdr_decode_string_inplace);
 EXPORT_SYMBOL(xdr_decode_netobj);
 EXPORT_SYMBOL(xdr_encode_netobj);


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

* RE: [2.6 patch] net/sunrpc/xdr.c: remove xdr_decode_string()
@ 2005-11-23 12:31 Lever, Charles
  2005-11-23 16:25 ` Adrian Bunk
  0 siblings, 1 reply; 6+ messages in thread
From: Lever, Charles @ 2005-11-23 12:31 UTC (permalink / raw)
  To: Adrian Bunk
  Cc: David Miller, neilb, trond.myklebust, linux-kernel, nfs, netdev

> On Thu, Oct 06, 2005 at 07:13:14AM -0700, Lever, Charles wrote:
> 
> > actually, can we hold off on this change?  the RPC 
> transport switch will
> > eventually need most of those EXPORT_SYMBOLs.
> 
> Am I right to assume this will happen in the foreseeable future?

the first portion of the transport switch is in 2.6.15-rcX.  at this
point i'm expecting the EXPORT_SYMBOL changes to go in 2.6.17 or later.

so i don't remember why you are removing xdr_decode_string.  are we sure
that no-one will need this functionality in the future?  it is harmless
to remove today, but i wonder if someone is just going to add it back
sometime.

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

* Re: [2.6 patch] net/sunrpc/xdr.c: remove xdr_decode_string()
  2005-11-23 12:31 Lever, Charles
@ 2005-11-23 16:25 ` Adrian Bunk
  2005-11-23 23:07   ` Neil Brown
  0 siblings, 1 reply; 6+ messages in thread
From: Adrian Bunk @ 2005-11-23 16:25 UTC (permalink / raw)
  To: Lever, Charles
  Cc: David Miller, neilb, trond.myklebust, linux-kernel, nfs, netdev

On Wed, Nov 23, 2005 at 04:31:14AM -0800, Lever, Charles wrote:
> > On Thu, Oct 06, 2005 at 07:13:14AM -0700, Lever, Charles wrote:
> > 
> > > actually, can we hold off on this change?  the RPC 
> > transport switch will
> > > eventually need most of those EXPORT_SYMBOLs.
> > 
> > Am I right to assume this will happen in the foreseeable future?
> 
> the first portion of the transport switch is in 2.6.15-rcX.  at this
> point i'm expecting the EXPORT_SYMBOL changes to go in 2.6.17 or later.

OK.

> so i don't remember why you are removing xdr_decode_string.  are we sure
> that no-one will need this functionality in the future?  it is harmless
> to remove today, but i wonder if someone is just going to add it back
> sometime.

It's unused and you said:
  the only harmless change i see below is removing xdr_decode_string().

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


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

* Re: [2.6 patch] net/sunrpc/xdr.c: remove xdr_decode_string()
  2005-11-23 16:25 ` Adrian Bunk
@ 2005-11-23 23:07   ` Neil Brown
  0 siblings, 0 replies; 6+ messages in thread
From: Neil Brown @ 2005-11-23 23:07 UTC (permalink / raw)
  To: Adrian Bunk
  Cc: Lever, Charles, David Miller, trond.myklebust, linux-kernel, nfs,
	netdev

On Wednesday November 23, bunk@stusta.de wrote:
> On Wed, Nov 23, 2005 at 04:31:14AM -0800, Lever, Charles wrote:
> > so i don't remember why you are removing xdr_decode_string.  are we sure
> > that no-one will need this functionality in the future?  it is harmless
> > to remove today, but i wonder if someone is just going to add it back
> > sometime.
> 
> It's unused and you said:
>   the only harmless change i see below is removing xdr_decode_string().
> 

As 'xdr_decode_string' (sometimes) modifies the buffer that it is
decoding, I don't think it's usage should be encouraged.  If it is no
longer in use, then I fully support and encourage removing it.

NeilBrown

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

* RE: [2.6 patch] net/sunrpc/xdr.c: remove xdr_decode_string()
@ 2005-11-24  6:56 Lever, Charles
  0 siblings, 0 replies; 6+ messages in thread
From: Lever, Charles @ 2005-11-24  6:56 UTC (permalink / raw)
  To: Neil Brown, Adrian Bunk
  Cc: David Miller, trond.myklebust, linux-kernel, nfs, netdev

> On Wednesday November 23, bunk@stusta.de wrote:
> > On Wed, Nov 23, 2005 at 04:31:14AM -0800, Lever, Charles wrote:
> > > so i don't remember why you are removing 
> xdr_decode_string.  are we sure
> > > that no-one will need this functionality in the future?  
> it is harmless
> > > to remove today, but i wonder if someone is just going to 
> add it back
> > > sometime.
> > 
> > It's unused and you said:
> >   the only harmless change i see below is removing 
> xdr_decode_string().
> > 
> 
> As 'xdr_decode_string' (sometimes) modifies the buffer that it is
> decoding, I don't think it's usage should be encouraged.  If it is no
> longer in use, then I fully support and encourage removing it.

actually this is a good point.  since it is unused, it is an untested
path as we continue to evolve the code base.

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

* [2.6 patch] net/sunrpc/xdr.c: remove xdr_decode_string()
@ 2005-12-14 21:10 Adrian Bunk
  0 siblings, 0 replies; 6+ messages in thread
From: Adrian Bunk @ 2005-12-14 21:10 UTC (permalink / raw)
  To: neilb, trond.myklebust; +Cc: linux-kernel, nfs, Charles Lever, netdev

This patch removes ths unused function xdr_decode_string().


Signed-off-by: Adrian Bunk <bunk@stusta.de>
Acked-by: Neil Brown <neilb@suse.de>
Acked-by: Charles Lever <Charles.Lever@netapp.com>

---

 include/linux/sunrpc/xdr.h |    1 -
 net/sunrpc/xdr.c           |   21 ---------------------
 2 files changed, 22 deletions(-)

--- linux-2.6.15-rc1-mm2-full/include/linux/sunrpc/xdr.h.old	2005-11-23 02:03:01.000000000 +0100
+++ linux-2.6.15-rc1-mm2-full/include/linux/sunrpc/xdr.h	2005-11-23 02:03:08.000000000 +0100
@@ -91,7 +91,6 @@
 u32 *	xdr_encode_opaque_fixed(u32 *p, const void *ptr, unsigned int len);
 u32 *	xdr_encode_opaque(u32 *p, const void *ptr, unsigned int len);
 u32 *	xdr_encode_string(u32 *p, const char *s);
-u32 *	xdr_decode_string(u32 *p, char **sp, int *lenp, int maxlen);
 u32 *	xdr_decode_string_inplace(u32 *p, char **sp, int *lenp, int maxlen);
 u32 *	xdr_encode_netobj(u32 *p, const struct xdr_netobj *);
 u32 *	xdr_decode_netobj(u32 *p, struct xdr_netobj *);
--- linux-2.6.15-rc1-mm2-full/net/sunrpc/xdr.c.old	2005-11-23 02:03:17.000000000 +0100
+++ linux-2.6.15-rc1-mm2-full/net/sunrpc/xdr.c	2005-11-23 02:03:27.000000000 +0100
@@ -93,27 +93,6 @@
 }
 
 u32 *
-xdr_decode_string(u32 *p, char **sp, int *lenp, int maxlen)
-{
-	unsigned int	len;
-	char		*string;
-
-	if ((len = ntohl(*p++)) > maxlen)
-		return NULL;
-	if (lenp)
-		*lenp = len;
-	if ((len % 4) != 0) {
-		string = (char *) p;
-	} else {
-		string = (char *) (p - 1);
-		memmove(string, p, len);
-	}
-	string[len] = '\0';
-	*sp = string;
-	return p + XDR_QUADLEN(len);
-}
-
-u32 *
 xdr_decode_string_inplace(u32 *p, char **sp, int *lenp, int maxlen)
 {
 	unsigned int	len;


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

end of thread, other threads:[~2005-12-14 21:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-14 21:10 [2.6 patch] net/sunrpc/xdr.c: remove xdr_decode_string() Adrian Bunk
  -- strict thread matches above, loose matches on Subject: below --
2005-11-24  6:56 Lever, Charles
2005-11-23 12:31 Lever, Charles
2005-11-23 16:25 ` Adrian Bunk
2005-11-23 23:07   ` Neil Brown
2005-10-06 14:13 [NFS] [RFC: 2.6 patch] net/sunrpc/: possible cleanups Lever, Charles
2005-11-23  1:24 ` [2.6 patch] net/sunrpc/xdr.c: remove xdr_decode_string() Adrian Bunk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox