From owner-svn-src-head@freebsd.org Fri Sep 6 08:07:13 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9DBDDEC954; Fri, 6 Sep 2019 08:07:13 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46PqsY3fy1z41vB; Fri, 6 Sep 2019 08:07:13 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5CEAD19C72; Fri, 6 Sep 2019 08:07:13 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8687D3o050800; Fri, 6 Sep 2019 08:07:13 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8687CDH050796; Fri, 6 Sep 2019 08:07:12 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201909060807.x8687CDH050796@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 6 Sep 2019 08:07:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351926 - head/sys/fs/ext2fs X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/fs/ext2fs X-SVN-Commit-Revision: 351926 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Sep 2019 08:07:13 -0000 Author: cem Date: Fri Sep 6 08:07:12 2019 New Revision: 351926 URL: https://svnweb.freebsd.org/changeset/base/351926 Log: 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. Modified: head/sys/fs/ext2fs/ext2_alloc.c head/sys/fs/ext2fs/ext2_balloc.c head/sys/fs/ext2fs/ext2_extattr.c head/sys/fs/ext2fs/ext2_extents.c head/sys/fs/ext2fs/ext2_vfsops.c Modified: head/sys/fs/ext2fs/ext2_alloc.c ============================================================================== --- head/sys/fs/ext2fs/ext2_alloc.c Fri Sep 6 05:34:31 2019 (r351925) +++ head/sys/fs/ext2fs/ext2_alloc.c Fri Sep 6 08:07:12 2019 (r351926) @@ -1313,7 +1313,6 @@ ext2_nodealloccg(struct inode *ip, int cg, daddr_t ipr 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 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; Modified: head/sys/fs/ext2fs/ext2_balloc.c ============================================================================== --- head/sys/fs/ext2fs/ext2_balloc.c Fri Sep 6 05:34:31 2019 (r351925) +++ head/sys/fs/ext2fs/ext2_balloc.c Fri Sep 6 08:07:12 2019 (r351926) @@ -78,7 +78,6 @@ ext2_ext_balloc(struct inode *ip, uint32_t lbn, int si } 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 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 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; Modified: head/sys/fs/ext2fs/ext2_extattr.c ============================================================================== --- head/sys/fs/ext2fs/ext2_extattr.c Fri Sep 6 05:34:31 2019 (r351925) +++ head/sys/fs/ext2fs/ext2_extattr.c Fri Sep 6 08:07:12 2019 (r351926) @@ -280,7 +280,6 @@ ext2_extattr_block_list(struct inode *ip, int attrname 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 attrnames 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 attrna 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 attrnames 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); } Modified: head/sys/fs/ext2fs/ext2_extents.c ============================================================================== --- head/sys/fs/ext2fs/ext2_extents.c Fri Sep 6 05:34:31 2019 (r351925) +++ head/sys/fs/ext2fs/ext2_extents.c Fri Sep 6 08:07:12 2019 (r351926) @@ -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_pa 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_dad error = bread(ip->i_devvp, fsbtodb(fs, pblk), fs->e2fs_bsize, NOCRED, &bp); if (error) { - brelse(bp); return (NULL); } Modified: head/sys/fs/ext2fs/ext2_vfsops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vfsops.c Fri Sep 6 05:34:31 2019 (r351925) +++ head/sys/fs/ext2fs/ext2_vfsops.c Fri Sep 6 08:07:12 2019 (r351926) @@ -651,7 +651,6 @@ ext2_compute_sb_data(struct vnode *devvp, struct ext2f * because this function could be called from * MNT_UPDATE path. */ - brelse(bp); return (error); } if (EXT2_HAS_INCOMPAT_FEATURE(fs, EXT2F_INCOMPAT_64BIT)) {