aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-01-25 15:20:32 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2008-01-25 15:20:32 -0500
commit2d94dfc8c38edf63e91e48fd55c3a8822b6a9ced (patch)
treecbb8ab94e53deb22970094db374ab3494345ab3a
parentb47711bfbcd4eb77ca61ef0162487b20e023ae55 (diff)
parent5c5e32ceeb6b64496a1842d5d99e4ac8d20166c4 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/shaggy/jfs-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/shaggy/jfs-2.6: mount options: fix jfs JFS: simplify types to get rid of sparse warning JFS: FIx one more plain integer as NULL pointer warning JFS: Remove defconfig ptr comparison to 0 JFS: use DIV_ROUND_UP where appropriate Remove unnecessary kmalloc casts in the jfs filesystem JFS is missing a memory barrier JFS: Make sure special inode data is written after journal is flushed JFS: clear PAGECACHE_TAG_DIRTY for no-write pages
-rw-r--r--fs/jfs/jfs_dtree.c27
-rw-r--r--fs/jfs/jfs_dtree.h4
-rw-r--r--fs/jfs/jfs_imap.c4
-rw-r--r--fs/jfs/jfs_logmgr.c34
-rw-r--r--fs/jfs/jfs_metapage.c43
-rw-r--r--fs/jfs/jfs_mount.c2
-rw-r--r--fs/jfs/jfs_umount.c4
-rw-r--r--fs/jfs/namei.c4
-rw-r--r--fs/jfs/resize.c2
-rw-r--r--fs/jfs/super.c6
10 files changed, 68 insertions, 62 deletions
diff --git a/fs/jfs/jfs_dtree.c b/fs/jfs/jfs_dtree.c
index df25ecc418af..4dcc05819998 100644
--- a/fs/jfs/jfs_dtree.c
+++ b/fs/jfs/jfs_dtree.c
@@ -284,11 +284,11 @@ static struct dir_table_slot *find_index(struct inode *ip, u32 index,
284 release_metapage(*mp); 284 release_metapage(*mp);
285 *mp = NULL; 285 *mp = NULL;
286 } 286 }
287 if (*mp == 0) { 287 if (!(*mp)) {
288 *lblock = blkno; 288 *lblock = blkno;
289 *mp = read_index_page(ip, blkno); 289 *mp = read_index_page(ip, blkno);
290 } 290 }
291 if (*mp == 0) { 291 if (!(*mp)) {
292 jfs_err("free_index: error reading directory table"); 292 jfs_err("free_index: error reading directory table");
293 return NULL; 293 return NULL;
294 } 294 }
@@ -413,7 +413,8 @@ static u32 add_index(tid_t tid, struct inode *ip, s64 bn, int slot)
413 } 413 }
414 ip->i_size = PSIZE; 414 ip->i_size = PSIZE;
415 415
416 if ((mp = get_index_page(ip, 0)) == 0) { 416 mp = get_index_page(ip, 0);
417 if (!mp) {
417 jfs_err("add_index: get_metapage failed!"); 418 jfs_err("add_index: get_metapage failed!");
418 xtTruncate(tid, ip, 0, COMMIT_PWMAP); 419 xtTruncate(tid, ip, 0, COMMIT_PWMAP);
419 memcpy(&jfs_ip->i_dirtable, temp_table, 420 memcpy(&jfs_ip->i_dirtable, temp_table,
@@ -461,7 +462,7 @@ static u32 add_index(tid_t tid, struct inode *ip, s64 bn, int slot)
461 } else 462 } else
462 mp = read_index_page(ip, blkno); 463 mp = read_index_page(ip, blkno);
463 464
464 if (mp == 0) { 465 if (!mp) {
465 jfs_err("add_index: get/read_metapage failed!"); 466 jfs_err("add_index: get/read_metapage failed!");
466 goto clean_up; 467 goto clean_up;
467 } 468 }
@@ -499,7 +500,7 @@ static void free_index(tid_t tid, struct inode *ip, u32 index, u32 next)
499 500
500 dirtab_slot = find_index(ip, index, &mp, &lblock); 501 dirtab_slot = find_index(ip, index, &mp, &lblock);
501 502
502 if (dirtab_slot == 0) 503 if (!dirtab_slot)
503 return; 504 return;
504 505
505 dirtab_slot->flag = DIR_INDEX_FREE; 506 dirtab_slot->flag = DIR_INDEX_FREE;
@@ -526,7 +527,7 @@ static void modify_index(tid_t tid, struct inode *ip, u32 index, s64 bn,
526 527
527 dirtab_slot = find_index(ip, index, mp, lblock); 528 dirtab_slot = find_index(ip, index, mp, lblock);
528 529
529 if (dirtab_slot == 0) 530 if (!dirtab_slot)
530 return; 531 return;
531 532
532 DTSaddress(dirtab_slot, bn); 533 DTSaddress(dirtab_slot, bn);
@@ -552,7 +553,7 @@ static int read_index(struct inode *ip, u32 index,
552 struct dir_table_slot *slot; 553 struct dir_table_slot *slot;
553 554
554 slot = find_index(ip, index, &mp, &lblock); 555 slot = find_index(ip, index, &mp, &lblock);
555 if (slot == 0) { 556 if (!slot) {
556 return -EIO; 557 return -EIO;
557 } 558 }
558 559
@@ -592,10 +593,8 @@ int dtSearch(struct inode *ip, struct component_name * key, ino_t * data,
592 struct component_name ciKey; 593 struct component_name ciKey;
593 struct super_block *sb = ip->i_sb; 594 struct super_block *sb = ip->i_sb;
594 595
595 ciKey.name = 596 ciKey.name = kmalloc((JFS_NAME_MAX + 1) * sizeof(wchar_t), GFP_NOFS);
596 (wchar_t *) kmalloc((JFS_NAME_MAX + 1) * sizeof(wchar_t), 597 if (!ciKey.name) {
597 GFP_NOFS);
598 if (ciKey.name == 0) {
599 rc = -ENOMEM; 598 rc = -ENOMEM;
600 goto dtSearch_Exit2; 599 goto dtSearch_Exit2;
601 } 600 }
@@ -957,10 +956,8 @@ static int dtSplitUp(tid_t tid,
957 smp = split->mp; 956 smp = split->mp;
958 sp = DT_PAGE(ip, smp); 957 sp = DT_PAGE(ip, smp);
959 958
960 key.name = 959 key.name = kmalloc((JFS_NAME_MAX + 2) * sizeof(wchar_t), GFP_NOFS);
961 (wchar_t *) kmalloc((JFS_NAME_MAX + 2) * sizeof(wchar_t), 960 if (!key.name) {
962 GFP_NOFS);
963 if (key.name == 0) {
964 DT_PUTPAGE(smp); 961 DT_PUTPAGE(smp);
965 rc = -ENOMEM; 962 rc = -ENOMEM;
966 goto dtSplitUp_Exit; 963 goto dtSplitUp_Exit;
diff --git a/fs/jfs/jfs_dtree.h b/fs/jfs/jfs_dtree.h
index 8561c6ecece0..cdac2d5bafeb 100644
--- a/fs/jfs/jfs_dtree.h
+++ b/fs/jfs/jfs_dtree.h
@@ -74,7 +74,7 @@ struct idtentry {
74#define DTIHDRDATALEN 11 74#define DTIHDRDATALEN 11
75 75
76/* compute number of slots for entry */ 76/* compute number of slots for entry */
77#define NDTINTERNAL(klen) ( ((4 + (klen)) + (15 - 1)) / 15 ) 77#define NDTINTERNAL(klen) (DIV_ROUND_UP((4 + (klen)), 15))
78 78
79 79
80/* 80/*
@@ -133,7 +133,7 @@ struct dir_table_slot {
133 ( ((s64)((dts)->addr1)) << 32 | __le32_to_cpu((dts)->addr2) ) 133 ( ((s64)((dts)->addr1)) << 32 | __le32_to_cpu((dts)->addr2) )
134 134
135/* compute number of slots for entry */ 135/* compute number of slots for entry */
136#define NDTLEAF_LEGACY(klen) ( ((2 + (klen)) + (15 - 1)) / 15 ) 136#define NDTLEAF_LEGACY(klen) (DIV_ROUND_UP((2 + (klen)), 15))
137#define NDTLEAF NDTINTERNAL 137#define NDTLEAF NDTINTERNAL
138 138
139 139
diff --git a/fs/jfs/jfs_imap.c b/fs/jfs/jfs_imap.c
index 3870ba8b9086..9bf29f771737 100644
--- a/fs/jfs/jfs_imap.c
+++ b/fs/jfs/jfs_imap.c
@@ -381,7 +381,7 @@ int diRead(struct inode *ip)
381 381
382 /* read the page of disk inode */ 382 /* read the page of disk inode */
383 mp = read_metapage(ipimap, pageno << sbi->l2nbperpage, PSIZE, 1); 383 mp = read_metapage(ipimap, pageno << sbi->l2nbperpage, PSIZE, 1);
384 if (mp == 0) { 384 if (!mp) {
385 jfs_err("diRead: read_metapage failed"); 385 jfs_err("diRead: read_metapage failed");
386 return -EIO; 386 return -EIO;
387 } 387 }
@@ -654,7 +654,7 @@ int diWrite(tid_t tid, struct inode *ip)
654 /* read the page of disk inode */ 654 /* read the page of disk inode */
655 retry: 655 retry:
656 mp = read_metapage(ipimap, pageno << sbi->l2nbperpage, PSIZE, 1); 656 mp = read_metapage(ipimap, pageno << sbi->l2nbperpage, PSIZE, 1);
657 if (mp == 0) 657 if (!mp)
658 return -EIO; 658 return -EIO;
659 659
660 /* get the pointer to the disk inode */ 660 /* get the pointer to the disk inode */
diff --git a/fs/jfs/jfs_logmgr.c b/fs/jfs/jfs_logmgr.c
index 15a3974cdeeb..325a9679b95a 100644
--- a/fs/jfs/jfs_logmgr.c
+++ b/fs/jfs/jfs_logmgr.c
@@ -208,6 +208,17 @@ static struct lmStat {
208} lmStat; 208} lmStat;
209#endif 209#endif
210 210
211static void write_special_inodes(struct jfs_log *log,
212 int (*writer)(struct address_space *))
213{
214 struct jfs_sb_info *sbi;
215
216 list_for_each_entry(sbi, &log->sb_list, log_list) {
217 writer(sbi->ipbmap->i_mapping);
218 writer(sbi->ipimap->i_mapping);
219 writer(sbi->direct_inode->i_mapping);
220 }
221}
211 222
212/* 223/*
213 * NAME: lmLog() 224 * NAME: lmLog()
@@ -935,22 +946,13 @@ static int lmLogSync(struct jfs_log * log, int hard_sync)
935 struct lrd lrd; 946 struct lrd lrd;
936 int lsn; 947 int lsn;
937 struct logsyncblk *lp; 948 struct logsyncblk *lp;
938 struct jfs_sb_info *sbi;
939 unsigned long flags; 949 unsigned long flags;
940 950
941 /* push dirty metapages out to disk */ 951 /* push dirty metapages out to disk */
942 if (hard_sync) 952 if (hard_sync)
943 list_for_each_entry(sbi, &log->sb_list, log_list) { 953 write_special_inodes(log, filemap_fdatawrite);
944 filemap_fdatawrite(sbi->ipbmap->i_mapping);
945 filemap_fdatawrite(sbi->ipimap->i_mapping);
946 filemap_fdatawrite(sbi->direct_inode->i_mapping);
947 }
948 else 954 else
949 list_for_each_entry(sbi, &log->sb_list, log_list) { 955 write_special_inodes(log, filemap_flush);
950 filemap_flush(sbi->ipbmap->i_mapping);
951 filemap_flush(sbi->ipimap->i_mapping);
952 filemap_flush(sbi->direct_inode->i_mapping);
953 }
954 956
955 /* 957 /*
956 * forward syncpt 958 * forward syncpt
@@ -1536,7 +1538,6 @@ void jfs_flush_journal(struct jfs_log *log, int wait)
1536{ 1538{
1537 int i; 1539 int i;
1538 struct tblock *target = NULL; 1540 struct tblock *target = NULL;
1539 struct jfs_sb_info *sbi;
1540 1541
1541 /* jfs_write_inode may call us during read-only mount */ 1542 /* jfs_write_inode may call us during read-only mount */
1542 if (!log) 1543 if (!log)
@@ -1598,11 +1599,7 @@ void jfs_flush_journal(struct jfs_log *log, int wait)
1598 if (wait < 2) 1599 if (wait < 2)
1599 return; 1600 return;
1600 1601
1601 list_for_each_entry(sbi, &log->sb_list, log_list) { 1602 write_special_inodes(log, filemap_fdatawrite);
1602 filemap_fdatawrite(sbi->ipbmap->i_mapping);
1603 filemap_fdatawrite(sbi->ipimap->i_mapping);
1604 filemap_fdatawrite(sbi->direct_inode->i_mapping);
1605 }
1606 1603
1607 /* 1604 /*
1608 * If there was recent activity, we may need to wait 1605 * If there was recent activity, we may need to wait
@@ -1611,6 +1608,7 @@ void jfs_flush_journal(struct jfs_log *log, int wait)
1611 if ((!list_empty(&log->cqueue)) || !list_empty(&log->synclist)) { 1608 if ((!list_empty(&log->cqueue)) || !list_empty(&log->synclist)) {
1612 for (i = 0; i < 200; i++) { /* Too much? */ 1609 for (i = 0; i < 200; i++) { /* Too much? */
1613 msleep(250); 1610 msleep(250);
1611 write_special_inodes(log, filemap_fdatawrite);
1614 if (list_empty(&log->cqueue) && 1612 if (list_empty(&log->cqueue) &&
1615 list_empty(&log->synclist)) 1613 list_empty(&log->synclist))
1616 break; 1614 break;
@@ -2347,7 +2345,7 @@ int jfsIOWait(void *arg)
2347 2345
2348 do { 2346 do {
2349 spin_lock_irq(&log_redrive_lock); 2347 spin_lock_irq(&log_redrive_lock);
2350 while ((bp = log_redrive_list) != 0) { 2348 while ((bp = log_redrive_list)) {
2351 log_redrive_list = bp->l_redrive_next; 2349 log_redrive_list = bp->l_redrive_next;
2352 bp->l_redrive_next = NULL; 2350 bp->l_redrive_next = NULL;
2353 spin_unlock_irq(&log_redrive_lock); 2351 spin_unlock_irq(&log_redrive_lock);
diff --git a/fs/jfs/jfs_metapage.c b/fs/jfs/jfs_metapage.c
index f5cd8d38af7a..d1e64f2f2fcd 100644
--- a/fs/jfs/jfs_metapage.c
+++ b/fs/jfs/jfs_metapage.c
@@ -39,11 +39,11 @@ static struct {
39#endif 39#endif
40 40
41#define metapage_locked(mp) test_bit(META_locked, &(mp)->flag) 41#define metapage_locked(mp) test_bit(META_locked, &(mp)->flag)
42#define trylock_metapage(mp) test_and_set_bit(META_locked, &(mp)->flag) 42#define trylock_metapage(mp) test_and_set_bit_lock(META_locked, &(mp)->flag)
43 43
44static inline void unlock_metapage(struct metapage *mp) 44static inline void unlock_metapage(struct metapage *mp)
45{ 45{
46 clear_bit(META_locked, &mp->flag); 46 clear_bit_unlock(META_locked, &mp->flag);
47 wake_up(&mp->wait); 47 wake_up(&mp->wait);
48} 48}
49 49
@@ -88,7 +88,7 @@ struct meta_anchor {
88}; 88};
89#define mp_anchor(page) ((struct meta_anchor *)page_private(page)) 89#define mp_anchor(page) ((struct meta_anchor *)page_private(page))
90 90
91static inline struct metapage *page_to_mp(struct page *page, uint offset) 91static inline struct metapage *page_to_mp(struct page *page, int offset)
92{ 92{
93 if (!PagePrivate(page)) 93 if (!PagePrivate(page))
94 return NULL; 94 return NULL;
@@ -153,7 +153,7 @@ static inline void dec_io(struct page *page, void (*handler) (struct page *))
153} 153}
154 154
155#else 155#else
156static inline struct metapage *page_to_mp(struct page *page, uint offset) 156static inline struct metapage *page_to_mp(struct page *page, int offset)
157{ 157{
158 return PagePrivate(page) ? (struct metapage *)page_private(page) : NULL; 158 return PagePrivate(page) ? (struct metapage *)page_private(page) : NULL;
159} 159}
@@ -249,7 +249,7 @@ static inline void drop_metapage(struct page *page, struct metapage *mp)
249 */ 249 */
250 250
251static sector_t metapage_get_blocks(struct inode *inode, sector_t lblock, 251static sector_t metapage_get_blocks(struct inode *inode, sector_t lblock,
252 unsigned int *len) 252 int *len)
253{ 253{
254 int rc = 0; 254 int rc = 0;
255 int xflag; 255 int xflag;
@@ -352,25 +352,27 @@ static void metapage_write_end_io(struct bio *bio, int err)
352static int metapage_writepage(struct page *page, struct writeback_control *wbc) 352static int metapage_writepage(struct page *page, struct writeback_control *wbc)
353{ 353{
354 struct bio *bio = NULL; 354 struct bio *bio = NULL;
355 unsigned int block_offset; /* block offset of mp within page */ 355 int block_offset; /* block offset of mp within page */
356 struct inode *inode = page->mapping->host; 356 struct inode *inode = page->mapping->host;
357 unsigned int blocks_per_mp = JFS_SBI(inode->i_sb)->nbperpage; 357 int blocks_per_mp = JFS_SBI(inode->i_sb)->nbperpage;
358 unsigned int len; 358 int len;
359 unsigned int xlen; 359 int xlen;
360 struct metapage *mp; 360 struct metapage *mp;
361 int redirty = 0; 361 int redirty = 0;
362 sector_t lblock; 362 sector_t lblock;
363 int nr_underway = 0;
363 sector_t pblock; 364 sector_t pblock;
364 sector_t next_block = 0; 365 sector_t next_block = 0;
365 sector_t page_start; 366 sector_t page_start;
366 unsigned long bio_bytes = 0; 367 unsigned long bio_bytes = 0;
367 unsigned long bio_offset = 0; 368 unsigned long bio_offset = 0;
368 unsigned int offset; 369 int offset;
369 370
370 page_start = (sector_t)page->index << 371 page_start = (sector_t)page->index <<
371 (PAGE_CACHE_SHIFT - inode->i_blkbits); 372 (PAGE_CACHE_SHIFT - inode->i_blkbits);
372 BUG_ON(!PageLocked(page)); 373 BUG_ON(!PageLocked(page));
373 BUG_ON(PageWriteback(page)); 374 BUG_ON(PageWriteback(page));
375 set_page_writeback(page);
374 376
375 for (offset = 0; offset < PAGE_CACHE_SIZE; offset += PSIZE) { 377 for (offset = 0; offset < PAGE_CACHE_SIZE; offset += PSIZE) {
376 mp = page_to_mp(page, offset); 378 mp = page_to_mp(page, offset);
@@ -413,11 +415,10 @@ static int metapage_writepage(struct page *page, struct writeback_control *wbc)
413 if (!bio->bi_size) 415 if (!bio->bi_size)
414 goto dump_bio; 416 goto dump_bio;
415 submit_bio(WRITE, bio); 417 submit_bio(WRITE, bio);
418 nr_underway++;
416 bio = NULL; 419 bio = NULL;
417 } else { 420 } else
418 set_page_writeback(page);
419 inc_io(page); 421 inc_io(page);
420 }
421 xlen = (PAGE_CACHE_SIZE - offset) >> inode->i_blkbits; 422 xlen = (PAGE_CACHE_SIZE - offset) >> inode->i_blkbits;
422 pblock = metapage_get_blocks(inode, lblock, &xlen); 423 pblock = metapage_get_blocks(inode, lblock, &xlen);
423 if (!pblock) { 424 if (!pblock) {
@@ -427,7 +428,7 @@ static int metapage_writepage(struct page *page, struct writeback_control *wbc)
427 continue; 428 continue;
428 } 429 }
429 set_bit(META_io, &mp->flag); 430 set_bit(META_io, &mp->flag);
430 len = min(xlen, (uint) JFS_SBI(inode->i_sb)->nbperpage); 431 len = min(xlen, (int)JFS_SBI(inode->i_sb)->nbperpage);
431 432
432 bio = bio_alloc(GFP_NOFS, 1); 433 bio = bio_alloc(GFP_NOFS, 1);
433 bio->bi_bdev = inode->i_sb->s_bdev; 434 bio->bi_bdev = inode->i_sb->s_bdev;
@@ -449,12 +450,16 @@ static int metapage_writepage(struct page *page, struct writeback_control *wbc)
449 goto dump_bio; 450 goto dump_bio;
450 451
451 submit_bio(WRITE, bio); 452 submit_bio(WRITE, bio);
453 nr_underway++;
452 } 454 }
453 if (redirty) 455 if (redirty)
454 redirty_page_for_writepage(wbc, page); 456 redirty_page_for_writepage(wbc, page);
455 457
456 unlock_page(page); 458 unlock_page(page);
457 459
460 if (nr_underway == 0)
461 end_page_writeback(page);
462
458 return 0; 463 return 0;
459add_failed: 464add_failed:
460 /* We should never reach here, since we're only adding one vec */ 465 /* We should never reach here, since we're only adding one vec */
@@ -475,13 +480,13 @@ static int metapage_readpage(struct file *fp, struct page *page)
475{ 480{
476 struct inode *inode = page->mapping->host; 481 struct inode *inode = page->mapping->host;
477 struct bio *bio = NULL; 482 struct bio *bio = NULL;
478 unsigned int block_offset; 483 int block_offset;
479 unsigned int blocks_per_page = PAGE_CACHE_SIZE >> inode->i_blkbits; 484 int blocks_per_page = PAGE_CACHE_SIZE >> inode->i_blkbits;
480 sector_t page_start; /* address of page in fs blocks */ 485 sector_t page_start; /* address of page in fs blocks */
481 sector_t pblock; 486 sector_t pblock;
482 unsigned int xlen; 487 int xlen;
483 unsigned int len; 488 unsigned int len;
484 unsigned int offset; 489 int offset;
485 490
486 BUG_ON(!PageLocked(page)); 491 BUG_ON(!PageLocked(page));
487 page_start = (sector_t)page->index << 492 page_start = (sector_t)page->index <<
@@ -530,7 +535,7 @@ static int metapage_releasepage(struct page *page, gfp_t gfp_mask)
530{ 535{
531 struct metapage *mp; 536 struct metapage *mp;
532 int ret = 1; 537 int ret = 1;
533 unsigned int offset; 538 int offset;
534 539
535 for (offset = 0; offset < PAGE_CACHE_SIZE; offset += PSIZE) { 540 for (offset = 0; offset < PAGE_CACHE_SIZE; offset += PSIZE) {
536 mp = page_to_mp(page, offset); 541 mp = page_to_mp(page, offset);
diff --git a/fs/jfs/jfs_mount.c b/fs/jfs/jfs_mount.c
index 644429acb8c0..7b698f2ec45a 100644
--- a/fs/jfs/jfs_mount.c
+++ b/fs/jfs/jfs_mount.c
@@ -147,7 +147,7 @@ int jfs_mount(struct super_block *sb)
147 */ 147 */
148 if ((sbi->mntflag & JFS_BAD_SAIT) == 0) { 148 if ((sbi->mntflag & JFS_BAD_SAIT) == 0) {
149 ipaimap2 = diReadSpecial(sb, AGGREGATE_I, 1); 149 ipaimap2 = diReadSpecial(sb, AGGREGATE_I, 1);
150 if (ipaimap2 == 0) { 150 if (!ipaimap2) {
151 jfs_err("jfs_mount: Faild to read AGGREGATE_I"); 151 jfs_err("jfs_mount: Faild to read AGGREGATE_I");
152 rc = -EIO; 152 rc = -EIO;
153 goto errout35; 153 goto errout35;
diff --git a/fs/jfs/jfs_umount.c b/fs/jfs/jfs_umount.c
index 7971f37534a3..adcf92d3b603 100644
--- a/fs/jfs/jfs_umount.c
+++ b/fs/jfs/jfs_umount.c
@@ -68,7 +68,7 @@ int jfs_umount(struct super_block *sb)
68 /* 68 /*
69 * Wait for outstanding transactions to be written to log: 69 * Wait for outstanding transactions to be written to log:
70 */ 70 */
71 jfs_flush_journal(log, 2); 71 jfs_flush_journal(log, 1);
72 72
73 /* 73 /*
74 * close fileset inode allocation map (aka fileset inode) 74 * close fileset inode allocation map (aka fileset inode)
@@ -146,7 +146,7 @@ int jfs_umount_rw(struct super_block *sb)
146 * 146 *
147 * remove file system from log active file system list. 147 * remove file system from log active file system list.
148 */ 148 */
149 jfs_flush_journal(log, 2); 149 jfs_flush_journal(log, 1);
150 150
151 /* 151 /*
152 * Make sure all metadata makes it to disk 152 * Make sure all metadata makes it to disk
diff --git a/fs/jfs/namei.c b/fs/jfs/namei.c
index 4e0a8493cef6..f8718de3505e 100644
--- a/fs/jfs/namei.c
+++ b/fs/jfs/namei.c
@@ -1103,8 +1103,8 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry,
1103 * Make sure dest inode number (if any) is what we think it is 1103 * Make sure dest inode number (if any) is what we think it is
1104 */ 1104 */
1105 rc = dtSearch(new_dir, &new_dname, &ino, &btstack, JFS_LOOKUP); 1105 rc = dtSearch(new_dir, &new_dname, &ino, &btstack, JFS_LOOKUP);
1106 if (rc == 0) { 1106 if (!rc) {
1107 if ((new_ip == 0) || (ino != new_ip->i_ino)) { 1107 if ((!new_ip) || (ino != new_ip->i_ino)) {
1108 rc = -ESTALE; 1108 rc = -ESTALE;
1109 goto out3; 1109 goto out3;
1110 } 1110 }
diff --git a/fs/jfs/resize.c b/fs/jfs/resize.c
index 71984ee95346..7f24a0bb08ca 100644
--- a/fs/jfs/resize.c
+++ b/fs/jfs/resize.c
@@ -172,7 +172,7 @@ int jfs_extendfs(struct super_block *sb, s64 newLVSize, int newLogSize)
172 */ 172 */
173 t64 = ((newLVSize - newLogSize + BPERDMAP - 1) >> L2BPERDMAP) 173 t64 = ((newLVSize - newLogSize + BPERDMAP - 1) >> L2BPERDMAP)
174 << L2BPERDMAP; 174 << L2BPERDMAP;
175 t32 = ((t64 + (BITSPERPAGE - 1)) / BITSPERPAGE) + 1 + 50; 175 t32 = DIV_ROUND_UP(t64, BITSPERPAGE) + 1 + 50;
176 newFSCKSize = t32 << sbi->l2nbperpage; 176 newFSCKSize = t32 << sbi->l2nbperpage;
177 newFSCKAddress = newLogAddress - newFSCKSize; 177 newFSCKAddress = newLogAddress - newFSCKSize;
178 178
diff --git a/fs/jfs/super.c b/fs/jfs/super.c
index 314bb4ff1ba8..70a14001c98f 100644
--- a/fs/jfs/super.c
+++ b/fs/jfs/super.c
@@ -598,6 +598,12 @@ static int jfs_show_options(struct seq_file *seq, struct vfsmount *vfs)
598 seq_printf(seq, ",umask=%03o", sbi->umask); 598 seq_printf(seq, ",umask=%03o", sbi->umask);
599 if (sbi->flag & JFS_NOINTEGRITY) 599 if (sbi->flag & JFS_NOINTEGRITY)
600 seq_puts(seq, ",nointegrity"); 600 seq_puts(seq, ",nointegrity");
601 if (sbi->nls_tab)
602 seq_printf(seq, ",iocharset=%s", sbi->nls_tab->charset);
603 if (sbi->flag & JFS_ERR_CONTINUE)
604 seq_printf(seq, ",errors=continue");
605 if (sbi->flag & JFS_ERR_PANIC)
606 seq_printf(seq, ",errors=panic");
601 607
602#ifdef CONFIG_QUOTA 608#ifdef CONFIG_QUOTA
603 if (sbi->flag & JFS_USRQUOTA) 609 if (sbi->flag & JFS_USRQUOTA)