patch-2.4.21 linux-2.4.21/fs/jfs/jfs_logmgr.c

Next file: linux-2.4.21/fs/jfs/jfs_logmgr.h
Previous file: linux-2.4.21/fs/jfs/jfs_inode.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.20/fs/jfs/jfs_logmgr.c linux-2.4.21/fs/jfs/jfs_logmgr.c
@@ -95,7 +95,7 @@
 #define LOGGC_LOCK_INIT(log)	spin_lock_init(&(log)->gclock)
 #define LOGGC_LOCK(log)		spin_lock_irq(&(log)->gclock)
 #define LOGGC_UNLOCK(log)	spin_unlock_irq(&(log)->gclock)
-#define LOGGC_WAKEUP(tblk)	wake_up(&(tblk)->gcwait)
+#define LOGGC_WAKEUP(tblk)	wake_up_all(&(tblk)->gcwait)
 
 /*
  *	log sync serialization (per log)
@@ -183,9 +183,8 @@
 static void lbmDirectWrite(struct jfs_log * log, struct lbuf * bp, int flag);
 static int lbmIOWait(struct lbuf * bp, int flag);
 static void lbmIODone(struct buffer_head *bh, int);
-
-void lbmStartIO(struct lbuf * bp);
-void lmGCwrite(struct jfs_log * log, int cant_block);
+static void lbmStartIO(struct lbuf * bp);
+static void lmGCwrite(struct jfs_log * log, int cant_block);
 
 
 /*
@@ -196,6 +195,8 @@
 	uint commit;		/* # of commit */
 	uint pagedone;		/* # of page written */
 	uint submitted;		/* # of pages submitted */
+	uint full_page;		/* # of full pages submitted */
+	uint partial_page;	/* # of partial pages submitted */
 } lmStat;
 #endif
 
@@ -219,8 +220,8 @@
 	int diffp, difft;
 	struct metapage *mp = NULL;
 
-	jFYI(1, ("lmLog: log:0x%p tblk:0x%p, lrd:0x%p tlck:0x%p\n",
-		 log, tblk, lrd, tlck));
+	jfs_info("lmLog: log:0x%p tblk:0x%p, lrd:0x%p tlck:0x%p",
+		 log, tblk, lrd, tlck);
 
 	LOG_LOCK(log);
 
@@ -388,7 +389,7 @@
 	}
 #endif				/* _JFS_WIP */
 	else {
-		jERROR(2, ("lmWriteRecord: UFO tlck:0x%p\n", tlck));
+		jfs_err("lmWriteRecord: UFO tlck:0x%p", tlck);
 		return 0;	/* Probably should trap */
 	}
 	l2linesize = linelock->l2linesize;
@@ -447,9 +448,8 @@
 		lvd->offset = cpu_to_le16(lv->offset);
 		lvd->length = cpu_to_le16(lv->length);
 		dstoffset += 4;
