patch-2.4.23 linux-2.4.23/fs/jfs/jfs_txnmgr.c
Next file: linux-2.4.23/fs/jfs/jfs_unicode.c
Previous file: linux-2.4.23/fs/jfs/jfs_superblock.h
Back to the patch index
Back to the overall index
- Lines: 116
- Date:
2003-11-28 10:26:21.000000000 -0800
- Orig file:
linux-2.4.22/fs/jfs/jfs_txnmgr.c
- Orig date:
2003-06-13 07:51:37.000000000 -0700
diff -urN linux-2.4.22/fs/jfs/jfs_txnmgr.c linux-2.4.23/fs/jfs/jfs_txnmgr.c
@@ -1,6 +1,6 @@
/*
- * Copyright (c) International Business Machines Corp., 2000-2002
- * Portions Copyright (c) Christoph Hellwig, 2001-2002
+ * Copyright (C) International Business Machines Corp., 2000-2003
+ * Portions Copyright (C) Christoph Hellwig, 2001-2002
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -177,7 +177,7 @@
struct tlock * tlck);
void mapLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
struct tlock * tlck);
-void txAbortCommit(struct commit * cd, int exval);
+static void txAbortCommit(struct commit * cd);
static void txAllocPMap(struct inode *ip, struct maplock * maplock,
struct tblock * tblk);
void txForce(struct tblock * tblk);
@@ -256,7 +256,7 @@
size = sizeof(struct tblock) * nTxBlock;
TxBlock = (struct tblock *) vmalloc(size);
if (TxBlock == NULL)
- return ENOMEM;
+ return -ENOMEM;
for (k = 1; k < nTxBlock - 1; k++) {
TxBlock[k].next = k + 1;
@@ -282,7 +282,7 @@
TxLock = (struct tlock *) vmalloc(size);
if (TxLock == NULL) {
vfree(TxBlock);
- return ENOMEM;
+ return -ENOMEM;
}
/* initialize tlock table */
@@ -1099,7 +1099,7 @@
struct inode **iplist, /* list of inode to commit */
int flag)
{
- int rc = 0, rc1 = 0;
+ int rc = 0;
struct commit cd;
struct jfs_log *log;
struct tblock *tblk;
@@ -1114,7 +1114,7 @@
jfs_info("txCommit, tid = %d, flag = %d", tid, flag);
/* is read-only file system ? */
if (isReadOnly(iplist[0])) {
- rc = EROFS;
+ rc = -EROFS;
goto TheEnd;
}
@@ -1297,9 +1297,7 @@
out:
if (rc != 0)
- txAbortCommit(&cd, rc);
- else
- rc = rc1;
+ txAbortCommit(&cd);
TheEnd:
jfs_info("txCommit: tid = %d, returning %d", tid, rc);
@@ -1424,7 +1422,6 @@
* page is not itself logged, to prevent pageout of the map
* page before the log;
*/
- assert(tlck->type & tlckFREE);
/* log LOG_NOREDOINOEXT of the freed inode extent for
* logredo() to start NoRedoPage filters, and to update
@@ -2637,7 +2634,7 @@
* mark filesystem dirty
*/
if (dirty)
- updateSuper(tblk->sb, FM_DIRTY);
+ jfs_error(tblk->sb, "txAbort");
return;
}
@@ -2654,14 +2651,13 @@
* log age of page-frames in memory for which caller has
* are reset to 0 (to avoid logwarap).
*/
-void txAbortCommit(struct commit * cd, int exval)
+static void txAbortCommit(struct commit * cd)
{
struct tblock *tblk;
tid_t tid;
lid_t lid, next;
struct metapage *mp;
- assert(exval == EIO || exval == ENOMEM);
jfs_warn("txAbortCommit: cd:0x%p", cd);
/*
@@ -2697,7 +2693,7 @@
/*
* mark filesystem dirty
*/
- updateSuper(cd->sb, FM_DIRTY);
+ jfs_error(cd->sb, "txAbortCommit");
}
@@ -2718,7 +2714,7 @@
/* We must have gotten ahead of the user thread
*/
jfs_info("txLazyCommit: tblk 0x%p not unlocked", tblk);
- schedule();
+ yield();
}
jfs_info("txLazyCommit: processing tblk 0x%p", tblk);
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)