diff options
Diffstat (limited to 'fs/ocfs2/dir.c')
-rw-r--r-- | fs/ocfs2/dir.c | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c index 167e6c96277d..3614651dcdb2 100644 --- a/fs/ocfs2/dir.c +++ b/fs/ocfs2/dir.c | |||
@@ -716,8 +716,7 @@ static int ocfs2_dir_foreach_blk_el(struct inode *inode, | |||
716 | for (i = ra_sectors >> (sb->s_blocksize_bits - 9); | 716 | for (i = ra_sectors >> (sb->s_blocksize_bits - 9); |
717 | i > 0; i--) { | 717 | i > 0; i--) { |
718 | tmp = ocfs2_bread(inode, ++blk, &err, 1); | 718 | tmp = ocfs2_bread(inode, ++blk, &err, 1); |
719 | if (tmp) | 719 | brelse(tmp); |
720 | brelse(tmp); | ||
721 | } | 720 | } |
722 | last_ra_blk = blk; | 721 | last_ra_blk = blk; |
723 | ra_sectors = 8; | 722 | ra_sectors = 8; |
@@ -899,10 +898,8 @@ int ocfs2_find_files_on_disk(const char *name, | |||
899 | leave: | 898 | leave: |
900 | if (status < 0) { | 899 | if (status < 0) { |
901 | *dirent = NULL; | 900 | *dirent = NULL; |
902 | if (*dirent_bh) { | 901 | brelse(*dirent_bh); |
903 | brelse(*dirent_bh); | 902 | *dirent_bh = NULL; |
904 | *dirent_bh = NULL; | ||
905 | } | ||
906 | } | 903 | } |
907 | 904 | ||
908 | mlog_exit(status); | 905 | mlog_exit(status); |
@@ -951,8 +948,7 @@ int ocfs2_check_dir_for_entry(struct inode *dir, | |||
951 | 948 | ||
952 | ret = 0; | 949 | ret = 0; |
953 | bail: | 950 | bail: |
954 | if (dirent_bh) | 951 | brelse(dirent_bh); |
955 | brelse(dirent_bh); | ||
956 | 952 | ||
957 | mlog_exit(ret); | 953 | mlog_exit(ret); |
958 | return ret; | 954 | return ret; |
@@ -1127,8 +1123,7 @@ static int ocfs2_fill_new_dir_el(struct ocfs2_super *osb, | |||
1127 | 1123 | ||
1128 | status = 0; | 1124 | status = 0; |
1129 | bail: | 1125 | bail: |
1130 | if (new_bh) | 1126 | brelse(new_bh); |
1131 | brelse(new_bh); | ||
1132 | 1127 | ||
1133 | mlog_exit(status); | 1128 | mlog_exit(status); |
1134 | return status; | 1129 | return status; |
@@ -1574,8 +1569,7 @@ bail: | |||
1574 | if (meta_ac) | 1569 | if (meta_ac) |
1575 | ocfs2_free_alloc_context(meta_ac); | 1570 | ocfs2_free_alloc_context(meta_ac); |
1576 | 1571 | ||
1577 | if (new_bh) | 1572 | brelse(new_bh); |
1578 | brelse(new_bh); | ||
1579 | 1573 | ||
1580 | mlog_exit(status); | 1574 | mlog_exit(status); |
1581 | return status; | 1575 | return status; |
@@ -1702,8 +1696,7 @@ static int ocfs2_find_dir_space_el(struct inode *dir, const char *name, | |||
1702 | 1696 | ||
1703 | status = 0; | 1697 | status = 0; |
1704 | bail: | 1698 | bail: |
1705 | if (bh) | 1699 | brelse(bh); |
1706 | brelse(bh); | ||
1707 | 1700 | ||
1708 | mlog_exit(status); | 1701 | mlog_exit(status); |
1709 | return status; | 1702 | return status; |
@@ -1762,7 +1755,6 @@ int ocfs2_prepare_dir_for_insert(struct ocfs2_super *osb, | |||
1762 | *ret_de_bh = bh; | 1755 | *ret_de_bh = bh; |
1763 | bh = NULL; | 1756 | bh = NULL; |
1764 | out: | 1757 | out: |
1765 | if (bh) | 1758 | brelse(bh); |
1766 | brelse(bh); | ||
1767 | return ret; | 1759 | return ret; |
1768 | } | 1760 | } |