From: Mikulas Patocka <mpatocka@redhat.com>
To: linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org
Cc: davem@davemloft.net
Subject: [8/10 PATCH] inline filemap_fdatawrite
Date: Tue, 24 Jun 2008 02:01:04 -0400 (EDT) [thread overview]
Message-ID: <Pine.LNX.4.64.0806240159520.27784@engineering.redhat.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0806240154140.27784@engineering.redhat.com>
Make filemap_fdatawrite and filemap_flush calls inlined.
This needs to move WB_SYNC_* definitions from writeback.h to fs.h.
writeback.h requires fs.h, so it creates no problem.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Index: linux-2.6.26-rc7-devel/include/linux/fs.h
===================================================================
--- linux-2.6.26-rc7-devel.orig/include/linux/fs.h 2008-06-24 07:28:06.000000000 +0200
+++ linux-2.6.26-rc7-devel/include/linux/fs.h 2008-06-24 07:37:48.000000000 +0200
@@ -1731,8 +1731,6 @@
extern int invalidate_inode_pages2_range(struct address_space *mapping,
pgoff_t start, pgoff_t end);
extern int write_inode_now(struct inode *, int);
-extern int filemap_fdatawrite(struct address_space *);
-extern int filemap_flush(struct address_space *);
extern int filemap_fdatawait(struct address_space *);
extern int filemap_write_and_wait(struct address_space *mapping);
extern int filemap_write_and_wait_range(struct address_space *mapping,
@@ -1742,6 +1740,38 @@
extern int __filemap_fdatawrite_range(struct address_space *mapping,
loff_t start, loff_t end, int sync_mode);
+/*
+ * fs/fs-writeback.c
+ */
+enum writeback_sync_modes {
+ WB_SYNC_NONE, /* Don't wait on anything */
+ WB_SYNC_ALL, /* Wait on every mapping */
+ WB_SYNC_HOLD, /* Hold the inode on sb_dirty for sys_sync() */
+};
+
+static __always_inline int __filemap_fdatawrite(struct address_space *mapping,
+ int sync_mode)
+{
+ return __filemap_fdatawrite_range(mapping, 0, LLONG_MAX, sync_mode);
+}
+
+static __always_inline int filemap_fdatawrite(struct address_space *mapping)
+{
+ return __filemap_fdatawrite(mapping, WB_SYNC_ALL);
+}
+
+/**
+ * filemap_flush - mostly a non-blocking flush
+ * @mapping: target address_space
+ *
+ * This is a mostly non-blocking flush. Not suitable for data-integrity
+ * purposes - I/O may not be started against all dirty pages.
+ */
+static __always_inline int filemap_flush(struct address_space *mapping)
+{
+ return __filemap_fdatawrite(mapping, WB_SYNC_NONE);
+}
+
extern long do_fsync(struct file *file, int datasync);
extern void sync_supers(void);
extern void sync_filesystems(int wait);
@@ -2000,7 +2030,10 @@
extern int simple_pin_fs(struct file_system_type *, struct vfsmount **mount, int *count);
extern void simple_release_fs(struct vfsmount **mount, int *count);
-extern ssize_t simple_read_from_buffer(void __user *, size_t, loff_t *, const void *, size_t);
+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: linux-2.6.26-rc7-devel/include/linux/writeback.h
===================================================================
--- linux-2.6.26-rc7-devel.orig/include/linux/writeback.h 2008-06-24 07:28:07.000000000 +0200
+++ linux-2.6.26-rc7-devel/include/linux/writeback.h 2008-06-24 07:37:49.000000000 +0200
@@ -25,15 +25,6 @@
#define current_is_pdflush() task_is_pdflush(current)
/*
- * fs/fs-writeback.c
- */
-enum writeback_sync_modes {
- WB_SYNC_NONE, /* Don't wait on anything */
- WB_SYNC_ALL, /* Wait on every mapping */
- WB_SYNC_HOLD, /* Hold the inode on sb_dirty for sys_sync() */
-};
-
-/*
* A control structure which tells the writeback code what to do. These are
* always on the stack, and hence need no locking. They are always initialised
* in a manner such that unspecified fields are set to zero.
Index: linux-2.6.26-rc7-devel/mm/filemap.c
===================================================================
--- linux-2.6.26-rc7-devel.orig/mm/filemap.c 2008-06-24 07:28:07.000000000 +0200
+++ linux-2.6.26-rc7-devel/mm/filemap.c 2008-06-24 07:37:49.000000000 +0200
@@ -223,39 +223,15 @@
ret = do_writepages(mapping, &wbc);
return ret;
}
+EXPORT_SYMBOL(__filemap_fdatawrite_range);
-static inline int __filemap_fdatawrite(struct address_space *mapping,
- int sync_mode)
-{
- return __filemap_fdatawrite_range(mapping, 0, LLONG_MAX, sync_mode);
-}
-
-int filemap_fdatawrite(struct address_space *mapping)
-{
- return __filemap_fdatawrite(mapping, WB_SYNC_ALL);
-}
-EXPORT_SYMBOL(filemap_fdatawrite);
-
-static int filemap_fdatawrite_range(struct address_space *mapping, loff_t start,
+static __always_inline int filemap_fdatawrite_range(struct address_space *mapping, loff_t start,
loff_t end)
{
return __filemap_fdatawrite_range(mapping, start, end, WB_SYNC_ALL);
}
/**
- * filemap_flush - mostly a non-blocking flush
- * @mapping: target address_space
- *
- * This is a mostly non-blocking flush. Not suitable for data-integrity
- * purposes - I/O may not be started against all dirty pages.
- */
-int filemap_flush(struct address_space *mapping)
-{
- return __filemap_fdatawrite(mapping, WB_SYNC_NONE);
-}
-EXPORT_SYMBOL(filemap_flush);
-
-/**
* wait_on_page_writeback_range - wait for writeback to complete
* @mapping: target address_space
* @start: beginning page index
next prev parent reply other threads:[~2008-06-24 6:01 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-24 5:54 [10 PATCHES] inline functions to avoid stack overflow Mikulas Patocka
2008-06-24 5:55 ` [1/10 PATCH] inline __queue_work Mikulas Patocka
2008-06-24 5:56 ` [2/10 PATCH] inline inline-generic_writepages.patch Mikulas Patocka
2008-06-24 5:57 ` [3/10 PATCH] inline wake_up_bit Mikulas Patocka
2008-06-25 14:17 ` Denys Vlasenko
2008-06-25 14:36 ` Mikulas Patocka
2008-06-25 15:24 ` Denys Vlasenko
2008-06-25 16:01 ` Mikulas Patocka
2008-06-25 20:37 ` Denys Vlasenko
2008-06-26 0:28 ` David Miller
2008-06-26 3:35 ` Denys Vlasenko
2008-06-26 4:18 ` David Miller
2008-06-26 18:22 ` Pavel Machek
2008-06-25 22:23 ` David Miller
2008-06-25 22:30 ` David Miller
2008-06-24 5:57 ` [4/10 PATCH] inline __wake_up_bit Mikulas Patocka
2008-06-24 5:58 ` [5/10 PATCH] inline __wake_up Mikulas Patocka
2008-06-24 5:59 ` [6/10 PATCH] inline default_wake_function Mikulas Patocka
2008-06-24 5:59 ` [6/10 PATCH] inline autoremove_wake_function Mikulas Patocka
2008-06-24 6:01 ` Mikulas Patocka [this message]
2008-06-24 6:01 ` [9/10 PATCH] inline dm-kcopyd-inline-wake.patch Mikulas Patocka
2008-06-24 6:03 ` [10/10 PATCH] inline dispatch_job Mikulas Patocka
2008-06-24 6:06 ` [PATCH] limit irq nesting Mikulas Patocka
2008-06-24 7:01 ` [10 PATCHES] inline functions to avoid stack overflow Ingo Molnar
[not found] ` <486216E7.8000002@aitel.hist.no>
2008-06-25 12:53 ` Mikulas Patocka
2008-06-25 22:09 ` David Miller
2008-06-26 6:32 ` Bart Van Assche
2008-06-26 9:06 ` David Miller
2008-07-02 4:39 ` Mikulas Patocka
2008-07-02 4:45 ` David Miller
2008-07-03 21:12 ` Mikulas Patocka
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=Pine.LNX.4.64.0806240159520.27784@engineering.redhat.com \
--to=mpatocka@redhat.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=sparclinux@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox