···128128{129129 jfs_info("In jfs_delete_inode, inode = 0x%p", inode);130130131131+ if (is_bad_inode(inode) ||132132+ (JFS_IP(inode)->fileset != cpu_to_le32(FILESYSTEM_I)))133133+ return;134134+131135 if (test_cflag(COMMIT_Freewmap, inode))132136 jfs_free_zero_link(inode);133137
+19-17
fs/jfs/jfs_logmgr.c
···191191static bio_end_io_t lbmIODone;192192static void lbmStartIO(struct lbuf * bp);193193static void lmGCwrite(struct jfs_log * log, int cant_block);194194-static int lmLogSync(struct jfs_log * log, int nosyncwait);194194+static int lmLogSync(struct jfs_log * log, int hard_sync);195195196196197197···915915 * if new sync address is available916916 * (normally the case if sync() is executed by back-ground917917 * process).918918- * if not, explicitly run jfs_blogsync() to initiate919919- * getting of new sync address.920918 * calculate new value of i_nextsync which determines when921919 * this code is called again.922920 *923921 * PARAMETERS: log - log structure924924- * nosyncwait - 1 if called asynchronously922922+ * hard_sync - 1 to force all metadata to be written925923 *926924 * RETURN: 0927925 * 928926 * serialization: LOG_LOCK() held on entry/exit929927 */930930-static int lmLogSync(struct jfs_log * log, int nosyncwait)928928+static int lmLogSync(struct jfs_log * log, int hard_sync)931929{932930 int logsize;933931 int written; /* written since last syncpt */···939941 unsigned long flags;940942941943 /* push dirty metapages out to disk */942942- list_for_each_entry(sbi, &log->sb_list, log_list) {943943- filemap_flush(sbi->ipbmap->i_mapping);944944- filemap_flush(sbi->ipimap->i_mapping);945945- filemap_flush(sbi->direct_inode->i_mapping);946946- }944944+ if (hard_sync)945945+ list_for_each_entry(sbi, &log->sb_list, log_list) {946946+ filemap_fdatawrite(sbi->ipbmap->i_mapping);947947+ filemap_fdatawrite(sbi->ipimap->i_mapping);948948+ filemap_fdatawrite(sbi->direct_inode->i_mapping);949949+ }950950+ else951951+ list_for_each_entry(sbi, &log->sb_list, log_list) {952952+ filemap_flush(sbi->ipbmap->i_mapping);953953+ filemap_flush(sbi->ipimap->i_mapping);954954+ filemap_flush(sbi->direct_inode->i_mapping);955955+ }947956948957 /*949958 * forward syncpt···10261021 /* next syncpt trigger = written + more */10271022 log->nextsync = written + more;1028102310291029- /* return if lmLogSync() from outside of transaction, e.g., sync() */10301030- if (nosyncwait)10311031- return lsn;10321032-10331024 /* if number of bytes written from last sync point is more10341025 * than 1/4 of the log size, stop new transactions from10351026 * starting until all current transactions are completed···10501049 *10511050 * FUNCTION: write log SYNCPT record for specified log10521051 *10531053- * PARAMETERS: log - log structure10521052+ * PARAMETERS: log - log structure10531053+ * hard_sync - set to 1 to force metadata to be written10541054 */10551055-void jfs_syncpt(struct jfs_log *log)10551055+void jfs_syncpt(struct jfs_log *log, int hard_sync)10561056{ LOG_LOCK(log);10571057- lmLogSync(log, 1);10571057+ lmLogSync(log, hard_sync);10581058 LOG_UNLOCK(log);10591059}10601060
+1-1
fs/jfs/jfs_logmgr.h
···510510extern int lmGroupCommit(struct jfs_log *, struct tblock *);511511extern int jfsIOWait(void *);512512extern void jfs_flush_journal(struct jfs_log * log, int wait);513513-extern void jfs_syncpt(struct jfs_log *log);513513+extern void jfs_syncpt(struct jfs_log *log, int hard_sync);514514515515#endif /* _H_JFS_LOGMGR */