diff options
Diffstat (limited to 'fs/jfs')
-rw-r--r-- | fs/jfs/inode.c | 4 | ||||
-rw-r--r-- | fs/jfs/jfs_dmap.c | 46 | ||||
-rw-r--r-- | fs/jfs/jfs_dtree.c | 13 | ||||
-rw-r--r-- | fs/jfs/jfs_logmgr.c | 39 | ||||
-rw-r--r-- | fs/jfs/jfs_logmgr.h | 2 | ||||
-rw-r--r-- | fs/jfs/jfs_metapage.c | 11 | ||||
-rw-r--r-- | fs/jfs/jfs_txnmgr.c | 12 | ||||
-rw-r--r-- | fs/jfs/super.c | 4 |
8 files changed, 76 insertions, 55 deletions
diff --git a/fs/jfs/inode.c b/fs/jfs/inode.c index 2137138c59b0..767c7ecb429e 100644 --- a/fs/jfs/inode.c +++ b/fs/jfs/inode.c | |||
@@ -128,6 +128,10 @@ void jfs_delete_inode(struct inode *inode) | |||
128 | { | 128 | { |
129 | jfs_info("In jfs_delete_inode, inode = 0x%p", inode); | 129 | jfs_info("In jfs_delete_inode, inode = 0x%p", inode); |
130 | 130 | ||
131 | if (is_bad_inode(inode) || | ||
132 | (JFS_IP(inode)->fileset != cpu_to_le32(FILESYSTEM_I))) | ||
133 | return; | ||
134 | |||
131 | if (test_cflag(COMMIT_Freewmap, inode)) | 135 | if (test_cflag(COMMIT_Freewmap, inode)) |
132 | jfs_free_zero_link(inode); | 136 | jfs_free_zero_link(inode); |
133 | 137 | ||
diff --git a/fs/jfs/jfs_dmap.c b/fs/jfs/jfs_dmap.c index 0732f206ca60..c739626f5bf1 100644 --- a/fs/jfs/jfs_dmap.c +++ b/fs/jfs/jfs_dmap.c | |||
@@ -75,7 +75,7 @@ static void dbAllocBits(struct bmap * bmp, struct dmap * dp, s64 blkno, | |||
75 | int nblocks); | 75 | int nblocks); |
76 | static void dbSplit(dmtree_t * tp, int leafno, int splitsz, int newval); | 76 | static void dbSplit(dmtree_t * tp, int leafno, int splitsz, int newval); |
77 | static void dbBackSplit(dmtree_t * tp, int leafno); | 77 | static void dbBackSplit(dmtree_t * tp, int leafno); |
78 | static void dbJoin(dmtree_t * tp, int leafno, int newval); | 78 | static int dbJoin(dmtree_t * tp, int leafno, int newval); |
79 | static void dbAdjTree(dmtree_t * tp, int leafno, int newval); | 79 | static void dbAdjTree(dmtree_t * tp, int leafno, int newval); |
80 | static int dbAdjCtl(struct bmap * bmp, s64 blkno, int newval, int alloc, | 80 | static int dbAdjCtl(struct bmap * bmp, s64 blkno, int newval, int alloc, |
81 | int level); | 81 | int level); |
@@ -98,8 +98,8 @@ static int dbExtend(struct inode *ip, s64 blkno, s64 nblocks, s64 addnblocks); | |||
98 | static int dbFindBits(u32 word, int l2nb); | 98 | static int dbFindBits(u32 word, int l2nb); |
99 | static int dbFindCtl(struct bmap * bmp, int l2nb, int level, s64 * blkno); | 99 | static int dbFindCtl(struct bmap * bmp, int l2nb, int level, s64 * blkno); |
100 | static int dbFindLeaf(dmtree_t * tp, int l2nb, int *leafidx); | 100 | static int dbFindLeaf(dmtree_t * tp, int l2nb, int *leafidx); |
101 | static void dbFreeBits(struct bmap * bmp, struct dmap * dp, s64 blkno, | 101 | static int dbFreeBits(struct bmap * bmp, struct dmap * dp, s64 blkno, |
102 | int nblocks); | 102 | int nblocks); |
103 | static int dbFreeDmap(struct bmap * bmp, struct dmap * dp, s64 blkno, | 103 | static int dbFreeDmap(struct bmap * bmp, struct dmap * dp, s64 blkno, |
104 | int nblocks); | 104 | int nblocks); |
105 | static int dbMaxBud(u8 * cp); | 105 | static int dbMaxBud(u8 * cp); |
@@ -378,6 +378,7 @@ int dbFree(struct inode *ip, s64 blkno, s64 nblocks) | |||
378 | 378 | ||
379 | /* free the blocks. */ | 379 | /* free the blocks. */ |
380 | if ((rc = dbFreeDmap(bmp, dp, blkno, nb))) { | 380 | if ((rc = dbFreeDmap(bmp, dp, blkno, nb))) { |
381 | jfs_error(ip->i_sb, "dbFree: error in block map\n"); | ||
381 | release_metapage(mp); | 382 | release_metapage(mp); |
382 | IREAD_UNLOCK(ipbmap); | 383 | IREAD_UNLOCK(ipbmap); |
383 | return (rc); | 384 | return (rc); |
@@ -2020,7 +2021,7 @@ static int dbFreeDmap(struct bmap * bmp, struct dmap * dp, s64 blkno, | |||
2020 | int nblocks) | 2021 | int nblocks) |
2021 | { | 2022 | { |
2022 | s8 oldroot; | 2023 | s8 oldroot; |
2023 | int rc, word; | 2024 | int rc = 0, word; |
2024 | 2025 | ||
2025 | /* save the current value of the root (i.e. maximum free string) | 2026 | /* save the current value of the root (i.e. maximum free string) |
2026 | * of the dmap tree. | 2027 | * of the dmap tree. |
@@ -2028,11 +2029,11 @@ static int dbFreeDmap(struct bmap * bmp, struct dmap * dp, s64 blkno, | |||
2028 | oldroot = dp->tree.stree[ROOT]; | 2029 | oldroot = dp->tree.stree[ROOT]; |
2029 | 2030 | ||
2030 | /* free the specified (blocks) bits */ | 2031 | /* free the specified (blocks) bits */ |
2031 | dbFreeBits(bmp, dp, blkno, nblocks); | 2032 | rc = dbFreeBits(bmp, dp, blkno, nblocks); |
2032 | 2033 | ||
2033 | /* if the root has not changed, done. */ | 2034 | /* if error or the root has not changed, done. */ |
2034 | if (dp->tree.stree[ROOT] == oldroot) | 2035 | if (rc || (dp->tree.stree[ROOT] == oldroot)) |
2035 | return (0); | 2036 | return (rc); |
2036 | 2037 | ||
2037 | /* root changed. bubble the change up to the dmap control pages. | 2038 | /* root changed. bubble the change up to the dmap control pages. |
2038 | * if the adjustment of the upper level control pages fails, | 2039 | * if the adjustment of the upper level control pages fails, |
@@ -2221,15 +2222,16 @@ static void dbAllocBits(struct bmap * bmp, struct dmap * dp, s64 blkno, | |||
2221 | * blkno - starting block number of the bits to be freed. | 2222 | * blkno - starting block number of the bits to be freed. |
2222 | * nblocks - number of bits to be freed. | 2223 | * nblocks - number of bits to be freed. |
2223 | * | 2224 | * |
2224 | * RETURN VALUES: none | 2225 | * RETURN VALUES: 0 for success |
2225 | * | 2226 | * |
2226 | * serialization: IREAD_LOCK(ipbmap) or IWRITE_LOCK(ipbmap) held on entry/exit; | 2227 | * serialization: IREAD_LOCK(ipbmap) or IWRITE_LOCK(ipbmap) held on entry/exit; |
2227 | */ | 2228 | */ |
2228 | static void dbFreeBits(struct bmap * bmp, struct dmap * dp, s64 blkno, | 2229 | static int dbFreeBits(struct bmap * bmp, struct dmap * dp, s64 blkno, |
2229 | int nblocks) | 2230 | int nblocks) |
2230 | { | 2231 | { |
2231 | int dbitno, word, rembits, nb, nwords, wbitno, nw, agno; | 2232 | int dbitno, word, rembits, nb, nwords, wbitno, nw, agno; |
2232 | dmtree_t *tp = (dmtree_t *) & dp->tree; | 2233 | dmtree_t *tp = (dmtree_t *) & dp->tree; |
2234 | int rc = 0; | ||
2233 | int size; | 2235 | int size; |
2234 | 2236 | ||
2235 | /* determine the bit number and word within the dmap of the | 2237 | /* determine the bit number and word within the dmap of the |
@@ -2278,8 +2280,10 @@ static void dbFreeBits(struct bmap * bmp, struct dmap * dp, s64 blkno, | |||
2278 | 2280 | ||
2279 | /* update the leaf for this dmap word. | 2281 | /* update the leaf for this dmap word. |
2280 | */ | 2282 | */ |
2281 | dbJoin(tp, word, | 2283 | rc = dbJoin(tp, word, |
2282 | dbMaxBud((u8 *) & dp->wmap[word])); | 2284 | dbMaxBud((u8 *) & dp->wmap[word])); |
2285 | if (rc) | ||
2286 | return rc; | ||
2283 | 2287 | ||
2284 | word += 1; | 2288 | word += 1; |
2285 | } else { | 2289 | } else { |
@@ -2310,7 +2314,9 @@ static void dbFreeBits(struct bmap * bmp, struct dmap * dp, s64 blkno, | |||
2310 | 2314 | ||
2311 | /* update the leaf. | 2315 | /* update the leaf. |
2312 | */ | 2316 | */ |
2313 | dbJoin(tp, word, size); | 2317 | rc = dbJoin(tp, word, size); |
2318 | if (rc) | ||
2319 | return rc; | ||
2314 | 2320 | ||
2315 | /* get the number of dmap words handled. | 2321 | /* get the number of dmap words handled. |
2316 | */ | 2322 | */ |
@@ -2357,6 +2363,8 @@ static void dbFreeBits(struct bmap * bmp, struct dmap * dp, s64 blkno, | |||
2357 | } | 2363 | } |
2358 | 2364 | ||
2359 | BMAP_UNLOCK(bmp); | 2365 | BMAP_UNLOCK(bmp); |
2366 | |||
2367 | return 0; | ||
2360 | } | 2368 | } |
2361 | 2369 | ||
2362 | 2370 | ||
@@ -2464,7 +2472,9 @@ dbAdjCtl(struct bmap * bmp, s64 blkno, int newval, int alloc, int level) | |||
2464 | } | 2472 | } |
2465 | dbSplit((dmtree_t *) dcp, leafno, dcp->budmin, newval); | 2473 | dbSplit((dmtree_t *) dcp, leafno, dcp->budmin, newval); |
2466 | } else { | 2474 | } else { |
2467 | dbJoin((dmtree_t *) dcp, leafno, newval); | 2475 | rc = dbJoin((dmtree_t *) dcp, leafno, newval); |
2476 | if (rc) | ||
2477 | return rc; | ||
2468 | } | 2478 | } |
2469 | 2479 | ||
2470 | /* check if the root of the current dmap control page changed due | 2480 | /* check if the root of the current dmap control page changed due |
@@ -2689,7 +2699,7 @@ static void dbBackSplit(dmtree_t * tp, int leafno) | |||
2689 | * | 2699 | * |
2690 | * RETURN VALUES: none | 2700 | * RETURN VALUES: none |
2691 | */ | 2701 | */ |
2692 | static void dbJoin(dmtree_t * tp, int leafno, int newval) | 2702 | static int dbJoin(dmtree_t * tp, int leafno, int newval) |
2693 | { | 2703 | { |
2694 | int budsz, buddy; | 2704 | int budsz, buddy; |
2695 | s8 *leaf; | 2705 | s8 *leaf; |
@@ -2729,7 +2739,9 @@ static void dbJoin(dmtree_t * tp, int leafno, int newval) | |||
2729 | if (newval > leaf[buddy]) | 2739 | if (newval > leaf[buddy]) |
2730 | break; | 2740 | break; |
2731 | 2741 | ||
2732 | assert(newval == leaf[buddy]); | 2742 | /* It shouldn't be less */ |
2743 | if (newval < leaf[buddy]) | ||
2744 | return -EIO; | ||
2733 | 2745 | ||
2734 | /* check which (leafno or buddy) is the left buddy. | 2746 | /* check which (leafno or buddy) is the left buddy. |
2735 | * the left buddy gets to claim the blocks resulting | 2747 | * the left buddy gets to claim the blocks resulting |
@@ -2761,6 +2773,8 @@ static void dbJoin(dmtree_t * tp, int leafno, int newval) | |||
2761 | /* update the leaf value. | 2773 | /* update the leaf value. |
2762 | */ | 2774 | */ |
2763 | dbAdjTree(tp, leafno, newval); | 2775 | dbAdjTree(tp, leafno, newval); |
2776 | |||
2777 | return 0; | ||
2764 | } | 2778 | } |
2765 | 2779 | ||
2766 | 2780 | ||
diff --git a/fs/jfs/jfs_dtree.c b/fs/jfs/jfs_dtree.c index 73b5fc7eda80..404f33eae507 100644 --- a/fs/jfs/jfs_dtree.c +++ b/fs/jfs/jfs_dtree.c | |||
@@ -381,9 +381,12 @@ static u32 add_index(tid_t tid, struct inode *ip, s64 bn, int slot) | |||
381 | * It's time to move the inline table to an external | 381 | * It's time to move the inline table to an external |
382 | * page and begin to build the xtree | 382 | * page and begin to build the xtree |
383 | */ | 383 | */ |
384 | if (DQUOT_ALLOC_BLOCK(ip, sbi->nbperpage) || | 384 | if (DQUOT_ALLOC_BLOCK(ip, sbi->nbperpage)) |
385 | dbAlloc(ip, 0, sbi->nbperpage, &xaddr)) | 385 | goto clean_up; |
386 | goto clean_up; /* No space */ | 386 | if (dbAlloc(ip, 0, sbi->nbperpage, &xaddr)) { |
387 | DQUOT_FREE_BLOCK(ip, sbi->nbperpage); | ||
388 | goto clean_up; | ||
389 | } | ||
387 | 390 | ||
388 | /* | 391 | /* |
389 | * Save the table, we're going to overwrite it with the | 392 | * Save the table, we're going to overwrite it with the |
@@ -397,13 +400,15 @@ static u32 add_index(tid_t tid, struct inode *ip, s64 bn, int slot) | |||
397 | xtInitRoot(tid, ip); | 400 | xtInitRoot(tid, ip); |
398 | 401 | ||
399 | /* | 402 | /* |
400 | * Allocate the first block & add it to the xtree | 403 | * Add the first block to the xtree |
401 | */ | 404 | */ |
402 | if (xtInsert(tid, ip, 0, 0, sbi->nbperpage, &xaddr, 0)) { | 405 | if (xtInsert(tid, ip, 0, 0, sbi->nbperpage, &xaddr, 0)) { |
403 | /* This really shouldn't fail */ | 406 | /* This really shouldn't fail */ |
404 | jfs_warn("add_index: xtInsert failed!"); | 407 | jfs_warn("add_index: xtInsert failed!"); |
405 | memcpy(&jfs_ip->i_dirtable, temp_table, | 408 | memcpy(&jfs_ip->i_dirtable, temp_table, |
406 | sizeof (temp_table)); | 409 | sizeof (temp_table)); |
410 | dbFree(ip, xaddr, sbi->nbperpage); | ||
411 | DQUOT_FREE_BLOCK(ip, sbi->nbperpage); | ||
407 | goto clean_up; | 412 | goto clean_up; |
408 | } | 413 | } |
409 | ip->i_size = PSIZE; | 414 | ip->i_size = PSIZE; |
diff --git a/fs/jfs/jfs_logmgr.c b/fs/jfs/jfs_logmgr.c index 79d07624bfe1..d27bac6acaa3 100644 --- a/fs/jfs/jfs_logmgr.c +++ b/fs/jfs/jfs_logmgr.c | |||
@@ -191,7 +191,7 @@ static int lbmIOWait(struct lbuf * bp, int flag); | |||
191 | static bio_end_io_t lbmIODone; | 191 | static bio_end_io_t lbmIODone; |
192 | static void lbmStartIO(struct lbuf * bp); | 192 | static void lbmStartIO(struct lbuf * bp); |
193 | static void lmGCwrite(struct jfs_log * log, int cant_block); | 193 | static void lmGCwrite(struct jfs_log * log, int cant_block); |
194 | static int lmLogSync(struct jfs_log * log, int nosyncwait); | 194 | static int lmLogSync(struct jfs_log * log, int hard_sync); |
195 | 195 | ||
196 | 196 | ||
197 | 197 | ||
@@ -915,19 +915,17 @@ static void lmPostGC(struct lbuf * bp) | |||
915 | * if new sync address is available | 915 | * if new sync address is available |
916 | * (normally the case if sync() is executed by back-ground | 916 | * (normally the case if sync() is executed by back-ground |
917 | * process). | 917 | * process). |
918 | * if not, explicitly run jfs_blogsync() to initiate | ||
919 | * getting of new sync address. | ||
920 | * calculate new value of i_nextsync which determines when | 918 | * calculate new value of i_nextsync which determines when |
921 | * this code is called again. | 919 | * this code is called again. |
922 | * | 920 | * |
923 | * PARAMETERS: log - log structure | 921 | * PARAMETERS: log - log structure |
924 | * nosyncwait - 1 if called asynchronously | 922 | * hard_sync - 1 to force all metadata to be written |
925 | * | 923 | * |
926 | * RETURN: 0 | 924 | * RETURN: 0 |
927 | * | 925 | * |
928 | * serialization: LOG_LOCK() held on entry/exit | 926 | * serialization: LOG_LOCK() held on entry/exit |
929 | */ | 927 | */ |
930 | static int lmLogSync(struct jfs_log * log, int nosyncwait) | 928 | static int lmLogSync(struct jfs_log * log, int hard_sync) |
931 | { | 929 | { |
932 | int logsize; | 930 | int logsize; |
933 | int written; /* written since last syncpt */ | 931 | int written; /* written since last syncpt */ |
@@ -941,11 +939,18 @@ static int lmLogSync(struct jfs_log * log, int nosyncwait) | |||
941 | unsigned long flags; | 939 | unsigned long flags; |
942 | 940 | ||
943 | /* push dirty metapages out to disk */ | 941 | /* push dirty metapages out to disk */ |
944 | list_for_each_entry(sbi, &log->sb_list, log_list) { | 942 | if (hard_sync) |
945 | filemap_flush(sbi->ipbmap->i_mapping); | 943 | list_for_each_entry(sbi, &log->sb_list, log_list) { |
946 | filemap_flush(sbi->ipimap->i_mapping); | 944 | filemap_fdatawrite(sbi->ipbmap->i_mapping); |
947 | filemap_flush(sbi->direct_inode->i_mapping); | 945 | filemap_fdatawrite(sbi->ipimap->i_mapping); |
948 | } | 946 | filemap_fdatawrite(sbi->direct_inode->i_mapping); |
947 | } | ||
948 | else | ||
949 | list_for_each_entry(sbi, &log->sb_list, log_list) { | ||
950 | filemap_flush(sbi->ipbmap->i_mapping); | ||
951 | filemap_flush(sbi->ipimap->i_mapping); | ||
952 | filemap_flush(sbi->direct_inode->i_mapping); | ||
953 | } | ||
949 | 954 | ||
950 | /* | 955 | /* |
951 | * forward syncpt | 956 | * forward syncpt |
@@ -1021,16 +1026,13 @@ static int lmLogSync(struct jfs_log * log, int nosyncwait) | |||
1021 | /* next syncpt trigger = written + more */ | 1026 | /* next syncpt trigger = written + more */ |
1022 | log->nextsync = written + more; | 1027 | log->nextsync = written + more; |
1023 | 1028 | ||
1024 | /* return if lmLogSync() from outside of transaction, e.g., sync() */ | ||
1025 | if (nosyncwait) | ||
1026 | return lsn; | ||
1027 | |||
1028 | /* if number of bytes written from last sync point is more | 1029 | /* if number of bytes written from last sync point is more |
1029 | * than 1/4 of the log size, stop new transactions from | 1030 | * than 1/4 of the log size, stop new transactions from |
1030 | * starting until all current transactions are completed | 1031 | * starting until all current transactions are completed |
1031 | * by setting syncbarrier flag. | 1032 | * by setting syncbarrier flag. |
1032 | */ | 1033 | */ |
1033 | if (written > LOGSYNC_BARRIER(logsize) && logsize > 32 * LOGPSIZE) { | 1034 | if (!test_bit(log_SYNCBARRIER, &log->flag) && |
1035 | (written > LOGSYNC_BARRIER(logsize)) && log->active) { | ||
1034 | set_bit(log_SYNCBARRIER, &log->flag); | 1036 | set_bit(log_SYNCBARRIER, &log->flag); |
1035 | jfs_info("log barrier on: lsn=0x%x syncpt=0x%x", lsn, | 1037 | jfs_info("log barrier on: lsn=0x%x syncpt=0x%x", lsn, |
1036 | log->syncpt); | 1038 | log->syncpt); |
@@ -1048,11 +1050,12 @@ static int lmLogSync(struct jfs_log * log, int nosyncwait) | |||
1048 | * | 1050 | * |
1049 | * FUNCTION: write log SYNCPT record for specified log | 1051 | * FUNCTION: write log SYNCPT record for specified log |
1050 | * | 1052 | * |
1051 | * PARAMETERS: log - log structure | 1053 | * PARAMETERS: log - log structure |
1054 | * hard_sync - set to 1 to force metadata to be written | ||
1052 | */ | 1055 | */ |
1053 | void jfs_syncpt(struct jfs_log *log) | 1056 | void jfs_syncpt(struct jfs_log *log, int hard_sync) |
1054 | { LOG_LOCK(log); | 1057 | { LOG_LOCK(log); |
1055 | lmLogSync(log, 1); | 1058 | lmLogSync(log, hard_sync); |
1056 | LOG_UNLOCK(log); | 1059 | LOG_UNLOCK(log); |
1057 | } | 1060 | } |
1058 | 1061 | ||
diff --git a/fs/jfs/jfs_logmgr.h b/fs/jfs/jfs_logmgr.h index 747114cd38b8..e4978b5b65ee 100644 --- a/fs/jfs/jfs_logmgr.h +++ b/fs/jfs/jfs_logmgr.h | |||
@@ -510,6 +510,6 @@ extern int lmLogFormat(struct jfs_log *log, s64 logAddress, int logSize); | |||
510 | extern int lmGroupCommit(struct jfs_log *, struct tblock *); | 510 | extern int lmGroupCommit(struct jfs_log *, struct tblock *); |
511 | extern int jfsIOWait(void *); | 511 | extern int jfsIOWait(void *); |
512 | extern void jfs_flush_journal(struct jfs_log * log, int wait); | 512 | extern void jfs_flush_journal(struct jfs_log * log, int wait); |
513 | extern void jfs_syncpt(struct jfs_log *log); | 513 | extern void jfs_syncpt(struct jfs_log *log, int hard_sync); |
514 | 514 | ||
515 | #endif /* _H_JFS_LOGMGR */ | 515 | #endif /* _H_JFS_LOGMGR */ |
diff --git a/fs/jfs/jfs_metapage.c b/fs/jfs/jfs_metapage.c index 6c5485d16c39..13d7e3f1feb4 100644 --- a/fs/jfs/jfs_metapage.c +++ b/fs/jfs/jfs_metapage.c | |||
@@ -561,7 +561,6 @@ static int metapage_releasepage(struct page *page, int gfp_mask) | |||
561 | dump_mem("page", page, sizeof(struct page)); | 561 | dump_mem("page", page, sizeof(struct page)); |
562 | dump_stack(); | 562 | dump_stack(); |
563 | } | 563 | } |
564 | WARN_ON(mp->lsn); | ||
565 | if (mp->lsn) | 564 | if (mp->lsn) |
566 | remove_from_logsync(mp); | 565 | remove_from_logsync(mp); |
567 | remove_metapage(page, mp); | 566 | remove_metapage(page, mp); |
@@ -641,7 +640,7 @@ struct metapage *__get_metapage(struct inode *inode, unsigned long lblock, | |||
641 | } else { | 640 | } else { |
642 | page = read_cache_page(mapping, page_index, | 641 | page = read_cache_page(mapping, page_index, |
643 | (filler_t *)mapping->a_ops->readpage, NULL); | 642 | (filler_t *)mapping->a_ops->readpage, NULL); |
644 | if (IS_ERR(page)) { | 643 | if (IS_ERR(page) || !PageUptodate(page)) { |
645 | jfs_err("read_cache_page failed!"); | 644 | jfs_err("read_cache_page failed!"); |
646 | return NULL; | 645 | return NULL; |
647 | } | 646 | } |
@@ -783,14 +782,6 @@ void release_metapage(struct metapage * mp) | |||
783 | if (test_bit(META_discard, &mp->flag) && !mp->count) { | 782 | if (test_bit(META_discard, &mp->flag) && !mp->count) { |
784 | clear_page_dirty(page); | 783 | clear_page_dirty(page); |
785 | ClearPageUptodate(page); | 784 | ClearPageUptodate(page); |
786 | #ifdef _NOT_YET | ||
787 | if (page->mapping) { | ||
788 | /* Remove from page cache and page cache reference */ | ||
789 | remove_from_page_cache(page); | ||
790 | page_cache_release(page); | ||
791 | metapage_releasepage(page, 0); | ||
792 | } | ||
793 | #endif | ||
794 | } | 785 | } |
795 | #else | 786 | #else |
796 | /* Try to keep metapages from using up too much memory */ | 787 | /* Try to keep metapages from using up too much memory */ |
diff --git a/fs/jfs/jfs_txnmgr.c b/fs/jfs/jfs_txnmgr.c index 121c981ff453..c7a92f9deb2b 100644 --- a/fs/jfs/jfs_txnmgr.c +++ b/fs/jfs/jfs_txnmgr.c | |||
@@ -552,6 +552,11 @@ void txEnd(tid_t tid) | |||
552 | * synchronize with logsync barrier | 552 | * synchronize with logsync barrier |
553 | */ | 553 | */ |
554 | if (test_bit(log_SYNCBARRIER, &log->flag)) { | 554 | if (test_bit(log_SYNCBARRIER, &log->flag)) { |
555 | TXN_UNLOCK(); | ||
556 | |||
557 | /* write dirty metadata & forward log syncpt */ | ||
558 | jfs_syncpt(log, 1); | ||
559 | |||
555 | jfs_info("log barrier off: 0x%x", log->lsn); | 560 | jfs_info("log barrier off: 0x%x", log->lsn); |
556 | 561 | ||
557 | /* enable new transactions start */ | 562 | /* enable new transactions start */ |
@@ -560,11 +565,6 @@ void txEnd(tid_t tid) | |||
560 | /* wakeup all waitors for logsync barrier */ | 565 | /* wakeup all waitors for logsync barrier */ |
561 | TXN_WAKEUP(&log->syncwait); | 566 | TXN_WAKEUP(&log->syncwait); |
562 | 567 | ||
563 | TXN_UNLOCK(); | ||
564 | |||
565 | /* forward log syncpt */ | ||
566 | jfs_syncpt(log); | ||
567 | |||
568 | goto wakeup; | 568 | goto wakeup; |
569 | } | 569 | } |
570 | } | 570 | } |
@@ -657,7 +657,9 @@ struct tlock *txLock(tid_t tid, struct inode *ip, struct metapage * mp, | |||
657 | /* only anonymous txn. | 657 | /* only anonymous txn. |
658 | * Remove from anon_list | 658 | * Remove from anon_list |
659 | */ | 659 | */ |
660 | TXN_LOCK(); | ||
660 | list_del_init(&jfs_ip->anon_inode_list); | 661 | list_del_init(&jfs_ip->anon_inode_list); |
662 | TXN_UNLOCK(); | ||
661 | } | 663 | } |
662 | jfs_ip->atlhead = tlck->next; | 664 | jfs_ip->atlhead = tlck->next; |
663 | } else { | 665 | } else { |
diff --git a/fs/jfs/super.c b/fs/jfs/super.c index ee32211288ce..9ff89720f93b 100644 --- a/fs/jfs/super.c +++ b/fs/jfs/super.c | |||
@@ -114,6 +114,8 @@ static void jfs_destroy_inode(struct inode *inode) | |||
114 | { | 114 | { |
115 | struct jfs_inode_info *ji = JFS_IP(inode); | 115 | struct jfs_inode_info *ji = JFS_IP(inode); |
116 | 116 | ||
117 | BUG_ON(!list_empty(&ji->anon_inode_list)); | ||
118 | |||
117 | spin_lock_irq(&ji->ag_lock); | 119 | spin_lock_irq(&ji->ag_lock); |
118 | if (ji->active_ag != -1) { | 120 | if (ji->active_ag != -1) { |
119 | struct bmap *bmap = JFS_SBI(inode->i_sb)->bmap; | 121 | struct bmap *bmap = JFS_SBI(inode->i_sb)->bmap; |
@@ -531,7 +533,7 @@ static int jfs_sync_fs(struct super_block *sb, int wait) | |||
531 | /* log == NULL indicates read-only mount */ | 533 | /* log == NULL indicates read-only mount */ |
532 | if (log) { | 534 | if (log) { |
533 | jfs_flush_journal(log, wait); | 535 | jfs_flush_journal(log, wait); |
534 | jfs_syncpt(log); | 536 | jfs_syncpt(log, 0); |
535 | } | 537 | } |
536 | 538 | ||
537 | return 0; | 539 | return 0; |