aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jfs/jfs_logmgr.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/jfs/jfs_logmgr.c')
-rw-r--r--fs/jfs/jfs_logmgr.c34
1 files changed, 16 insertions, 18 deletions
diff --git a/fs/jfs/jfs_logmgr.c b/fs/jfs/jfs_logmgr.c
index 15a3974cdeeb..325a9679b95a 100644
--- a/fs/jfs/jfs_logmgr.c
+++ b/fs/jfs/jfs_logmgr.c
@@ -208,6 +208,17 @@ static struct lmStat {
208} lmStat; 208} lmStat;
209#endif 209#endif
210 210
211static void write_special_inodes(struct jfs_log *log,
212 int (*writer)(struct address_space *))
213{
214 struct jfs_sb_info *sbi;
215
216 list_for_each_entry(sbi, &log->sb_list, log_list) {
217 writer(sbi->ipbmap->i_mapping);
218 writer(sbi->ipimap->i_mapping);
219 writer(sbi->direct_inode->i_mapping);
220 }
221}
211 222
212/* 223/*
213 * NAME: lmLog() 224 * NAME: lmLog()
@@ -935,22 +946,13 @@ static int lmLogSync(struct jfs_log * log, int hard_sync)
935 struct lrd lrd; 946 struct lrd lrd;
936 int lsn; 947 int lsn;
937 struct logsyncblk *lp; 948 struct logsyncblk *lp;
938 struct jfs_sb_info *sbi;
939 unsigned long flags; 949 unsigned long flags;
940 950
941 /* push dirty metapages out to disk */ 951 /* push dirty metapages out to disk */
942 if (hard_sync) 952 if (hard_sync)
943 list_for_each_entry(sbi, &log->sb_list, log_list) { 953 write_special_inodes(log, filemap_fdatawrite);
944 filemap_fdatawrite(sbi->ipbmap->i_mapping);
945 filemap_fdatawrite(sbi->ipimap->i_mapping);
946 filemap_fdatawrite(sbi->direct_inode->i_mapping);
947 }
948 else 954 else
949 list_for_each_entry(sbi, &log->sb_list, log_list) { 955 write_special_inodes(log, filemap_flush);
950 filemap_flush(sbi->ipbmap->i_mapping);
951 filemap_flush(sbi->ipimap->i_mapping);
952 filemap_flush(sbi->direct_inode->i_mapping);
953 }
954 956
955 /* 957 /*
956 * forward syncpt 958 * forward syncpt
@@ -1536,7 +1538,6 @@ void jfs_flush_journal(struct jfs_log *log, int wait)
1536{ 1538{
1537 int i; 1539 int i;
1538 struct tblock *target = NULL; 1540 struct tblock *target = NULL;
1539 struct jfs_sb_info *sbi;
1540 1541
1541 /* jfs_write_inode may call us during read-only mount */ 1542 /* jfs_write_inode may call us during read-only mount */
1542 if (!log) 1543 if (!log)
@@ -1598,11 +1599,7 @@ void jfs_flush_journal(struct jfs_log *log, int wait)
1598 if (wait < 2) 1599 if (wait < 2)
1599 return; 1600 return;
1600 1601
1601 list_for_each_entry(sbi, &log->sb_list, log_list) { 1602 write_special_inodes(log, filemap_fdatawrite);
1602 filemap_fdatawrite(sbi->ipbmap->i_mapping);
1603 filemap_fdatawrite(sbi->ipimap->i_mapping);
1604 filemap_fdatawrite(sbi->direct_inode->i_mapping);
1605 }
1606 1603
1607 /* 1604 /*
1608 * If there was recent activity, we may need to wait 1605 * If there was recent activity, we may need to wait
@@ -1611,6 +1608,7 @@ void jfs_flush_journal(struct jfs_log *log, int wait)
1611 if ((!list_empty(&log->cqueue)) || !list_empty(&log->synclist)) { 1608 if ((!list_empty(&log->cqueue)) || !list_empty(&log->synclist)) {
1612 for (i = 0; i < 200; i++) { /* Too much? */ 1609 for (i = 0; i < 200; i++) { /* Too much? */
1613 msleep(250); 1610 msleep(250);
1611 write_special_inodes(log, filemap_fdatawrite);
1614 if (list_empty(&log->cqueue) && 1612 if (list_empty(&log->cqueue) &&
1615 list_empty(&log->synclist)) 1613 list_empty(&log->synclist))
1616 break; 1614 break;
@@ -2347,7 +2345,7 @@ int jfsIOWait(void *arg)
2347 2345
2348 do { 2346 do {
2349 spin_lock_irq(&log_redrive_lock); 2347 spin_lock_irq(&log_redrive_lock);
2350 while ((bp = log_redrive_list) != 0) { 2348 while ((bp = log_redrive_list)) {
2351 log_redrive_list = bp->l_redrive_next; 2349 log_redrive_list = bp->l_redrive_next;
2352 bp->l_redrive_next = NULL; 2350 bp->l_redrive_next = NULL;
2353 spin_unlock_irq(&log_redrive_lock); 2351 spin_unlock_irq(&log_redrive_lock);