assert(list_empty(&log->synclist)); 
if (!list_empty(&log->synclist)) { struct logsyncblk *lp;  list_for_each_entry(lp, &log->synclist, synclist) { if (lp->xflag & COMMIT_PAGE) { struct metapage *mp = (struct metapage *)lp; dump_mem("orphan metapage", lp, sizeof(struct metapage)); dump_mem("page", mp->page, sizeof(struct page)); } else dump_mem("orphan tblock", lp, sizeof(struct tblock)); }   }  
void jfs_flush_journal(struct jfs_log *log, int wait){	int i;	struct tblock *target = NULL;	/* jfs_write_inode may call us during read-only mount */	if (!log)		return;	jfs_info("jfs_flush_journal: log:0x%p wait=%d", log, wait);	LOGGC_LOCK(log);	if (!list_empty(&log->cqueue)) {		/*		 * This ensures that we will keep writing to the journal as long		 * as there are unwritten commit records		 */		target = list_entry(log->cqueue.prev, struct tblock, cqueue);		if (test_bit(log_FLUSH, &log->flag)) {			/*			 * We're already flushing.			 * if flush_tblk is NULL, we are flushing everything,			 * so leave it that way.  Otherwise, update it to the			 * latest transaction			 */			if (log->flush_tblk)				log->flush_tblk = target;		} else {			/* Only flush until latest transaction is committed */			log->flush_tblk = target;			set_bit(log_FLUSH, &log->flag);			/*			 * Initiate I/O on outstanding transactions			 */			if (!(log->cflag & logGC_PAGEOUT)) {				log->cflag |= logGC_PAGEOUT;				lmGCwrite(log, 0);			}		}	}	if ((wait > 1) || test_bit(log_SYNCBARRIER, &log->flag)) {		/* Flush until all activity complete */		set_bit(log_FLUSH, &log->flag);		log->flush_tblk = NULL;	}	if (wait && target && !(target->flag & tblkGC_COMMITTED)) {		DECLARE_WAITQUEUE(__wait, current);		add_wait_queue(&target->gcwait, &__wait);		set_current_state(TASK_UNINTERRUPTIBLE);		LOGGC_UNLOCK(log);		schedule();		current->state = TASK_RUNNING;		LOGGC_LOCK(log);		remove_wait_queue(&target->gcwait, &__wait);	}	LOGGC_UNLOCK(log);	if (wait < 2)		return;	/*	 * If there was recent activity, we may need to wait	 * for the lazycommit thread to catch up	 */	if ((!list_empty(&log->cqueue)) || !list_empty(&log->synclist)) {		for (i = 0; i < 800; i++) {	/* Too much? */			msleep(250);			if (list_empty(&log->cqueue) &&			    list_empty(&log->synclist))				break;		}	}	assert(list_empty(&log->cqueue));	assert(list_empty(&log->synclist));	clear_bit(log_FLUSH, &log->flag);}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/7fab479bebb96b1b4888bdae9b42e1fa9c5d3f38/jfs_logmgr.c/clean/fs/jfs/jfs_logmgr.c