static void lbmDirectWrite(log_t * log, lbuf_t * bp, int flag);
static int lbmIOWait(lbuf_t * bp, int flag);
static bio_end_io_t lbmIODone;
-#ifdef _STILL_TO_PORT
-static void lbmDirectIODone(iobuf_t * ddbp);
-#endif /* _STILL_TO_PORT */
+
void lbmStartIO(lbuf_t * bp);
void lmGCwrite(log_t * log, int cant_block);
}
-#ifdef _THIS_IS_NOT_USED
-/*
- * lbmRelease()
- *
- * remove the log buffer from log device write queue;
- */
-static void lbmRelease(log_t * log, uint flag)
-{
- lbuf_t *bp, *tail;
- unsigned long flags;
-
- bp = log->bp;
-
- LCACHE_LOCK(flags);
-
- tail = log->wqueue;
-
- /* single element queue */
- if (bp == tail) {
- log->wqueue = NULL;
- bp->l_wqnext = NULL;
- }
- /* multi element queue */
- else {
- tail->l_wqnext = bp->l_wqnext;
- bp->l_wqnext = NULL;
- }
-
- if (flag & lbmFREE)
- lbmfree(bp);
-
- LCACHE_UNLOCK(flags);
-}
-#endif /* _THIS_IS_NOT_USED */
-
-
/*
* NAME: lbmRedrive
*
}
-#ifdef _STILL_TO_PORT
-/*
- * lbmDirectIODone()
- *
- * iodone() for lbmDirectWrite() to bypass write queue;
- * executed at INTIODONE level;
- */
-static void lbmDirectIODone(iobuf_t * iobp)
-{
- lbuf_t *bp;
- unsigned long flags;
-
- /*
- * get back jfs buffer bound to the io buffer
- */
- bp = (lbuf_t *) iobp->b_jfsbp;
- jEVENT(0,
- ("lbmDirectIODone: bp:0x%p flag:0x%x\n", bp, bp->l_flag));
-
- LCACHE_LOCK(flags); /* disable+lock */
-
- bp->l_flag |= lbmDONE;
-
- if (iobp->b_flags & B_ERROR) {
- bp->l_flag |= lbmERROR;
-#ifdef _JFS_OS2
- SysLogError();
-#endif
- }
-
- /*
- * pageout completion
- */
- bp->l_flag &= ~lbmWRITE;
-
- /*
- * synchronous pageout:
- */
- if (bp->l_flag & lbmSYNC) {
- LCACHE_UNLOCK(flags); /* unlock+enable */
-
- /* wakeup I/O initiator */
- LCACHE_WAKEUP(&bp->l_ioevent);
- }
- /*
- * asynchronous pageout:
- */
- else {
- assert(bp->l_flag & lbmRELEASE);
- assert(bp->l_flag & lbmFREE);
- lbmfree(bp);
-
- LCACHE_UNLOCK(flags); /* unlock+enable */
- }
-}
-#endif /* _STILL_TO_PORT */
-
#ifdef _STILL_TO_PORT
/*
* NAME: lmLogFormat()/jfs_logform()
*/
s64 commitZeroLink(tid_t tid, struct inode *ip)
{
- int filetype, committype;
+ int filetype;
tblock_t *tblk;
jFYI(1, ("commitZeroLink: tid = %d, ip = 0x%p\n", tid, ip));
return 0;
}
-#ifdef _STILL_TO_PORT
- /*
- * free from block allocation map:
- *
- * if there is no cache control element associated with
- * the file, free resources in both persistent and work map;
- * otherwise just persistent map.
- */
- if (ip->i_cacheid) {
- committype = COMMIT_PMAP;
-
- /* mark for iClose() to free from working map */
- set_cflag(COMMIT_Freewmap, ip);
- } else
- committype = COMMIT_PWMAP;
-#else /* _STILL_TO_PORT */
-
set_cflag(COMMIT_Freewmap, ip);
- committype = COMMIT_PMAP;
-#endif /* _STILL_TO_PORT */
/* mark transaction of block map update type */
tblk = tid_to_tblock(tid);
- tblk->xflag |= committype;
+ tblk->xflag |= COMMIT_PMAP;
/*
* free EA
*/
- if (JFS_IP(ip)->ea.flag & DXD_EXTENT) {
-#ifdef _STILL_TO_PORT
- /* free EA pages from cache */
- if (committype == COMMIT_PWMAP)
- bmExtentInvalidate(ip, addressDXD(&ip->i_ea),
- lengthDXD(&ip->i_ea));
-#endif /* _STILL_TO_PORT */
-
+ if (JFS_IP(ip)->ea.flag & DXD_EXTENT)
/* acquire maplock on EA to be freed from block map */
txEA(tid, ip, &JFS_IP(ip)->ea, NULL);
- if (committype == COMMIT_PWMAP)
- JFS_IP(ip)->ea.flag = 0;
- }
-
/*
* free ACL
*/
- if (JFS_IP(ip)->acl.flag & DXD_EXTENT) {
-#ifdef _STILL_TO_PORT
- /* free ACL pages from cache */
- if (committype == COMMIT_PWMAP)
- bmExtentInvalidate(ip, addressDXD(&ip->i_acl),
- lengthDXD(&ip->i_acl));
-#endif /* _STILL_TO_PORT */
-
+ if (JFS_IP(ip)->acl.flag & DXD_EXTENT)
/* acquire maplock on EA to be freed from block map */
txEA(tid, ip, &JFS_IP(ip)->acl, NULL);
- if (committype == COMMIT_PWMAP)
- JFS_IP(ip)->acl.flag = 0;
- }
-
/*
* free xtree/data (truncate to zero length):
* free xtree/data pages from cache if COMMIT_PWMAP,