public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC: 2.6 patch] fs/read_write.c: unexport iov_shorten
@ 2006-04-23 21:22 Adrian Bunk
  0 siblings, 0 replies; 7+ messages in thread
From: Adrian Bunk @ 2006-04-23 21:22 UTC (permalink / raw)
  To: linux-kernel

This patch removes the unused EXPORT_SYMBOL(iov_shorten).

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

--- linux-2.6.17-rc1-mm3-full/fs/read_write.c.old	2006-04-23 15:51:52.000000000 +0200
+++ linux-2.6.17-rc1-mm3-full/fs/read_write.c	2006-04-23 15:52:02.000000000 +0200
@@ -436,8 +436,6 @@
 	return seg;
 }
 
-EXPORT_SYMBOL(iov_shorten);
-
 /* A write operation does a read from user space and vice versa */
 #define vrfy_dir(type) ((type) == READ ? VERIFY_WRITE : VERIFY_READ)
 


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

* [RFC: 2.6 patch] fs/read_write.c: unexport iov_shorten
@ 2006-04-27 18:03 Adrian Bunk
  2006-04-27 18:36 ` Badari Pulavarty
  2006-04-27 18:52 ` Badari Pulavarty
  0 siblings, 2 replies; 7+ messages in thread
From: Adrian Bunk @ 2006-04-27 18:03 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

This patch removes the unused EXPORT_SYMBOL(iov_shorten).

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

---

This patch was already sent on:
- 23 Apr 2006

--- linux-2.6.17-rc1-mm3-full/fs/read_write.c.old	2006-04-23 15:51:52.000000000 +0200
+++ linux-2.6.17-rc1-mm3-full/fs/read_write.c	2006-04-23 15:52:02.000000000 +0200
@@ -436,8 +436,6 @@
 	return seg;
 }
 
-EXPORT_SYMBOL(iov_shorten);
-
 /* A write operation does a read from user space and vice versa */
 #define vrfy_dir(type) ((type) == READ ? VERIFY_WRITE : VERIFY_READ)
 


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

* Re: [RFC: 2.6 patch] fs/read_write.c: unexport iov_shorten
  2006-04-27 18:03 Adrian Bunk
@ 2006-04-27 18:36 ` Badari Pulavarty
  2006-04-27 18:52 ` Badari Pulavarty
  1 sibling, 0 replies; 7+ messages in thread
From: Badari Pulavarty @ 2006-04-27 18:36 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: Andrew Morton, lkml

On Thu, 2006-04-27 at 20:03 +0200, Adrian Bunk wrote:
> This patch removes the unused EXPORT_SYMBOL(iov_shorten).
> 
> Signed-off-by: Adrian Bunk <bunk@stusta.de>
> 
> ---
> 
> This patch was already sent on:
> - 23 Apr 2006
> 
> --- linux-2.6.17-rc1-mm3-full/fs/read_write.c.old	2006-04-23 15:51:52.000000000 +0200
> +++ linux-2.6.17-rc1-mm3-full/fs/read_write.c	2006-04-23 15:52:02.000000000 +0200
> @@ -436,8 +436,6 @@
>  	return seg;
>  }
>  
> -EXPORT_SYMBOL(iov_shorten);
> -
>  /* A write operation does a read from user space and vice versa */
>  #define vrfy_dir(type) ((type) == READ ? VERIFY_WRITE : VERIFY_READ)

While you are at it, why not move iov_shorten() to only file its
currently used from filemap.c, make it static and take it out from
uio.h ? (filemap.c may not be the right place for it, but ..)

Thanks,
Badari


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

