Let file systems to writeback their pages and inodes when needed. This
is needed for UBIFS budgeting sub-system because it has to force
write-back from time to time.
Note, it cannot be called if one of the dirty pages is locked by
the caller, otherwise it'll deadlock.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
---
fs/fs-writeback.c | 8 ++++++++
include/linux/writeback.h | 1 +
2 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index c007607..062aa4a 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -573,6 +573,14 @@ void sync_inodes_sb(struct super_block *sb, int wait)
spin_unlock(&inode_lock);
}
+void writeback_inodes_sb(struct super_block *sb, struct writeback_control *wbc)
+{
+ spin_lock(&inode_lock);
+ sync_sb_inodes(sb, wbc);
+ spin_unlock(&inode_lock);
+}
+EXPORT_SYMBOL_GPL(writeback_inodes_sb);
+
/*
* Rather lame livelock avoidance.
*/
diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index b7b3362..0083a0a 100644
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -71,6 +71,7 @@ struct writeback_control {
void writeback_inodes(struct writeback_control *wbc);
int inode_wait(void *);
void sync_inodes_sb(struct super_block *, int wait);
+void writeback_inodes_sb(struct super_block *sb, struct writeback_control *wbc);
void sync_inodes(int wait);
/* writeback.h requires fs.h; it, too, is not included from here. */
--
1.5.4.1
--
| James Bottomley | Breakage caused by unreviewed patch in x86 tree |
| James Bottomley | Re: Announce: Linux-next (Or Andrew's dream :-)) |
| Srivatsa Vaddagiri | containers (was Re: -mm merge plans for 2.6.23) |
| David Miller | Slow DOWN, please!!! |
git: | |
| H. Peter Anvin | First cut at git port to Cygwin |
| Matthieu Moy | [FAQ?] Rationale for git's way to manage the index |
| Eric Hanchrow | Re: how to backup git |
| Aaron Bentley | Re: VCS comparison table |
| Steve Davis | Re: Linux on Macintrashes? (Was: Re: Linux on |
| Vincent Poy | Linux |
| Michael K. Johnson | patches |
| Voravit Euavatanakorn | Linux |
| Richard Stallman | Real men don't attack straw men |
| Richard Stallman | Re: Real men don't attack straw men |
| Juan Miscaro | When will OpenBSD support UTF8? |
| Rico Secada | About non-free software in OpenBSD |
