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  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Date:	Fri, 3 Apr 2009 10:34:22 GMT
From:	Ingo Molnar <mingo@...e.hu>
To:	linux-tip-commits@...r.kernel.org
Cc:	linux-kernel@...r.kernel.org, hpa@...or.com, mingo@...hat.com,
	penberg@...helsinki.fi, eduard.munteanu@...ux360.ro,
	viro@...iv.linux.org.uk, tglx@...utronix.de, mingo@...e.hu,
	adobriyan@...il.com
Subject: [tip:tracing/kmemtrace-v2] kmemtrace, fs: uninline simple_transaction_set()

Commit-ID:  76791ab2d5e00c1eef728a8df4347ba133760fb8
Gitweb:     http://git.kernel.org/tip/76791ab2d5e00c1eef728a8df4347ba133760fb8
Author:     Ingo Molnar <mingo@...e.hu>
AuthorDate: Wed, 25 Mar 2009 16:48:35 +0100
Committer:  Ingo Molnar <mingo@...e.hu>
CommitDate: Fri, 3 Apr 2009 12:09:09 +0200

kmemtrace, fs: uninline simple_transaction_set()

Impact: cleanup

We want to remove percpu.h from rcupdate.h (for upcoming kmemtrace
changes), but this is not possible currently without breaking the
build because fs.h has an implicit include file depedency: it
uses PAGE_SIZE but does not include asm/page.h which defines it.

This problem gets masked in practice because most fs.h using sites
use rcupreempt.h (and other headers) which includes percpu.h which
brings in asm/page.h indirectly.

We cannot add asm/page.h to asm/fs.h because page.h is not an
exported header.

Move simple_transaction_set() to the other simple-transaction
file helpers in fs/libfs.c.

This removes the include file hell and also reduces
kernel size a bit.

Acked-by: Al Viro <viro@...iv.linux.org.uk>
Cc: Alexey Dobriyan <adobriyan@...il.com>
Cc: Pekka Enberg <penberg@...helsinki.fi>
Cc: Eduard - Gabriel Munteanu <eduard.munteanu@...ux360.ro>
Cc: paulmck@...ux.vnet.ibm.com
LKML-Reference: <1237898630.25315.83.camel@...berg-laptop>
Signed-off-by: Ingo Molnar <mingo@...e.hu>


---
 fs/libfs.c         |   16 ++++++++++++++++
 include/linux/fs.h |   14 +-------------
 2 files changed, 17 insertions(+), 13 deletions(-)

diff --git a/fs/libfs.c b/fs/libfs.c
index 4910a36..cd22319 100644
--- a/fs/libfs.c
+++ b/fs/libfs.c
@@ -575,6 +575,21 @@ ssize_t memory_read_from_buffer(void *to, size_t count, loff_t *ppos,
  * possibly a read which collects the result - which is stored in a
  * file-local buffer.
  */
+
+void simple_transaction_set(struct file *file, size_t n)
+{
+	struct simple_transaction_argresp *ar = file->private_data;
+
+	BUG_ON(n > SIMPLE_TRANSACTION_LIMIT);
+
+	/*
+	 * The barrier ensures that ar->size will really remain zero until
+	 * ar->data is ready for reading.
+	 */
+	smp_mb();
+	ar->size = n;
+}
+
 char *simple_transaction_get(struct file *file, const char __user *buf, size_t size)
 {
 	struct simple_transaction_argresp *ar;
@@ -820,6 +835,7 @@ EXPORT_SYMBOL(simple_sync_file);
 EXPORT_SYMBOL(simple_unlink);
 EXPORT_SYMBOL(simple_read_from_buffer);
 EXPORT_SYMBOL(memory_read_from_buffer);
+EXPORT_SYMBOL(simple_transaction_set);
 EXPORT_SYMBOL(simple_transaction_get);
 EXPORT_SYMBOL(simple_transaction_read);
 EXPORT_SYMBOL(simple_transaction_release);
diff --git a/include/linux/fs.h b/include/linux/fs.h
index fc4dc28..e4de2b5 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2323,19 +2323,7 @@ ssize_t simple_transaction_read(struct file *file, char __user *buf,
 				size_t size, loff_t *pos);
 int simple_transaction_release(struct inode *inode, struct file *file);
 
-static inline void simple_transaction_set(struct file *file, size_t n)
-{
-	struct simple_transaction_argresp *ar = file->private_data;
-
-	BUG_ON(n > SIMPLE_TRANSACTION_LIMIT);
-
-	/*
-	 * The barrier ensures that ar->size will really remain zero until
-	 * ar->data is ready for reading.
-	 */
-	smp_mb();
-	ar->size = n;
-}
+void simple_transaction_set(struct file *file, size_t n);
 
 /*
  * simple attribute files
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