* Re: [RFC: 2.6 patch] fs/read_write.c: unexport iov_shorten
  2006-04-27 18:03 Adrian Bunk
  2006-04-27 18:36 ` Badari Pulavarty
@ 2006-04-27 18:52 ` Badari Pulavarty
  2006-04-27 18:59   ` Arjan van de Ven
  1 sibling, 1 reply; 7+ messages in thread
From: Badari Pulavarty @ 2006-04-27 18:52 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: Andrew Morton, lkml

On Thu, 2006-04-27 at 20:03 +0200, Adrian Bunk wrote:
> This patch removes the unused EXPORT_SYMBOL(iov_shorten).
> 
> Signed-off-by: Adrian Bunk <bunk@stusta.de>
> 
> ---
> 
> This patch was already sent on:
> - 23 Apr 2006
> 
> --- linux-2.6.17-rc1-mm3-full/fs/read_write.c.old	2006-04-23 15:51:52.000000000 +0200
> +++ linux-2.6.17-rc1-mm3-full/fs/read_write.c	2006-04-23 15:52:02.000000000 +0200
> @@ -436,8 +436,6 @@
>  	return seg;
>  }
>  
> -EXPORT_SYMBOL(iov_shorten);
> -
>  /* A write operation does a read from user space and vice versa */
>  #define vrfy_dir(type) ((type) == READ ? VERIFY_WRITE : VERIFY_READ)
>  

How about this ? Wondering if we need to make this "inline" also (since
its used only in one place).

Thanks,
Badari

Signed-off-by: Badari Pulavarty <pbadari@us.ibm.com>

 fs/read_write.c     |   22 ----------------------
 include/linux/uio.h |   22 +++++++++++++++++++++-
 2 files changed, 21 insertions(+), 23 deletions(-)

Index: linux-2.6.17-rc2/fs/read_write.c
===================================================================
--- linux-2.6.17-rc2.orig/fs/read_write.c	2006-04-18 20:00:49.000000000 -0700
+++ linux-2.6.17-rc2/fs/read_write.c	2006-04-27 11:57:05.000000000 -0700
@@ -416,28 +416,6 @@ asmlinkage ssize_t sys_pwrite64(unsigned
 	return ret;
 }
 
-/*
- * Reduce an iovec's length in-place.  Return the resulting number of segments
- */
-unsigned long iov_shorten(struct iovec *iov, unsigned long nr_segs, size_t to)
-{
-	unsigned long seg = 0;
-	size_t len = 0;
-
-	while (seg < nr_segs) {
-		seg++;
-		if (len + iov->iov_len >= to) {
-			iov->iov_len = to - len;
-			break;
-		}
-		len += iov->iov_len;
-		iov++;
-	}
-	return seg;
-}
-
-EXPORT_SYMBOL(iov_shorten);
-
 /* A write operation does a read from user space and vice versa */
 #define vrfy_dir(type) ((type) == READ ? VERIFY_WRITE : VERIFY_READ)
 
Index: linux-2.6.17-rc2/include/linux/uio.h
===================================================================
--- linux-2.6.17-rc2.orig/include/linux/uio.h	2006-04-18 20:00:49.000000000 -0700
+++ linux-2.6.17-rc2/include/linux/uio.h	2006-04-27 11:57:27.000000000 -0700
@@ -61,6 +61,26 @@ static inline size_t iov_length(const st
 	return ret;
 }
 
-unsigned long iov_shorten(struct iovec *iov, unsigned long nr_segs, size_t to);
+
+/*
+ * Reduce an iovec's length in-place.  Return the resulting number of segments
+ */
+static
+unsigned long iov_shorten(struct iovec *iov, unsigned long nr_segs, size_t to)
+{
+	unsigned long seg = 0;
+	size_t len = 0;
+
+	while (seg < nr_segs) {
+		seg++;
+		if (len + iov->iov_len >= to) {
+			iov->iov_len = to - len;
+			break;
+		}
+		len += iov->iov_len;
+		iov++;
+	}
+	return seg;
+}
 
 #endif



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

* Re: [RFC: 2.6 patch] fs/read_write.c: unexport iov_shorten
  2006-04-27 18:52 ` Badari Pulavarty
