[tip:tracing/kmemtrace] fs.h: uninline simple_transaction_set()

From: Ingo Molnar
Date: Wed Mar 25 2009 - 13:31:31 EST


Commit-ID: 1a6ad03119ce01dd862b089b8b2d9d3848453b11
Gitweb: http://git.kernel.org/tip/1a6ad03119ce01dd862b089b8b2d9d3848453b11
Author: Ingo Molnar <mingo@xxxxxxx>
AuthorDate: Wed, 25 Mar 2009 16:48:35 +0100
Committer: Ingo Molnar <mingo@xxxxxxx>
CommitDate: Wed, 25 Mar 2009 18:27:56 +0100

fs.h: uninline simple_transaction_set()

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

This removes an implicit asm/page.h PAGE_SIZE dependency from
fs.h (asm/page.h is not an exported header so HEADERS_CHECK fils),
and also reduces kernel size a bit.

Cc: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
Cc: Alexey Dobriyan <adobriyan@xxxxxxxxx>
Cc: Pekka Enberg <penberg@xxxxxxxxxxxxxx>
Cc: Eduard - Gabriel Munteanu <eduard.munteanu@xxxxxxxxxxx>
Cc: paulmck@xxxxxxxxxxxxxxxxxx
LKML-Reference: <1237898630.25315.83.camel@penberg-laptop>
Signed-off-by: Ingo Molnar <mingo@xxxxxxx>


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

diff --git a/fs/libfs.c b/fs/libfs.c
index 49b4409..c872c64 100644
--- a/fs/libfs.c
+++ b/fs/libfs.c
@@ -574,6 +574,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;
@@ -819,6 +834,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 79be937..2ebe3ce 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -9,8 +9,6 @@
#include <linux/limits.h>
#include <linux/ioctl.h>

-#include <asm/page.h> /* for PAGE_SIZE */
-
/*
* It's silly to have NR_OPEN bigger than NR_FILE, but you can change
* the file limit at runtime and only root can increase the per-process
@@ -2173,19 +2171,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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/