All of lore.kernel.org
 help / color / mirror / Atom feed
From: Akinobu Mita <akinobu.mita@gmail.com>
To: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: akpm@linux-foundation.org, linux-scsi@vger.kernel.org,
	andrew.vasquez@qlogic.com, linux-driver@qlogic.com,
	seokmann.ju@qlogic.com, linux-kernel@vger.kernel.org
Subject: [PATCH] move memory_read_from_buffer() from fs.h to string.h
Date: Sat, 5 Jul 2008 01:39:43 +0900	[thread overview]
Message-ID: <20080704163942.GA15214@localhost.localdomain> (raw)
In-Reply-To: <1215182555.5413.8.camel@localhost.localdomain>

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@gmail.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@gmail.com>
Cc: James Bottomley <James.Bottomley@hansenpartnership.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Zhang Rui <rui.zhang@intel.com>
Cc: Bob Moore <robert.moore@intel.com>
Cc: Thomas Renninger <trenn@suse.de>
Cc: Len Brown <lenb@kernel.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"
 

  reply	other threads:[~2008-07-04 16:39 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-04  6:47 [patch 14/16] qla2xxx: use memory_read_from_buffer() akpm
2008-07-04 14:42 ` James Bottomley
2008-07-04 16:39   ` Akinobu Mita [this message]
2008-07-04 16:48     ` [PATCH -mm] fix s390-use-memory_read_from_buffer.patch Akinobu Mita
2008-07-04 16:51     ` [PATCH -mm] fix s390-cio-use-memory_read_from_buffer.patch Akinobu Mita
2008-07-04 16:53     ` [PATCH -mm] fix qla2xxx-use-memory_read_from_buffer.patch Akinobu Mita
2008-07-04 16:54     ` [PATCH -mm] fix ipr-use-memory_read_from_buffer.patch Akinobu Mita
2008-07-04 17:05       ` James Bottomley
2008-07-04 17:18         ` Akinobu Mita
2008-07-04 16:55     ` [PATCH -mm] fix dcdbas-use-memory_read_from_buffer.patch Akinobu Mita
2008-07-04 16:57     ` [PATCH -mm] fix aty-use-memory_read_from_buffer.patch Akinobu Mita
2008-07-04 16:58     ` [PATCH -mm] fix firmware-use-memory_read_from_buffer.patch Akinobu Mita
2008-07-04 17:00     ` [PATCH -mm] fix dell_rbu-use-memory_read_from_buffer.patch Akinobu Mita

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080704163942.GA15214@localhost.localdomain \
    --to=akinobu.mita@gmail.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=akpm@linux-foundation.org \
    --cc=andrew.vasquez@qlogic.com \
    --cc=linux-driver@qlogic.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=seokmann.ju@qlogic.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.