@ 2006-04-27 18:59   ` Arjan van de Ven
  0 siblings, 0 replies; 7+ messages in thread
From: Arjan van de Ven @ 2006-04-27 18:59 UTC (permalink / raw)
  To: Badari Pulavarty; +Cc: Adrian Bunk, Andrew Morton, lkml

On Thu, 2006-04-27 at 11:52 -0700, Badari Pulavarty wrote:
> On Thu, 2006-04-27 at 20:03 +0200, Adrian Bunk wrote:
> > This patch removes the unused EXPORT_SYMBOL(iov_shorten).
> > 
> > Signed-off-by: Adrian Bunk <bunk@stusta.de>
> > 
> > ---
> > 
> > This patch was already sent on:
> > - 23 Apr 2006
> > 
> > --- linux-2.6.17-rc1-mm3-full/fs/read_write.c.old	2006-04-23 15:51:52.000000000 +0200
> > +++ linux-2.6.17-rc1-mm3-full/fs/read_write.c	2006-04-23 15:52:02.000000000 +0200
> > @@ -436,8 +436,6 @@
> >  	return seg;
> >  }
> >  
> > -EXPORT_SYMBOL(iov_shorten);
> > -
> >  /* A write operation does a read from user space and vice versa */
> >  #define vrfy_dir(type) ((type) == READ ? VERIFY_WRITE : VERIFY_READ)
> >  
> 
> How about this ? Wondering if we need to make this "inline" also (since
> its used only in one place).


no real need; if it's static modern gcc will inline it anyway


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

* [RFC: 2.6 patch] fs/read_write.c: unexport iov_shorten
@ 2006-06-25 23:39 Adrian Bunk
  0 siblings, 0 replies; 7+ messages in thread
From: Adrian Bunk @ 2006-06-25 23:39 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

This patch removes the unused EXPORT_SYMBOL(iov_shorten).

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

---

This patch was already sent on:
- 27 Apr 2006
- 23 Apr 2006

--- linux-2.6.17-rc1-mm3-full/fs/read_write.c.old	2006-04-23 15:51:52.000000000 +0200
+++ linux-2.6.17-rc1-mm3-full/fs/read_write.c	2006-04-23 15:52:02.000000000 +0200
@@ -436,8 +436,6 @@
 	return seg;
 }
 
-EXPORT_SYMBOL(iov_shorten);
-
 /* A write operation does a read from user space and vice versa */
 #define vrfy_dir(type) ((type) == READ ? VERIFY_WRITE : VERIFY_READ)
 


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

* [RFC: 2.6 patch] fs/read_write.c: unexport iov_shorten
@ 2006-06-29 19:21 Adrian Bunk
  0 siblings, 0 replies; 7+ messages in thread
From: Adrian Bunk @ 2006-06-29 19:21 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

This patch removes the unused EXPORT_SYMBOL(iov_shorten).

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

---

@Andrew:
If anyone is considered maintainer of this code, please tell me who it 
is so that I can send this patch to him instead of you.

This patch was already sent on:
- 26 Jun 2006
- 27 Apr 2006
- 23 Apr 2006

--- linux-2.6.17-rc1-mm3-full/fs/read_write.c.old	2006-04-23 15:51:52.000000000 +0200
+++ linux-2.6.17-rc1-mm3-full/fs/read_write.c	2006-04-23 15:52:02.000000000 +0200
@@ -436,8 +436,6 @@
 	return seg;
 }
 
-EXPORT_SYMBOL(iov_shorten);
-
 /* A write operation does a read from user space and vice versa */
 #define vrfy_dir(type) ((type) == READ ? VERIFY_WRITE : VERIFY_READ)
 


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

end of thread, other threads:[~2006-06-29 19:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-25 23:39 [RFC: 2.6 patch] fs/read_write.c: unexport iov_shorten Adrian Bunk
  -- strict thread matches above, loose matches on Subject: below --
2006-06-29 19:21 Adrian Bunk
2006-04-27 18:03 Adrian Bunk
2006-04-27 18:36 ` Badari Pulavarty
2006-04-27 18:52 ` Badari Pulavarty
2006-04-27 18:59   ` Arjan van de Ven
2006-04-23 21:22 Adrian Bunk

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