Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 76100
b: refs/heads/master
c: 67e6682
h: refs/heads/master
v: v3
  • Loading branch information
Dave Kleikamp committed Jan 3, 2008
1 parent 42946cb commit 236ea4d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 20 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 29a424f28390752a4ca2349633aaacc6be494db5
refs/heads/master: 67e6682f18b3bf812a994ae027ff87174a297ae8
32 changes: 15 additions & 17 deletions trunk/fs/jfs/jfs_logmgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,17 @@ static struct lmStat {
} lmStat;
#endif

static void write_special_inodes(struct jfs_log *log,
int (*writer)(struct address_space *))
{
struct jfs_sb_info *sbi;

list_for_each_entry(sbi, &log->sb_list, log_list) {
writer(sbi->ipbmap->i_mapping);
writer(sbi->ipimap->i_mapping);
writer(sbi->direct_inode->i_mapping);
}
}

/*
* NAME: lmLog()
Expand Down Expand Up @@ -935,22 +946,13 @@ static int lmLogSync(struct jfs_log * log, int hard_sync)
struct lrd lrd;
int lsn;
struct logsyncblk *lp;
struct jfs_sb_info *sbi;
unsigned long flags;

/* push dirty metapages out to disk */
if (hard_sync)
list_for_each_entry(sbi, &log->sb_list, log_list) {
filemap_fdatawrite(sbi->ipbmap->i_mapping);
filemap_fdatawrite(sbi->ipimap->i_mapping);
filemap_fdatawrite(sbi->direct_inode->i_mapping);
}
write_special_inodes(log, filemap_fdatawrite);
else
list_for_each_entry(sbi, &log->sb_list, log_list) {
filemap_flush(sbi->ipbmap->i_mapping);
filemap_flush(sbi->ipimap->i_mapping);
filemap_flush(sbi->direct_inode->i_mapping);
}
write_special_inodes(log, filemap_flush);

/*
* forward syncpt
Expand Down Expand Up @@ -1536,7 +1538,6 @@ void jfs_flush_journal(struct jfs_log *log, int wait)
{
int i;
struct tblock *target = NULL;
struct jfs_sb_info *sbi;

/* jfs_write_inode may call us during read-only mount */
if (!log)
Expand Down Expand Up @@ -1598,11 +1599,7 @@ void jfs_flush_journal(struct jfs_log *log, int wait)
if (wait < 2)
return;

list_for_each_entry(sbi, &log->sb_list, log_list) {
filemap_fdatawrite(sbi->ipbmap->i_mapping);
filemap_fdatawrite(sbi->ipimap->i_mapping);
filemap_fdatawrite(sbi->direct_inode->i_mapping);
}
write_special_inodes(log, filemap_fdatawrite);

/*
* If there was recent activity, we may need to wait
Expand All @@ -1611,6 +1608,7 @@ void jfs_flush_journal(struct jfs_log *log, int wait)
if ((!list_empty(&log->cqueue)) || !list_empty(&log->synclist)) {
for (i = 0; i < 200; i++) { /* Too much? */
msleep(250);
write_special_inodes(log, filemap_fdatawrite);
if (list_empty(&log->cqueue) &&
list_empty(&log->synclist))
break;
Expand Down
4 changes: 2 additions & 2 deletions trunk/fs/jfs/jfs_umount.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ int jfs_umount(struct super_block *sb)
/*
* Wait for outstanding transactions to be written to log:
*/
jfs_flush_journal(log, 2);
jfs_flush_journal(log, 1);

/*
* close fileset inode allocation map (aka fileset inode)
Expand Down Expand Up @@ -146,7 +146,7 @@ int jfs_umount_rw(struct super_block *sb)
*
* remove file system from log active file system list.
*/
jfs_flush_journal(log, 2);
jfs_flush_journal(log, 1);

/*
* Make sure all metadata makes it to disk
Expand Down

0 comments on commit 236ea4d

Please sign in to comment.