Merge head 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/shaggy/jfs-2.6

+34 -24
+4
fs/jfs/inode.c
··· 128 128 { 129 129 jfs_info("In jfs_delete_inode, inode = 0x%p", inode); 130 130 131 + if (is_bad_inode(inode) || 132 + (JFS_IP(inode)->fileset != cpu_to_le32(FILESYSTEM_I))) 133 + return; 134 + 131 135 if (test_cflag(COMMIT_Freewmap, inode)) 132 136 jfs_free_zero_link(inode); 133 137
+19 -17
fs/jfs/jfs_logmgr.c
··· 191 191 static bio_end_io_t lbmIODone; 192 192 static void lbmStartIO(struct lbuf * bp); 193 193 static void lmGCwrite(struct jfs_log * log, int cant_block); 194 - static int lmLogSync(struct jfs_log * log, int nosyncwait); 194 + static int lmLogSync(struct jfs_log * log, int hard_sync); 195 195 196 196 197 197 ··· 915 915 * if new sync address is available 916 916 * (normally the case if sync() is executed by back-ground 917 917 * process). 918 - * if not, explicitly run jfs_blogsync() to initiate 919 - * getting of new sync address. 920 918 * calculate new value of i_nextsync which determines when 921 919 * this code is called again. 922 920 * 923 921 * PARAMETERS: log - log structure 924 - * nosyncwait - 1 if called asynchronously 922 + * hard_sync - 1 to force all metadata to be written 925 923 * 926 924 * RETURN: 0 927 925 * 928 926 * serialization: LOG_LOCK() held on entry/exit 929 927 */ 930 - static int lmLogSync(struct jfs_log * log, int nosyncwait) 928 + static int lmLogSync(struct jfs_log * log, int hard_sync) 931 929 { 932 930 int logsize; 933 931 int written; /* written since last syncpt */ ··· 939 941 unsigned long flags; 940 942 941 943 /* push dirty metapages out to disk */ 942 - list_for_each_entry(sbi, &log->sb_list, log_list) { 943 - filemap_flush(sbi->ipbmap->i_mapping); 944 - filemap_flush(sbi->ipimap->i_mapping); 945 - filemap_flush(sbi->direct_inode->i_mapping); 946 - } 944 + if (hard_sync) 945 + list_for_each_entry(sbi, &log->sb_list, log_list) { 946 + filemap_fdatawrite(sbi->ipbmap->i_mapping); 947 + filemap_fdatawrite(sbi->ipimap->i_mapping); 948 + filemap_fdatawrite(sbi->direct_inode->i_mapping); 949 + } 950 + else 951 + list_for_each_entry(sbi, &log->sb_list, log_list) { 952 + filemap_flush(sbi->ipbmap->i_mapping); 953 + filemap_flush(sbi->ipimap->i_mapping); 954 + filemap_flush(sbi->direct_inode->i_mapping); 955 + } 947 956 948 957 /* 949 958 * forward syncpt ··· 1026 1021 /* next syncpt trigger = written + more */ 1027 1022 log->nextsync = written + more; 1028 1023 1029 - /* return if lmLogSync() from outside of transaction, e.g., sync() */ 1030 - if (nosyncwait) 1031 - return lsn; 1032 - 1033 1024 /* if number of bytes written from last sync point is more 1034 1025 * than 1/4 of the log size, stop new transactions from 1035 1026 * starting until all current transactions are completed ··· 1050 1049 * 1051 1050 * FUNCTION: write log SYNCPT record for specified log 1052 1051 * 1053 - * PARAMETERS: log - log structure 1052 + * PARAMETERS: log - log structure 1053 + * hard_sync - set to 1 to force metadata to be written 1054 1054 */ 1055 - void jfs_syncpt(struct jfs_log *log) 1055 + void jfs_syncpt(struct jfs_log *log, int hard_sync) 1056 1056 { LOG_LOCK(log); 1057 - lmLogSync(log, 1); 1057 + lmLogSync(log, hard_sync); 1058 1058 LOG_UNLOCK(log); 1059 1059 } 1060 1060
+1 -1
fs/jfs/jfs_logmgr.h
··· 510 510 extern int lmGroupCommit(struct jfs_log *, struct tblock *); 511 511 extern int jfsIOWait(void *); 512 512 extern void jfs_flush_journal(struct jfs_log * log, int wait); 513 - extern void jfs_syncpt(struct jfs_log *log); 513 + extern void jfs_syncpt(struct jfs_log *log, int hard_sync); 514 514 515 515 #endif /* _H_JFS_LOGMGR */
+7 -5
fs/jfs/jfs_txnmgr.c
··· 552 552 * synchronize with logsync barrier 553 553 */ 554 554 if (test_bit(log_SYNCBARRIER, &log->flag)) { 555 + TXN_UNLOCK(); 556 + 557 + /* write dirty metadata & forward log syncpt */ 558 + jfs_syncpt(log, 1); 559 + 555 560 jfs_info("log barrier off: 0x%x", log->lsn); 556 561 557 562 /* enable new transactions start */ ··· 564 559 565 560 /* wakeup all waitors for logsync barrier */ 566 561 TXN_WAKEUP(&log->syncwait); 567 - 568 - TXN_UNLOCK(); 569 - 570 - /* forward log syncpt */ 571 - jfs_syncpt(log); 572 562 573 563 goto wakeup; 574 564 } ··· 657 657 /* only anonymous txn. 658 658 * Remove from anon_list 659 659 */ 660 + TXN_LOCK(); 660 661 list_del_init(&jfs_ip->anon_inode_list); 662 + TXN_UNLOCK(); 661 663 } 662 664 jfs_ip->atlhead = tlck->next; 663 665 } else {
+3 -1
fs/jfs/super.c
··· 114 114 { 115 115 struct jfs_inode_info *ji = JFS_IP(inode); 116 116 117 + BUG_ON(!list_empty(&ji->anon_inode_list)); 118 + 117 119 spin_lock_irq(&ji->ag_lock); 118 120 if (ji->active_ag != -1) { 119 121 struct bmap *bmap = JFS_SBI(inode->i_sb)->bmap; ··· 533 531 /* log == NULL indicates read-only mount */ 534 532 if (log) { 535 533 jfs_flush_journal(log, wait); 536 - jfs_syncpt(log); 534 + jfs_syncpt(log, 0); 537 535 } 538 536 539 537 return 0;