From owner-svn-src-head@freebsd.org Thu Jul 26 13:33:12 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1022104F501; Thu, 26 Jul 2018 13:33:12 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 577028F125; Thu, 26 Jul 2018 13:33:12 +0000 (UTC) (envelope-from emaste@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 38A381B07; Thu, 26 Jul 2018 13:33:12 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w6QDXCxG025261; Thu, 26 Jul 2018 13:33:12 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6QDXACS025254; Thu, 26 Jul 2018 13:33:10 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201807261333.w6QDXACS025254@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 26 Jul 2018 13:33:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336736 - in head/usr.sbin/makefs: . ffs msdos X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/usr.sbin/makefs: . ffs msdos X-SVN-Commit-Revision: 336736 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.27 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: Thu, 26 Jul 2018 13:33:12 -0000 Author: emaste Date: Thu Jul 26 13:33:10 2018 New Revision: 336736 URL: https://svnweb.freebsd.org/changeset/base/336736 Log: makefs: use FreeBSD brelse function signature Although the ffs (and later msdosfs) implementation in makefs is independent of the one in kernel, it makes sense to keep differences to a minimum in order to ease comparison and porting changes across. Submitted by: Siva Mahadevan Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/makefs/ffs.c head/usr.sbin/makefs/ffs/buf.c head/usr.sbin/makefs/ffs/buf.h head/usr.sbin/makefs/ffs/ffs_alloc.c head/usr.sbin/makefs/ffs/ffs_balloc.c head/usr.sbin/makefs/msdos/msdosfs_denode.c head/usr.sbin/makefs/msdos/msdosfs_vfsops.c head/usr.sbin/makefs/msdos/msdosfs_vnops.c Modified: head/usr.sbin/makefs/ffs.c ============================================================================== --- head/usr.sbin/makefs/ffs.c Thu Jul 26 07:29:44 2018 (r336735) +++ head/usr.sbin/makefs/ffs.c Thu Jul 26 13:33:10 2018 (r336736) @@ -980,7 +980,7 @@ ffs_write_file(union dinode *din, uint32_t ino, void * errno = bwrite(bp); if (errno != 0) goto bad_ffs_write_file; - brelse(bp, 0); + brelse(bp); if (!isfile) p += chunk; } Modified: head/usr.sbin/makefs/ffs/buf.c ============================================================================== --- head/usr.sbin/makefs/ffs/buf.c Thu Jul 26 07:29:44 2018 (r336735) +++ head/usr.sbin/makefs/ffs/buf.c Thu Jul 26 13:33:10 2018 (r336736) @@ -93,7 +93,7 @@ bread(struct vnode *vp, daddr_t blkno, int size, struc } void -brelse(struct buf *bp, int u1 __unused) +brelse(struct buf *bp) { assert (bp != NULL); Modified: head/usr.sbin/makefs/ffs/buf.h ============================================================================== --- head/usr.sbin/makefs/ffs/buf.h Thu Jul 26 07:29:44 2018 (r336735) +++ head/usr.sbin/makefs/ffs/buf.h Thu Jul 26 13:33:10 2018 (r336736) @@ -67,7 +67,7 @@ struct buf { void bcleanup(void); int bread(struct vnode *, daddr_t, int, struct ucred *, struct buf **); -void brelse(struct buf *, int); +void brelse(struct buf *); int bwrite(struct buf *); struct buf * getblk(struct vnode *, daddr_t, int, int, int, int); Modified: head/usr.sbin/makefs/ffs/ffs_alloc.c ============================================================================== --- head/usr.sbin/makefs/ffs/ffs_alloc.c Thu Jul 26 07:29:44 2018 (r336735) +++ head/usr.sbin/makefs/ffs/ffs_alloc.c Thu Jul 26 13:33:10 2018 (r336736) @@ -305,13 +305,13 @@ ffs_alloccg(struct inode *ip, int cg, daddr_t bpref, i error = bread(ip->i_devvp, fsbtodb(fs, cgtod(fs, cg)), (int)fs->fs_cgsize, NULL, &bp); if (error) { - brelse(bp, 0); + brelse(bp); return (0); } cgp = (struct cg *)bp->b_data; if (!cg_chkmagic_swap(cgp, needswap) || (cgp->cg_cs.cs_nbfree == 0 && size == fs->fs_bsize)) { - brelse(bp, 0); + brelse(bp); return (0); } if (size == fs->fs_bsize) { @@ -334,7 +334,7 @@ ffs_alloccg(struct inode *ip, int cg, daddr_t bpref, i * allocated, and hacked up */ if (cgp->cg_cs.cs_nbfree == 0) { - brelse(bp, 0); + brelse(bp); return (0); } bno = ffs_alloccgblk(ip, bp, bpref); @@ -449,12 +449,12 @@ ffs_blkfree(struct inode *ip, daddr_t bno, long size) error = bread(ip->i_devvp, fsbtodb(fs, cgtod(fs, cg)), (int)fs->fs_cgsize, NULL, &bp); if (error) { - brelse(bp, 0); + brelse(bp); return; } cgp = (struct cg *)bp->b_data; if (!cg_chkmagic_swap(cgp, needswap)) { - brelse(bp, 0); + brelse(bp); return; } cgbno = dtogd(fs, bno); Modified: head/usr.sbin/makefs/ffs/ffs_balloc.c ============================================================================== --- head/usr.sbin/makefs/ffs/ffs_balloc.c Thu Jul 26 07:29:44 2018 (r336735) +++ head/usr.sbin/makefs/ffs/ffs_balloc.c Thu Jul 26 13:33:10 2018 (r336736) @@ -138,7 +138,7 @@ ffs_balloc_ufs1(struct inode *ip, off_t offset, int bu error = bread(ip->i_devvp, lbn, fs->fs_bsize, NULL, bpp); if (error) { - brelse(*bpp, 0); + brelse(*bpp); return (error); } } @@ -164,7 +164,7 @@ ffs_balloc_ufs1(struct inode *ip, off_t offset, int bu error = bread(ip->i_devvp, lbn, osize, NULL, bpp); if (error) { - brelse(*bpp, 0); + brelse(*bpp); return (error); } } @@ -250,7 +250,7 @@ ffs_balloc_ufs1(struct inode *ip, off_t offset, int bu error = bread(ip->i_devvp, indirs[i].in_lbn, fs->fs_bsize, NULL, &bp); if (error) { - brelse(bp, 0); + brelse(bp); return error; } bap = (int32_t *)bp->b_data; @@ -259,14 +259,14 @@ ffs_balloc_ufs1(struct inode *ip, off_t offset, int bu break; i++; if (nb != 0) { - brelse(bp, 0); + brelse(bp); continue; } if (pref == 0) pref = ffs_blkpref_ufs1(ip, lbn, 0, (int32_t *)0); error = ffs_alloc(ip, lbn, pref, (int)fs->fs_bsize, &newb); if (error) { - brelse(bp, 0); + brelse(bp); return error; } nb = newb; @@ -280,7 +280,7 @@ ffs_balloc_ufs1(struct inode *ip, off_t offset, int bu */ if ((error = bwrite(nbp)) != 0) { - brelse(bp, 0); + brelse(bp); return error; } bap[indirs[i - 1].in_off] = ufs_rw32(nb, needswap); @@ -296,7 +296,7 @@ ffs_balloc_ufs1(struct inode *ip, off_t offset, int bu pref = ffs_blkpref_ufs1(ip, lbn, indirs[num].in_off, &bap[0]); error = ffs_alloc(ip, lbn, pref, (int)fs->fs_bsize, &newb); if (error) { - brelse(bp, 0); + brelse(bp); return error; } nb = newb; @@ -316,11 +316,11 @@ ffs_balloc_ufs1(struct inode *ip, off_t offset, int bu bwrite(bp); return (0); } - brelse(bp, 0); + brelse(bp); if (bpp != NULL) { error = bread(ip->i_devvp, lbn, (int)fs->fs_bsize, NULL, &nbp); if (error) { - brelse(nbp, 0); + brelse(nbp); return error; } *bpp = nbp; @@ -389,7 +389,7 @@ ffs_balloc_ufs2(struct inode *ip, off_t offset, int bu error = bread(ip->i_devvp, lbn, fs->fs_bsize, NULL, bpp); if (error) { - brelse(*bpp, 0); + brelse(*bpp); return (error); } } @@ -415,7 +415,7 @@ ffs_balloc_ufs2(struct inode *ip, off_t offset, int bu error = bread(ip->i_devvp, lbn, osize, NULL, bpp); if (error) { - brelse(*bpp, 0); + brelse(*bpp); return (error); } } @@ -501,7 +501,7 @@ ffs_balloc_ufs2(struct inode *ip, off_t offset, int bu error = bread(ip->i_devvp, indirs[i].in_lbn, fs->fs_bsize, NULL, &bp); if (error) { - brelse(bp, 0); + brelse(bp); return error; } bap = (int64_t *)bp->b_data; @@ -510,14 +510,14 @@ ffs_balloc_ufs2(struct inode *ip, off_t offset, int bu break; i++; if (nb != 0) { - brelse(bp, 0); + brelse(bp); continue; } if (pref == 0) pref = ffs_blkpref_ufs2(ip, lbn, 0, (int64_t *)0); error = ffs_alloc(ip, lbn, pref, (int)fs->fs_bsize, &newb); if (error) { - brelse(bp, 0); + brelse(bp); return error; } nb = newb; @@ -531,7 +531,7 @@ ffs_balloc_ufs2(struct inode *ip, off_t offset, int bu */ if ((error = bwrite(nbp)) != 0) { - brelse(bp, 0); + brelse(bp); return error; } bap[indirs[i - 1].in_off] = ufs_rw64(nb, needswap); @@ -547,7 +547,7 @@ ffs_balloc_ufs2(struct inode *ip, off_t offset, int bu pref = ffs_blkpref_ufs2(ip, lbn, indirs[num].in_off, &bap[0]); error = ffs_alloc(ip, lbn, pref, (int)fs->fs_bsize, &newb); if (error) { - brelse(bp, 0); + brelse(bp); return error; } nb = newb; @@ -567,11 +567,11 @@ ffs_balloc_ufs2(struct inode *ip, off_t offset, int bu bwrite(bp); return (0); } - brelse(bp, 0); + brelse(bp); if (bpp != NULL) { error = bread(ip->i_devvp, lbn, (int)fs->fs_bsize, NULL, &nbp); if (error) { - brelse(nbp, 0); + brelse(nbp); return error; } *bpp = nbp; Modified: head/usr.sbin/makefs/msdos/msdosfs_denode.c ============================================================================== --- head/usr.sbin/makefs/msdos/msdosfs_denode.c Thu Jul 26 07:29:44 2018 (r336735) +++ head/usr.sbin/makefs/msdos/msdosfs_denode.c Thu Jul 26 13:33:10 2018 (r336736) @@ -160,7 +160,7 @@ deget(struct msdosfsmount *pmp, u_long dirclust, u_lon return (error); } DE_INTERNALIZE(ldep, direntptr); - brelse(bp, 0); + brelse(bp); } /* Modified: head/usr.sbin/makefs/msdos/msdosfs_vfsops.c ============================================================================== --- head/usr.sbin/makefs/msdos/msdosfs_vfsops.c Thu Jul 26 07:29:44 2018 (r336735) +++ head/usr.sbin/makefs/msdos/msdosfs_vfsops.c Thu Jul 26 13:33:10 2018 (r336736) @@ -326,7 +326,7 @@ msdosfs_mount(struct vnode *devvp, int flags) /* * Release the bootsector buffer. */ - brelse(bp, BC_AGE); + brelse(bp); bp = NULL; /* @@ -353,7 +353,7 @@ msdosfs_mount(struct vnode *devvp, int flags) pmp->pm_nxtfree = getulong(fp->fsinxtfree); else pmp->pm_fsinfo = 0; - brelse(bp, 0); + brelse(bp); bp = NULL; } Modified: head/usr.sbin/makefs/msdos/msdosfs_vnops.c ============================================================================== --- head/usr.sbin/makefs/msdos/msdosfs_vnops.c Thu Jul 26 07:29:44 2018 (r336735) +++ head/usr.sbin/makefs/msdos/msdosfs_vnops.c Thu Jul 26 13:33:10 2018 (r336736) @@ -230,7 +230,7 @@ msdosfs_findslot(struct denode *dp, struct componentna slotoffset = diroff; } if (dep->deName[0] == SLOT_EMPTY) { - brelse(bp, 0); + brelse(bp); goto notfound; } } else { @@ -291,7 +291,7 @@ msdosfs_findslot(struct denode *dp, struct componentna * Release the buffer holding the directory cluster just * searched. */ - brelse(bp, 0); + brelse(bp); } /* for (frcn = 0; ; frcn++) */ notfound: