ext2fs: Remove redundant brelse() after r294954

Coccinelle:

@ rule1 @
 identifier __error;
@@
 ...
 int __error;
 ...

@ rule2 depends on rule1 @
 identifier rule1.__error;
 identifier __bp;
@@

 __error =
(
 bread
|
 bread_gb
|
 breadn
|
 breadn_flags
)
 (..., &__bp);
 if (
(
 __error
|
 __error != 0
)
 ) {
 ...
- brelse(__bp);
 ...
 }

No functional change.
This commit is contained in:
Conrad Meyer 2019-09-06 08:07:12 +00:00
parent e0b5c15c54
commit fe8b34563d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=351926
5 changed files with 0 additions and 15 deletions

View File

@ -1313,7 +1313,6 @@ ext2_nodealloccg(struct inode *ip, int cg, daddr_t ipref, int mode)
e2fs_gd_get_i_bitmap(&fs->e2fs_gd[cg])),
(int)fs->e2fs_bsize, NOCRED, &bp);
if (error) {
brelse(bp);
EXT2_LOCK(ump);
return (0);
}
@ -1417,7 +1416,6 @@ ext2_blkfree(struct inode *ip, e4fs_daddr_t bno, long size)
fsbtodb(fs, e2fs_gd_get_b_bitmap(&fs->e2fs_gd[cg])),
(int)fs->e2fs_bsize, NOCRED, &bp);
if (error) {
brelse(bp);
return;
}
bbp = (char *)bp->b_data;
@ -1464,7 +1462,6 @@ ext2_vfree(struct vnode *pvp, ino_t ino, int mode)
fsbtodb(fs, e2fs_gd_get_i_bitmap(&fs->e2fs_gd[cg])),
(int)fs->e2fs_bsize, NOCRED, &bp);
if (error) {
brelse(bp);
return (0);
}
ibp = (char *)bp->b_data;

View File

@ -78,7 +78,6 @@ ext2_ext_balloc(struct inode *ip, uint32_t lbn, int size,
} else {
error = bread(vp, lbn, fs->e2fs_bsize, NOCRED, &bp);
if (error) {
brelse(bp);
return (error);
}
}
@ -142,7 +141,6 @@ ext2_balloc(struct inode *ip, e2fs_lbn_t lbn, int size, struct ucred *cred,
if (nb != 0) {
error = bread(vp, lbn, fs->e2fs_bsize, NOCRED, &bp);
if (error) {
brelse(bp);
return (error);
}
bp->b_blkno = fsbtodb(fs, nb);
@ -219,7 +217,6 @@ ext2_balloc(struct inode *ip, e2fs_lbn_t lbn, int size, struct ucred *cred,
error = bread(vp,
indirs[i].in_lbn, (int)fs->e2fs_bsize, NOCRED, &bp);
if (error) {
brelse(bp);
return (error);
}
bap = (e2fs_daddr_t *)bp->b_data;

View File

@ -280,7 +280,6 @@ ext2_extattr_block_list(struct inode *ip, int attrnamespace,
error = bread(ip->i_devvp, fsbtodb(fs, ip->i_facl),
fs->e2fs_bsize, NOCRED, &bp);
if (error) {
brelse(bp);
return (error);
}
@ -421,7 +420,6 @@ ext2_extattr_block_get(struct inode *ip, int attrnamespace,
error = bread(ip->i_devvp, fsbtodb(fs, ip->i_facl),
fs->e2fs_bsize, NOCRED, &bp);
if (error) {
brelse(bp);
return (error);
}
@ -681,7 +679,6 @@ ext2_extattr_block_delete(struct inode *ip, int attrnamespace, const char *name)
error = bread(ip->i_devvp, fsbtodb(fs, ip->i_facl),
fs->e2fs_bsize, NOCRED, &bp);
if (error) {
brelse(bp);
return (error);
}
@ -1074,7 +1071,6 @@ ext2_extattr_block_set(struct inode *ip, int attrnamespace,
error = bread(ip->i_devvp, fsbtodb(fs, ip->i_facl),
fs->e2fs_bsize, NOCRED, &bp);
if (error) {
brelse(bp);
return (error);
}
@ -1221,7 +1217,6 @@ int ext2_extattr_free(struct inode *ip)
error = bread(ip->i_devvp, fsbtodb(fs, ip->i_facl),
fs->e2fs_bsize, NOCRED, &bp);
if (error) {
brelse(bp);
return (error);
}

View File

@ -415,7 +415,6 @@ ext4_ext_find_extent(struct inode *ip, daddr_t block,
error = bread(ip->i_devvp, fsbtodb(ip->i_e2fs, blk),
ip->i_e2fs->e2fs_bsize, NOCRED, &bp);
if (error) {
brelse(bp);
goto error;
}
@ -824,7 +823,6 @@ ext4_ext_split(struct inode *ip, struct ext4_extent_path *path,
error = bread(ip->i_devvp, fsbtodb(fs, newblk),
(int)fs->e2fs_bsize, NOCRED, &bp);
if (error) {
brelse(bp);
goto cleanup;
}
@ -1452,7 +1450,6 @@ ext4_read_extent_tree_block(struct inode *ip, e4fs_daddr_t pblk,
error = bread(ip->i_devvp, fsbtodb(fs, pblk),
fs->e2fs_bsize, NOCRED, &bp);
if (error) {
brelse(bp);
return (NULL);
}

View File

@ -651,7 +651,6 @@ ext2_compute_sb_data(struct vnode *devvp, struct ext2fs *es,
* because this function could be called from
* MNT_UPDATE path.
*/
brelse(bp);
return (error);
}
if (EXT2_HAS_INCOMPAT_FEATURE(fs, EXT2F_INCOMPAT_64BIT)) {