aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/namei.c
diff options
context:
space:
mode:
authorMark Fasheh <mfasheh@suse.com>2008-10-07 17:25:16 -0400
committerMark Fasheh <mfasheh@suse.com>2008-10-13 20:02:44 -0400
commita81cb88b64a479b78c6dd5666678d50171865db8 (patch)
tree9fe0f67e30d7c70d43785827e57736ac01558c24 /fs/ocfs2/namei.c
parentfd8351f83d413b41da956109cf429c15881886e2 (diff)
ocfs2: Don't check for NULL before brelse()
This is pointless as brelse() already does the check. Signed-off-by: Mark Fasheh
Diffstat (limited to 'fs/ocfs2/namei.c')
-rw-r--r--fs/ocfs2/namei.c83
1 files changed, 26 insertions, 57 deletions
diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c
index 76d1d1314308..7d0dd5c95eb3 100644
--- a/fs/ocfs2/namei.c
+++ b/fs/ocfs2/namei.c
@@ -328,14 +328,9 @@ leave:
328 if (status == -ENOSPC) 328 if (status == -ENOSPC)
329 mlog(0, "Disk is full\n"); 329 mlog(0, "Disk is full\n");
330 330
331 if (new_fe_bh) 331 brelse(new_fe_bh);
332 brelse(new_fe_bh); 332 brelse(de_bh);
333 333 brelse(parent_fe_bh);
334 if (de_bh)
335 brelse(de_bh);
336
337 if (parent_fe_bh)
338 brelse(parent_fe_bh);
339 334
340 if ((status < 0) && inode) 335 if ((status < 0) && inode)
341 iput(inode); 336 iput(inode);
@@ -648,12 +643,9 @@ out_unlock_inode:
648out: 643out:
649 ocfs2_inode_unlock(dir, 1); 644 ocfs2_inode_unlock(dir, 1);
650 645
651 if (de_bh) 646 brelse(de_bh);
652 brelse(de_bh); 647 brelse(fe_bh);
653 if (fe_bh) 648 brelse(parent_fe_bh);
654 brelse(fe_bh);
655 if (parent_fe_bh)
656 brelse(parent_fe_bh);
657 649
658 mlog_exit(err); 650 mlog_exit(err);
659 651
@@ -852,17 +844,10 @@ leave:
852 iput(orphan_dir); 844 iput(orphan_dir);
853 } 845 }
854 846
855 if (fe_bh) 847 brelse(fe_bh);
856 brelse(fe_bh); 848 brelse(dirent_bh);
857 849 brelse(parent_node_bh);
858 if (dirent_bh) 850 brelse(orphan_entry_bh);
859 brelse(dirent_bh);
860
861 if (parent_node_bh)
862 brelse(parent_node_bh);
863
864 if (orphan_entry_bh)
865 brelse(orphan_entry_bh);
866 851
867 mlog_exit(status); 852 mlog_exit(status);
868 853
@@ -1373,24 +1358,15 @@ bail:
1373 1358
1374 if (new_inode) 1359 if (new_inode)
1375 iput(new_inode); 1360 iput(new_inode);
1376 if (newfe_bh) 1361 brelse(newfe_bh);
1377 brelse(newfe_bh); 1362 brelse(old_inode_bh);
1378 if (old_inode_bh) 1363 brelse(old_dir_bh);
1379 brelse(old_inode_bh); 1364 brelse(new_dir_bh);
1380 if (old_dir_bh) 1365 brelse(new_de_bh);
1381 brelse(old_dir_bh); 1366 brelse(old_de_bh);
1382 if (new_dir_bh) 1367 brelse(old_inode_de_bh);
1383 brelse(new_dir_bh); 1368 brelse(orphan_entry_bh);
1384 if (new_de_bh) 1369 brelse(insert_entry_bh);
1385 brelse(new_de_bh);
1386 if (old_de_bh)
1387 brelse(old_de_bh);
1388 if (old_inode_de_bh)
1389 brelse(old_inode_de_bh);
1390 if (orphan_entry_bh)
1391 brelse(orphan_entry_bh);
1392 if (insert_entry_bh)
1393 brelse(insert_entry_bh);
1394 1370
1395 mlog_exit(status); 1371 mlog_exit(status);
1396 1372
@@ -1493,8 +1469,7 @@ bail:
1493 1469
1494 if (bhs) { 1470 if (bhs) {
1495 for(i = 0; i < blocks; i++) 1471 for(i = 0; i < blocks; i++)
1496 if (bhs[i]) 1472 brelse(bhs[i]);
1497 brelse(bhs[i]);
1498 kfree(bhs); 1473 kfree(bhs);
1499 } 1474 }
1500 1475
@@ -1660,12 +1635,9 @@ bail:
1660 1635
1661 ocfs2_inode_unlock(dir, 1); 1636 ocfs2_inode_unlock(dir, 1);
1662 1637
1663 if (new_fe_bh) 1638 brelse(new_fe_bh);
1664 brelse(new_fe_bh); 1639 brelse(parent_fe_bh);
1665 if (parent_fe_bh) 1640 brelse(de_bh);
1666 brelse(parent_fe_bh);
1667 if (de_bh)
1668 brelse(de_bh);
1669 if (inode_ac) 1641 if (inode_ac)
1670 ocfs2_free_alloc_context(inode_ac); 1642 ocfs2_free_alloc_context(inode_ac);
1671 if (data_ac) 1643 if (data_ac)
@@ -1760,8 +1732,7 @@ leave:
1760 iput(orphan_dir_inode); 1732 iput(orphan_dir_inode);
1761 } 1733 }
1762 1734
1763 if (orphan_dir_bh) 1735 brelse(orphan_dir_bh);
1764 brelse(orphan_dir_bh);
1765 1736
1766 mlog_exit(status); 1737 mlog_exit(status);
1767 return status; 1738 return status;
@@ -1830,8 +1801,7 @@ static int ocfs2_orphan_add(struct ocfs2_super *osb,
1830 (unsigned long long)OCFS2_I(inode)->ip_blkno, osb->slot_num); 1801 (unsigned long long)OCFS2_I(inode)->ip_blkno, osb->slot_num);
1831 1802
1832leave: 1803leave:
1833 if (orphan_dir_bh) 1804 brelse(orphan_dir_bh);
1834 brelse(orphan_dir_bh);
1835 1805
1836 mlog_exit(status); 1806 mlog_exit(status);
1837 return status; 1807 return status;
@@ -1899,8 +1869,7 @@ int ocfs2_orphan_del(struct ocfs2_super *osb,
1899 } 1869 }
1900 1870
1901leave: 1871leave:
1902 if (target_de_bh) 1872 brelse(target_de_bh);
1903 brelse(target_de_bh);
1904 1873
1905 mlog_exit(status); 1874 mlog_exit(status);
1906 return status; 1875 return status;