Skip to content

Commit 4ee6afd

Browse files
Artem BityutskiyArtem Bityutskiy
authored andcommitted
VFS: export sync_sb_inodes
This patch exports the 'sync_sb_inodes()' which is needed for UBIFS because it has to force write-back from time to time. Namely, the UBIFS budgeting subsystem forces write-back when its pessimistic callculations show that there is no free space on the media. Signed-off-by: Artem Bityutskiy <[email protected]>
1 parent ae8547b commit 4ee6afd

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

fs/fs-writeback.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,8 +439,8 @@ __writeback_single_inode(struct inode *inode, struct writeback_control *wbc)
439439
* on the writer throttling path, and we get decent balancing between many
440440
* throttled threads: we don't want them all piling up on inode_sync_wait.
441441
*/
442-
static void
443-
sync_sb_inodes(struct super_block *sb, struct writeback_control *wbc)
442+
void generic_sync_sb_inodes(struct super_block *sb,
443+
struct writeback_control *wbc)
444444
{
445445
const unsigned long start = jiffies; /* livelock avoidance */
446446

@@ -526,6 +526,13 @@ sync_sb_inodes(struct super_block *sb, struct writeback_control *wbc)
526526
spin_unlock(&inode_lock);
527527
return; /* Leave any unwritten inodes on s_io */
528528
}
529+
EXPORT_SYMBOL_GPL(generic_sync_sb_inodes);
530+
531+
static void sync_sb_inodes(struct super_block *sb,
532+
struct writeback_control *wbc)
533+
{
534+
generic_sync_sb_inodes(sb, wbc);
535+
}
529536

530537
/*
531538
* Start writeback of dirty pagecache data against all unlocked inodes.

include/linux/fs.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1729,6 +1729,8 @@ static inline void invalidate_remote_inode(struct inode *inode)
17291729
extern int invalidate_inode_pages2(struct address_space *mapping);
17301730
extern int invalidate_inode_pages2_range(struct address_space *mapping,
17311731
pgoff_t start, pgoff_t end);
1732+
extern void generic_sync_sb_inodes(struct super_block *sb,
1733+
struct writeback_control *wbc);
17321734
extern int write_inode_now(struct inode *, int);
17331735
extern int filemap_fdatawrite(struct address_space *);
17341736
extern int filemap_flush(struct address_space *);

0 commit comments

Comments
 (0)