svn commit: r336736 - in head/usr.sbin/makefs: . ffs msdos

Ed Maste emaste at FreeBSD.org
Thu Jul 26 13:33:12 UTC 2018


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:


More information about the svn-src-all mailing list