-		jFYI(1,
-		     ("lmWriteRecord: lv offset:%d length:%d\n",
-		      lv->offset, lv->length));
+		jfs_info("lmWriteRecord: lv offset:%d length:%d",
+			 lv->offset, lv->length);
 	}
 
 	if ((i = linelock->next)) {
@@ -490,9 +490,8 @@
 
 		if (lrd->type & cpu_to_le16(LOG_COMMIT)) {
 			tblk->clsn = lsn;
-			jFYI(1,
-			     ("wr: tclsn:0x%x, beor:0x%x\n", tblk->clsn,
-			      bp->l_eor));
+			jfs_info("wr: tclsn:0x%x, beor:0x%x", tblk->clsn,
+				 bp->l_eor);
 
 			INCREMENT(lmStat.commit);	/* # of commit */
 
@@ -511,7 +510,6 @@
 			tblk->bp = log->bp;
 			tblk->pn = log->page;
 			tblk->eor = log->eor;
-			init_waitqueue_head(&tblk->gcwait);
 
 			/* enqueue transaction to commit queue */
 			tblk->cqnext = NULL;
@@ -524,10 +522,8 @@
 			LOGGC_UNLOCK(log);
 		}
 
-		jFYI(1,
-		     ("lmWriteRecord: lrd:0x%04x bp:0x%p pn:%d eor:0x%x\n",
-		      le16_to_cpu(lrd->type), log->bp, log->page,
-		      dstoffset));
+		jfs_info("lmWriteRecord: lrd:0x%04x bp:0x%p pn:%d eor:0x%x",
+			le16_to_cpu(lrd->type), log->bp, log->page, dstoffset);
 
 		/* page not full ? */
 		if (dstoffset < LOGPSIZE - LOGPTLRSIZE)
@@ -567,8 +563,6 @@
 	struct lbuf *nextbp;
 	struct tblock *tblk;
 
-	jFYI(1, ("lmNextPage\n"));
-
 	/* get current log page number and log sequence page number */
 	pn = log->page;
 	bp = log->bp;
@@ -597,21 +591,21 @@
 		/* mark tblk for end-of-page */
 		tblk->flag |= tblkGC_EOP;
 
-		/* if page is not already on write queue,
-		 * just enqueue (no lbmWRITE to prevent redrive)
-		 * buffer to wqueue to ensure correct serial order
-		 * of the pages since log pages will be added
-		 * continuously (tblk bound with the page hasn't
-		 * got around to init write of the page, either
-		 * preempted or the page got filled by its COMMIT
-		 * record);
-		 * pages with COMMIT are paged out explicitly by
-		 * tblk in lmGroupCommit();
-		 */
-		if (bp->l_wqnext == NULL) {
-			/* bp->l_ceor = bp->l_eor; */
-			/* lp->h.eor = lp->t.eor = bp->l_ceor; */
-			lbmWrite(log, bp, 0, 0);
+		if (log->cflag & logGC_PAGEOUT) {
+			/* if page is not already on write queue,
+			 * just enqueue (no lbmWRITE to prevent redrive)
+			 * buffer to wqueue to ensure correct serial order
+			 * of the pages since log pages will be added
+			 * continuously
+			 */
+			if (bp->l_wqnext == NULL)
+				lbmWrite(log, bp, 0, 0);
+		} else {
+			/*
+			 * No current GC leader, initiate group commit
+			 */
+			log->cflag |= logGC_PAGEOUT;
+			lmGCwrite(log, 0);
 		}
 	}
 	/* page is not bound with outstanding tblk:
@@ -644,7 +638,6 @@
 	lp->h.page = lp->t.page = cpu_to_le32(lspn + 1);
 	lp->h.eor = lp->t.eor = cpu_to_le16(LOGPHDRSIZE);
 
-	jFYI(1, ("lmNextPage done\n"));
 	return 0;
 }
 
@@ -678,24 +671,31 @@
 		LOGGC_UNLOCK(log);
 		return rc;
 	}
-	jFYI(1,
-	     ("lmGroup Commit: tblk = 0x%p, gcrtc = %d\n", tblk,
-	      log->gcrtc));
+	jfs_info("lmGroup Commit: tblk = 0x%p, gcrtc = %d", tblk, log->gcrtc);
 
-	/*
-	 * group commit pageout in progress
-	 */
-	if ((!(log->cflag & logGC_PAGEOUT)) && log->cqueue.head) {
+	if (tblk->xflag & COMMIT_LAZY)
+		tblk->flag |= tblkGC_LAZY;
+
+	if ((!(log->cflag & logGC_PAGEOUT)) && log->cqueue.head &&
+	    (!(tblk->xflag & COMMIT_LAZY) || test_bit(log_FLUSH, &log->flag))) {
 		/*
-		 * only transaction in the commit queue:
+		 * No pageout in progress
 		 *
-		 * start one-transaction group commit as
-		 * its group leader.
+		 * start group commit as its group leader.
 		 */
 		log->cflag |= logGC_PAGEOUT;
 
 		lmGCwrite(log, 0);
 	}
+
+	if (tblk->xflag & COMMIT_LAZY) {
+		/*
+		 * Lazy transactions can leave now
+		 */
+		LOGGC_UNLOCK(log);
+		return 0;
+	}
+
 	/* lmGCwrite gives up LOGGC_LOCK, check again */
 
 	if (tblk->flag & tblkGC_COMMITTED) {
@@ -709,12 +709,6 @@
 	/* upcount transaction waiting for completion
 	 */
 	log->gcrtc++;
-
-	if (tblk->xflag & COMMIT_LAZY) {
-		tblk->flag |= tblkGC_LAZY;
-		LOGGC_UNLOCK(log);
-		return 0;
-	}
 	tblk->flag |= tblkGC_READY;
 
 	__SLEEP_COND(tblk->gcwait, (tblk->flag & tblkGC_COMMITTED),
@@ -741,7 +735,7 @@
  *	LOGGC_LOCK must be held by caller.
  *	N.B. LOG_LOCK is NOT held during lmGroupCommit().
  */
-void lmGCwrite(struct jfs_log * log, int cant_write)
+static void lmGCwrite(struct jfs_log * log, int cant_write)
 {
 	struct lbuf *bp;
 	struct logpage *lp;
@@ -780,20 +774,16 @@
 		tblk->flag |= tblkGC_FREE;
 		bp->l_ceor = bp->l_eor;
 		lp->h.eor = lp->t.eor = cpu_to_le16(bp->l_ceor);
-		jEVENT(0,
-		       ("gc: tclsn:0x%x, bceor:0x%x\n", tblk->clsn,
-			bp->l_ceor));
 		lbmWrite(log, bp, lbmWRITE | lbmRELEASE | lbmGC,
 			 cant_write);
+		INCREMENT(lmStat.full_page);
 	}
 	/* page is not yet full */
 	else {
 		bp->l_ceor = tblk->eor;	/* ? bp->l_ceor = bp->l_eor; */
 		lp->h.eor = lp->t.eor = cpu_to_le16(bp->l_ceor);
-		jEVENT(0,
-		       ("gc: tclsn:0x%x, bceor:0x%x\n", tblk->clsn,
-			bp->l_ceor));
 		lbmWrite(log, bp, lbmWRITE | lbmGC, cant_write);
+		INCREMENT(lmStat.partial_page);
 	}
 }
 
@@ -840,9 +830,14 @@
 		tblk->flag &= ~tblkGC_QUEUE;
 		tblk->cqnext = 0;
 
-		jEVENT(0,
-		       ("lmPostGC: tblk = 0x%p, flag = 0x%x\n", tblk,
-			tblk->flag));
+		if (tblk == log->flush_tblk) {
+			/* we can stop flushing the log now */
+			clear_bit(log_FLUSH, &log->flag);
+			log->flush_tblk = NULL;
+		}
+
+		jfs_info("lmPostGC: tblk = 0x%p, flag = 0x%x", tblk,
+			 tblk->flag);
 
 		if (!(tblk->xflag & COMMIT_FORCE))
 			/*
@@ -853,10 +848,10 @@
 			/* state transition: COMMIT -> COMMITTED */
 			tblk->flag |= tblkGC_COMMITTED;
 
-			if (tblk->flag & tblkGC_READY) {
+			if (tblk->flag & tblkGC_READY)
 				log->gcrtc--;
-				LOGGC_WAKEUP(tblk);
-			}
+
+			LOGGC_WAKEUP(tblk);
 		}
 
 		/* was page full before pageout ?
@@ -872,7 +867,7 @@
 			lp = (struct logpage *) bp->l_ldata;
 			bp->l_ceor = bp->l_eor;
 			lp->h.eor = lp->t.eor = cpu_to_le16(bp->l_eor);
-			jEVENT(0, ("lmPostGC: calling lbmWrite\n"));
+			jfs_info("lmPostGC: calling lbmWrite");
 			lbmWrite(log, bp, lbmWRITE | lbmRELEASE | lbmFREE,
 				 1);
 		}
@@ -881,11 +876,14 @@
 
 	/* are there any transactions who have entered lnGroupCommit()
 	 * (whose COMMITs are after that of the last log page written.
-	 * They are waiting for new group commit (above at (SLEEP 1)):
+	 * They are waiting for new group commit (above at (SLEEP 1))
+	 * or lazy transactions are on a full (queued) log page,
 	 * select the latest ready transaction as new group leader and
 	 * wake her up to lead her group.
 	 */
-	if ((log->gcrtc > 0) && log->cqueue.head)
+	if ((tblk = log->cqueue.head) &&
+	    ((log->gcrtc > 0) || (tblk->bp->l_wqnext != NULL) ||
+	     test_bit(log_FLUSH, &log->flag)))
 		/*
 		 * Call lmGCwrite with new group leader
 		 */
@@ -893,8 +891,8 @@
 
 	/* no transaction are ready yet (transactions are only just
 	 * queued (GC_QUEUE) and not entered for group commit yet).
-	 * let the first transaction entering group commit
-	 * will elect hetself as new group leader.
+	 * the first transaction entering group commit
+	 * will elect herself as new group leader.
 	 */
 	else
 		log->cflag &= ~logGC_PAGEOUT;
@@ -995,8 +993,7 @@
 	delta = LOGSYNC_DELTA(logsize);
 	more = min(free / 2, delta);
 	if (more < 2 * LOGPSIZE) {
-		jEVENT(1,
-		       ("\n ... Log Wrap ... Log Wrap ... Log Wrap ...\n\n"));
+		jfs_warn("\n ... Log Wrap ... Log Wrap ... Log Wrap ...\n");
 		/*
 		 *      log wrapping
 		 *
@@ -1035,8 +1032,12 @@
 	 */
 	if (written > LOGSYNC_BARRIER(logsize) && logsize > 32 * LOGPSIZE) {
 		set_bit(log_SYNCBARRIER, &log->flag);
-		jFYI(1, ("log barrier on: lsn=0x%x syncpt=0x%x\n", lsn,
-			 log->syncpt));
+		jfs_info("log barrier on: lsn=0x%x syncpt=0x%x", lsn,
+			 log->syncpt);
+		/*
+		 * We may have to initiate group commit
+		 */
+		jfs_flush_journal(log, 0);
 	}
 
 	return lsn;
@@ -1130,7 +1131,6 @@
 		goto shutdown;
 
       out:
-	jFYI(1, ("lmLogOpen: exit(0)\n"));
 	*logptr = log;
 	return 0;
 
@@ -1146,7 +1146,7 @@
       free:		/* free log descriptor */
 	kfree(log);
 
-	jFYI(1, ("lmLogOpen: exit(%d)\n", rc));
+	jfs_warn("lmLogOpen: exit(%d)", rc);
 	return rc;
 }
 
@@ -1179,7 +1179,7 @@
 	struct logpage *lp;
 	int lsn;
 
-	jFYI(1, ("lmLogInit: log:0x%p\n", log));
+	jfs_info("lmLogInit: log:0x%p", log);
 
 	/*
 	 * log inode is overlaid on generic inode where
@@ -1205,14 +1205,14 @@
 	logsuper = (struct logsuper *) bpsuper->l_ldata;
 
 	if (logsuper->magic != cpu_to_le32(LOGMAGIC)) {
-		jERROR(1, ("*** Log Format Error ! ***\n"));
+		jfs_warn("*** Log Format Error ! ***");
 		rc = EINVAL;
 		goto errout20;
 	}
 
 	/* logredo() should have been run successfully. */
 	if (logsuper->state != cpu_to_le32(LOGREDONE)) {
-		jERROR(1, ("*** Log Is Dirty ! ***\n"));
+		jfs_warn("*** Log Is Dirty ! ***");
 		rc = EINVAL;
 		goto errout20;
 	}
@@ -1223,19 +1223,17 @@
 			rc = EINVAL;
 			goto errout20;
 		}
-		jFYI(0,
-		     ("lmLogInit: inline log:0x%p base:0x%Lx size:0x%x\n",
-		      log, (unsigned long long) log->base, log->size));
+		jfs_info("lmLogInit: inline log:0x%p base:0x%Lx size:0x%x",
+			log, (unsigned long long) log->base, log->size);
 	} else {
 		if (memcmp(logsuper->uuid, log->uuid, 16)) {
-			jERROR(1,("wrong uuid on JFS log device\n"));
+			jfs_warn("wrong uuid on JFS log device");
 			goto errout20;
 		}
 		log->size = le32_to_cpu(logsuper->size);
 		log->l2bsize = le32_to_cpu(logsuper->l2bsize);
-		jFYI(0,
-		     ("lmLogInit: external log:0x%p base:0x%Lx size:0x%x\n",
-		      log, (unsigned long long) log->base, log->size));
+		jfs_info("lmLogInit: external log:0x%p base:0x%Lx size:0x%x",
+			log, (unsigned long long) log->base, log->size);
 	}
 
 	log->page = le32_to_cpu(logsuper->end) / LOGPSIZE;
@@ -1250,9 +1248,9 @@
 
 	lp = (struct logpage *) bp->l_ldata;
 
-	jFYI(1, ("lmLogInit: lsn:0x%x page:%d eor:%d:%d\n",
+	jfs_info("lmLogInit: lsn:0x%x page:%d eor:%d:%d",
 		 le32_to_cpu(logsuper->end), log->page, log->eor,
-		 le16_to_cpu(lp->h.eor)));
+		 le16_to_cpu(lp->h.eor));
 
 //      ASSERT(log->eor == lp->h.eor);
 
@@ -1300,14 +1298,15 @@
 	log->sync = log->syncpt;
 	log->nextsync = LOGSYNC_DELTA(log->logsize);
 
-	jFYI(1, ("lmLogInit: lsn:0x%x syncpt:0x%x sync:0x%x\n",
-		 log->lsn, log->syncpt, log->sync));
+	jfs_info("lmLogInit: lsn:0x%x syncpt:0x%x sync:0x%x",
+		 log->lsn, log->syncpt, log->sync);
 
 	LOGSYNC_LOCK_INIT(log);
 
 	INIT_LIST_HEAD(&log->synclist);
 
-	log->cqueue.head = log->cqueue.tail = 0;
+	log->cqueue.head = log->cqueue.tail = NULL;
+	log->flush_tblk = NULL;
 
 	log->count = 0;
 
