lkml.org 
[lkml]   [2006]   [Apr]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [RFC: 2.6 patch] fs/read_write.c: unexport iov_shorten
From
Date
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

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-04-27 20:54    [W:0.036 / U:0.748 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site