aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/jfs/jfs_dtree.c19
-rw-r--r--fs/jfs/jfs_imap.c4
-rw-r--r--fs/jfs/jfs_logmgr.c2
-rw-r--r--fs/jfs/jfs_mount.c2
-rw-r--r--fs/jfs/namei.c2
5 files changed, 15 insertions, 14 deletions
diff --git a/fs/jfs/jfs_dtree.c b/fs/jfs/jfs_dtree.c
index 97c66f913393..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
@@ -593,7 +594,7 @@ int dtSearch(struct inode *ip, struct component_name * key, ino_t * data,
593 struct super_block *sb = ip->i_sb; 594 struct super_block *sb = ip->i_sb;
594 595
595 ciKey.name = kmalloc((JFS_NAME_MAX + 1) * sizeof(wchar_t), GFP_NOFS); 596 ciKey.name = kmalloc((JFS_NAME_MAX + 1) * sizeof(wchar_t), GFP_NOFS);
596 if (ciKey.name == 0) { 597 if (!ciKey.name) {
597 rc = -ENOMEM; 598 rc = -ENOMEM;
598 goto dtSearch_Exit2; 599 goto dtSearch_Exit2;
599 } 600 }
@@ -956,7 +957,7 @@ static int dtSplitUp(tid_t tid,
956 sp = DT_PAGE(ip, smp); 957 sp = DT_PAGE(ip, smp);
957 958
958 key.name = kmalloc((JFS_NAME_MAX + 2) * sizeof(wchar_t), GFP_NOFS); 959 key.name = kmalloc((JFS_NAME_MAX + 2) * sizeof(wchar_t), GFP_NOFS);
959 if (key.name == 0) { 960 if (!key.name) {
960 DT_PUTPAGE(smp); 961 DT_PUTPAGE(smp);
961 rc = -ENOMEM; 962 rc = -ENOMEM;
962 goto dtSplitUp_Exit; 963 goto dtSplitUp_Exit;
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 2370716d57ad..325a9679b95a 100644
--- a/fs/jfs/jfs_logmgr.c
+++ b/fs/jfs/jfs_logmgr.c
@@ -2345,7 +2345,7 @@ int jfsIOWait(void *arg)
2345 2345
2346 do { 2346 do {
2347 spin_lock_irq(&log_redrive_lock); 2347 spin_lock_irq(&log_redrive_lock);
2348 while ((bp = log_redrive_list) != 0) { 2348 while ((bp = log_redrive_list)) {
2349 log_redrive_list = bp->l_redrive_next; 2349 log_redrive_list = bp->l_redrive_next;
2350 bp->l_redrive_next = NULL; 2350 bp->l_redrive_next = NULL;
2351 spin_unlock_irq(&log_redrive_lock); 2351 spin_unlock_irq(&log_redrive_lock);
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/namei.c b/fs/jfs/namei.c
index 4e0a8493cef6..d6e5ebad739a 100644
--- a/fs/jfs/namei.c
+++ b/fs/jfs/namei.c
@@ -1103,7 +1103,7 @@ 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 == 0) || (ino != new_ip->i_ino)) {
1108 rc = -ESTALE; 1108 rc = -ESTALE;
1109 goto out3; 1109 goto out3;