···128{129 jfs_info("In jfs_delete_inode, inode = 0x%p", inode);130131+ if (is_bad_inode(inode) ||132+ (JFS_IP(inode)->fileset != cpu_to_le32(FILESYSTEM_I)))133+ return;134+135 if (test_cflag(COMMIT_Freewmap, inode))136 jfs_free_zero_link(inode);137
+19-17
fs/jfs/jfs_logmgr.c
···191static bio_end_io_t lbmIODone;192static void lbmStartIO(struct lbuf * bp);193static void lmGCwrite(struct jfs_log * log, int cant_block);194-static int lmLogSync(struct jfs_log * log, int nosyncwait);195196197···915 * if new sync address is available916 * (normally the case if sync() is executed by back-ground917 * process).918- * if not, explicitly run jfs_blogsync() to initiate919- * getting of new sync address.920 * calculate new value of i_nextsync which determines when921 * this code is called again.922 *923 * PARAMETERS: log - log structure924- * nosyncwait - 1 if called asynchronously925 *926 * RETURN: 0927 * 928 * serialization: LOG_LOCK() held on entry/exit929 */930-static int lmLogSync(struct jfs_log * log, int nosyncwait)931{932 int logsize;933 int written; /* written since last syncpt */···939 unsigned long flags;940941 /* 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- }0000000947948 /*949 * forward syncpt···1026 /* next syncpt trigger = written + more */1027 log->nextsync = written + more;10281029- /* return if lmLogSync() from outside of transaction, e.g., sync() */1030- if (nosyncwait)1031- return lsn;1032-1033 /* if number of bytes written from last sync point is more1034 * than 1/4 of the log size, stop new transactions from1035 * starting until all current transactions are completed···1050 *1051 * FUNCTION: write log SYNCPT record for specified log1052 *1053- * PARAMETERS: log - log structure01054 */1055-void jfs_syncpt(struct jfs_log *log)1056{ LOG_LOCK(log);1057- lmLogSync(log, 1);1058 LOG_UNLOCK(log);1059}1060
···191static bio_end_io_t lbmIODone;192static void lbmStartIO(struct lbuf * bp);193static void lmGCwrite(struct jfs_log * log, int cant_block);194+static int lmLogSync(struct jfs_log * log, int hard_sync);195196197···915 * if new sync address is available916 * (normally the case if sync() is executed by back-ground917 * process).00918 * calculate new value of i_nextsync which determines when919 * this code is called again.920 *921 * PARAMETERS: log - log structure922+ * hard_sync - 1 to force all metadata to be written923 *924 * RETURN: 0925 * 926 * serialization: LOG_LOCK() held on entry/exit927 */928+static int lmLogSync(struct jfs_log * log, int hard_sync)929{930 int logsize;931 int written; /* written since last syncpt */···941 unsigned long flags;942943 /* push dirty metapages out to disk */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+ else951+ 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+ }956957 /*958 * forward syncpt···1021 /* next syncpt trigger = written + more */1022 log->nextsync = written + more;102300001024 /* if number of bytes written from last sync point is more1025 * than 1/4 of the log size, stop new transactions from1026 * starting until all current transactions are completed···1049 *1050 * FUNCTION: write log SYNCPT record for specified log1051 *1052+ * PARAMETERS: log - log structure1053+ * hard_sync - set to 1 to force metadata to be written1054 */1055+void jfs_syncpt(struct jfs_log *log, int hard_sync)1056{ LOG_LOCK(log);1057+ lmLogSync(log, hard_sync);1058 LOG_UNLOCK(log);1059}1060
+1-1
fs/jfs/jfs_logmgr.h
···510extern int lmGroupCommit(struct jfs_log *, struct tblock *);511extern int jfsIOWait(void *);512extern void jfs_flush_journal(struct jfs_log * log, int wait);513-extern void jfs_syncpt(struct jfs_log *log);514515#endif /* _H_JFS_LOGMGR */
···510extern int lmGroupCommit(struct jfs_log *, struct tblock *);511extern int jfsIOWait(void *);512extern void jfs_flush_journal(struct jfs_log * log, int wait);513+extern void jfs_syncpt(struct jfs_log *log, int hard_sync);514515#endif /* _H_JFS_LOGMGR */
+7-5
fs/jfs/jfs_txnmgr.c
···552 * synchronize with logsync barrier553 */554 if (test_bit(log_SYNCBARRIER, &log->flag)) {00000555 jfs_info("log barrier off: 0x%x", log->lsn);556557 /* enable new transactions start */···564565 /* wakeup all waitors for logsync barrier */566 TXN_WAKEUP(&log->syncwait);567-568- TXN_UNLOCK();569-570- /* forward log syncpt */571- jfs_syncpt(log);572573 goto wakeup;574 }···657 /* only anonymous txn.658 * Remove from anon_list659 */0660 list_del_init(&jfs_ip->anon_inode_list);0661 }662 jfs_ip->atlhead = tlck->next;663 } else {
···552 * synchronize with logsync barrier553 */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+560 jfs_info("log barrier off: 0x%x", log->lsn);561562 /* enable new transactions start */···559560 /* wakeup all waitors for logsync barrier */561 TXN_WAKEUP(&log->syncwait);00000562563 goto wakeup;564 }···657 /* only anonymous txn.658 * Remove from anon_list659 */660+ TXN_LOCK();661 list_del_init(&jfs_ip->anon_inode_list);662+ TXN_UNLOCK();663 }664 jfs_ip->atlhead = tlck->next;665 } else {