@@ -1326,7 +1325,6 @@
 	if ((rc = lbmIOWait(bpsuper, lbmFREE)))
 		goto errout30;
 
-	jFYI(1, ("lmLogInit: exit(%d)\n", rc));
 	return 0;
 
 	/*
@@ -1341,7 +1339,7 @@
       errout10:		/* unwind lbmLogInit() */
 	lbmLogShutdown(log);
 
-	jFYI(1, ("lmLogInit: exit(%d)\n", rc));
+	jfs_warn("lmLogInit: exit(%d)", rc);
 	return rc;
 }
 
@@ -1363,7 +1361,7 @@
 {
 	int rc;
 
-	jFYI(1, ("lmLogClose: log:0x%p\n", log));
+	jfs_info("lmLogClose: log:0x%p", log);
 
 	if (!test_bit(log_INLINELOG, &log->flag))
 		goto externalLog;
@@ -1383,28 +1381,88 @@
 	blkdev_put(log->bdev, BDEV_FS);
 
       out:
-	jFYI(0, ("lmLogClose: exit(%d)\n", rc));
+	jfs_info("lmLogClose: exit(%d)", rc);
 	return rc;
 }
 
 
 /*
- * NAME:	lmLogWait()
+ * NAME:	jfs_flush_journal()
  *
- * FUNCTION:	wait for all outstanding log records to be written to disk
+ * FUNCTION:	initiate write of any outstanding transactions to the journal
+ *		and optionally wait until they are all written to disk
+ *
+ *		wait == 0  flush until latest txn is committed, don't wait
+ *		wait == 1  flush until latest txn is committed, wait
+ *		wait > 1   flush until all txn's are complete, wait
  */
-void lmLogWait(struct jfs_log *log)
+void jfs_flush_journal(struct jfs_log *log, int wait)
 {
 	int i;
+	struct tblock *target;
 
-	jFYI(1, ("lmLogWait: log:0x%p\n", log));
+	jfs_info("jfs_flush_journal: log:0x%p wait=%d", log, wait);
 
-	if (log->cqueue.head || !list_empty(&log->synclist)) {
+	LOGGC_LOCK(log);
+
+	target = log->cqueue.head;
+
+	if (target) {
 		/*
-		 * If there was very recent activity, we may need to wait
-		 * for the lazycommit thread to catch up
+		 * This ensures that we will keep writing to the journal as long
+		 * as there are unwritten commit records
 		 */
 
+		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 (log->cqueue.head || !list_empty(&log->synclist)) {
 		for (i = 0; i < 800; i++) {	/* Too much? */
 			current->state = TASK_INTERRUPTIBLE;
 			schedule_timeout(HZ / 4);
@@ -1415,6 +1473,7 @@
 	}
 	assert(log->cqueue.head == NULL);
 	assert(list_empty(&log->synclist));
+	clear_bit(log_FLUSH, &log->flag);
 }
 
 /*
@@ -1441,9 +1500,9 @@
 	struct lbuf *bp;
 	struct logpage *lp;
 
-	jFYI(1, ("lmLogShutdown: log:0x%p\n", log));
+	jfs_info("lmLogShutdown: log:0x%p", log);
 
-	lmLogWait(log);
+	jfs_flush_journal(log, 2);
 
 	/*
 	 * We need to make sure all of the "written" metapages
@@ -1481,8 +1540,8 @@
 	lbmDirectWrite(log, bpsuper, lbmWRITE | lbmRELEASE | lbmSYNC);
 	rc = lbmIOWait(bpsuper, lbmFREE);
 
-	jFYI(1, ("lmLogShutdown: lsn:0x%x page:%d eor:%d\n",
-		 lsn, log->page, log->eor));
+	jfs_info("lmLogShutdown: lsn:0x%x page:%d eor:%d",
+		 lsn, log->page, log->eor);
 
       out:    
 	/*
@@ -1491,7 +1550,7 @@
 	lbmLogShutdown(log);
 
 	if (rc) {
-		jFYI(1, ("lmLogShutdown: exit(%d)\n", rc));
+		jfs_warn("lmLogShutdown: exit(%d)", rc);
 	}
 	return rc;
 }
@@ -1532,7 +1591,7 @@
 				break;
 			}
 		if (i == MAX_ACTIVE) {
-			jERROR(1,("Too many file systems sharing journal!\n"));
+			jfs_warn("Too many file systems sharing journal!");
 			lbmFree(bpsuper);
 			return EMFILE;	/* Is there a better rc? */
 		}
@@ -1543,7 +1602,7 @@
 				break;
 			}
 		if (i == MAX_ACTIVE) {
-			jERROR(1,("Somebody stomped on the journal!\n"));
+			jfs_warn("Somebody stomped on the journal!");
 			lbmFree(bpsuper);
 			return EIO;
 		}
@@ -1592,7 +1651,7 @@
 	int i;
 	struct lbuf *lbuf;
 
-	jFYI(1, ("lbmLogInit: log:0x%p\n", log));
+	jfs_info("lbmLogInit: log:0x%p", log);
 
 	/* initialize current buffer cursor */
 	log->bp = NULL;
@@ -1655,7 +1714,7 @@
 {
 	struct lbuf *lbuf;
 
-	jFYI(1, ("lbmLogShutdown: log:0x%p\n", log));
+	jfs_info("lbmLogShutdown: log:0x%p", log);
 
 	lbuf = log->lbuf_free;
 	while (lbuf) {
@@ -1769,7 +1828,7 @@
 	 * allocate a log buffer
 	 */
 	*bpp = bp = lbmAllocate(log, pn);
-	jFYI(1, ("lbmRead: bp:0x%p pn:0x%x\n", bp, pn));
+	jfs_info("lbmRead: bp:0x%p pn:0x%x", bp, pn);
 
 	bp->l_flag |= lbmREAD;
 	bp->l_bh.b_reqnext = NULL;
@@ -1809,8 +1868,7 @@
 	struct lbuf *tail;
 	unsigned long flags;
 
-	jFYI(1, ("lbmWrite: bp:0x%p flag:0x%x pn:0x%x\n",
-		 bp, flag, bp->l_pn));
+	jfs_info("lbmWrite: bp:0x%p flag:0x%x pn:0x%x", bp, flag, bp->l_pn);
 
 	/* map the logical block address to physical block address */
 	bp->l_blkno =
@@ -1874,8 +1932,8 @@
  */
 static void lbmDirectWrite(struct jfs_log * log, struct lbuf * bp, int flag)
 {
-	jEVENT(0, ("lbmDirectWrite: bp:0x%p flag:0x%x pn:0x%x\n",
-		   bp, flag, bp->l_pn));
+	jfs_info("lbmDirectWrite: bp:0x%p flag:0x%x pn:0x%x",
+		 bp, flag, bp->l_pn);
 
 	/*
 	 * initialize buffer for device driver
@@ -1902,9 +1960,9 @@
  *
  * serialization: LCACHE_LOCK() is NOT held during log i/o;
  */
-void lbmStartIO(struct lbuf * bp)
+static void lbmStartIO(struct lbuf * bp)
 {
-	jFYI(1, ("lbmStartIO\n"));
+	jfs_info("lbmStartIO");
 
 	bp->l_bh.b_reqnext = NULL;
 	set_bit(BH_Dirty, &bp->l_bh.b_state);
@@ -1920,8 +1978,6 @@
 
 	INCREMENT(lmStat.submitted);
 	run_task_queue(&tq_disk);
-
-	jFYI(1, ("lbmStartIO done\n"));
 }
 
 
@@ -1933,9 +1989,7 @@
 	unsigned long flags;
 	int rc = 0;
 
-	jFYI(1,
-	     ("lbmIOWait1: bp:0x%p flag:0x%x:0x%x\n", bp, bp->l_flag,
-	      flag));
+	jfs_info("lbmIOWait1: bp:0x%p flag:0x%x:0x%x", bp, bp->l_flag, flag);
 
 	LCACHE_LOCK(flags);		/* disable+lock */
 
@@ -1948,9 +2002,7 @@
 
 	LCACHE_UNLOCK(flags);	/* unlock+enable */
 
-	jFYI(1,
-	     ("lbmIOWait2: bp:0x%p flag:0x%x:0x%x\n", bp, bp->l_flag,
-	      flag));
+	jfs_info("lbmIOWait2: bp:0x%p flag:0x%x:0x%x", bp, bp->l_flag, flag);
 	return rc;
 }
 
@@ -1969,7 +2021,7 @@
 	/*
 	 * get back jfs buffer bound to the i/o buffer
 	 */
-	jEVENT(0, ("lbmIODone: bp:0x%p flag:0x%x\n", bp, bp->l_flag));
+	jfs_info("lbmIODone: bp:0x%p flag:0x%x", bp, bp->l_flag);
 
 	LCACHE_LOCK(flags);		/* disable+lock */
 
@@ -1979,7 +2031,7 @@
 	if (!uptodate) {
 		bp->l_flag |= lbmERROR;
 
-		jERROR(1, ("lbmIODone: I/O error in JFS log\n"));
+		jfs_err("lbmIODone: I/O error in JFS log");
 	}
 
 	/*
@@ -2103,8 +2155,6 @@
 {
 	struct lbuf *bp;
 
-	jFYI(1, ("jfsIOWait is here!\n"));
-
 	lock_kernel();
 
 	daemonize();
@@ -2139,7 +2189,7 @@
 		remove_wait_queue(&jfs_IO_thread_wait, &wq);
 	} while (!jfs_stop_threads);
 
-	jFYI(1,("jfsIOWait being killed!\n"));
+	jfs_info("jfsIOWait being killed!");
 	complete(&jfsIOwait);
 	return 0;
 }
@@ -2171,8 +2221,8 @@
 	int npages = 0;
 	struct lbuf *bp;
 
-	jFYI(0, ("lmLogFormat: logAddress:%Ld logSize:%d\n",
-		 (long long)logAddress, logSize));
+	jfs_info("lmLogFormat: logAddress:%Ld logSize:%d",
+		 (long long)logAddress, logSize);
 
 	/* allocate a log buffer */
 	bp = lbmAllocate(log, 1);
@@ -2288,10 +2338,14 @@
 		       "================\n"
 		       "commits = %d\n"
 		       "writes submitted = %d\n"
-		       "writes completed = %d\n",
+		       "writes completed = %d\n"
+		       "full pages submitted = %d\n"
+		       "partial pages submitted = %d\n",
 		       lmStat.commit,
 		       lmStat.submitted,
-		       lmStat.pagedone);
+		       lmStat.pagedone,
+		       lmStat.full_page,
+		       lmStat.partial_page);
 
 	begin = offset;
 	*start = buffer + begin;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)