lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 5 Jul 2008 01:39:43 +0900
From:	Akinobu Mita <akinobu.mita@...il.com>
To:	James Bottomley <James.Bottomley@...senPartnership.com>
Cc:	akpm@...ux-foundation.org, linux-scsi@...r.kernel.org,
	andrew.vasquez@...gic.com, linux-driver@...gic.com,
	seokmann.ju@...gic.com, linux-kernel@...r.kernel.org
Subject: [PATCH] move memory_read_from_buffer() from fs.h to string.h

On Fri, Jul 04, 2008 at 09:42:35AM -0500, James Bottomley wrote:
> For such a micro optimisation, this is a pretty big price to pay.
> 
> Inclusion of linux/fs.h in a low level driver was always a danger signal
> usually it meant the driver was trying to access files or something at
> the very least it was a warning of a potential layering violation.  Now
> you're trying to make it standard practice ... I really don't like that.
> Surely a function that does memory to memory copies belongs either in
> string.h with the rest of our memory copies ... or in another header
> that would be a usual include for the potential users.

OK, I'll move it to linux/string.h

From: Akinobu Mita <akinobu.mita@...il.com>
Subject: [PATCH] move memory_read_from_buffer() from fs.h to string.h

James Bottomley warns that inclusion of linux/fs.h in a low level driver
was always a danger signal. This patch moves memory_read_from_buffer()
from fs.h to string.h and fixes includes in existing memory_read_from_buffer()
users.

Signed-off-by: Akinobu Mita <akinobu.mita@...il.com>
Cc: James Bottomley <James.Bottomley@...senpartnership.com>
Cc: Geert Uytterhoeven <geert@...ux-m68k.org>
Cc: Zhang Rui <rui.zhang@...el.com>
Cc: Bob Moore <robert.moore@...el.com>
Cc: Thomas Renninger <trenn@...e.de>
Cc: Len Brown <lenb@...nel.org>
---
 drivers/acpi/system.c       |    1 +
 drivers/zorro/zorro-sysfs.c |    1 -
 include/linux/fs.h          |    2 --
 include/linux/string.h      |    3 +++
 4 files changed, 4 insertions(+), 3 deletions(-)

Index: 2.6-mm/include/linux/fs.h
===================================================================
--- 2.6-mm.orig/include/linux/fs.h
+++ 2.6-mm/include/linux/fs.h
@@ -2026,8 +2026,6 @@ extern void simple_release_fs(struct vfs
 
 extern ssize_t simple_read_from_buffer(void __user *to, size_t count,
 			loff_t *ppos, const void *from, size_t available);
-extern ssize_t memory_read_from_buffer(void *to, size_t count, loff_t *ppos,
-			const void *from, size_t available);
 
 #ifdef CONFIG_MIGRATION
 extern int buffer_migrate_page(struct address_space *,
Index: 2.6-mm/include/linux/string.h
===================================================================
--- 2.6-mm.orig/include/linux/string.h
+++ 2.6-mm/include/linux/string.h
@@ -111,5 +111,8 @@ extern void argv_free(char **argv);
 
 extern bool sysfs_streq(const char *s1, const char *s2);
 
+extern ssize_t memory_read_from_buffer(void *to, size_t count, loff_t *ppos,
+			const void *from, size_t available);
+
 #endif
 #endif /* _LINUX_STRING_H_ */
Index: 2.6-mm/drivers/acpi/system.c
===================================================================
--- 2.6-mm.orig/drivers/acpi/system.c
+++ 2.6-mm/drivers/acpi/system.c
@@ -26,6 +26,7 @@
 #include <linux/proc_fs.h>
 #include <linux/seq_file.h>
 #include <linux/init.h>
+#include <linux/string.h>
 #include <asm/uaccess.h>
 
 #include <acpi/acpi_drivers.h>
Index: 2.6-mm/drivers/zorro/zorro-sysfs.c
===================================================================
--- 2.6-mm.orig/drivers/zorro/zorro-sysfs.c
+++ 2.6-mm/drivers/zorro/zorro-sysfs.c
@@ -15,7 +15,6 @@
 #include <linux/zorro.h>
 #include <linux/stat.h>
 #include <linux/string.h>
-#include <linux/fs.h>
 
 #include "zorro.h"
 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists