Author: ngie
Date: Mon May  8 18:42:38 2017
New Revision: 317967
URL: https://svnweb.freebsd.org/changeset/base/317967

Log:
  Restore `sectorsize` global to unbreak makefs after r317744
  
  This also unbreaks the fstyp tests.
  
  Reported by:  Alastair Hogge <a...@fastmail.fm>, Jenkins
  Sponsored by: Dell EMC Isilon

Modified:
  head/usr.sbin/makefs/ffs.c
  head/usr.sbin/makefs/ffs/buf.c

Modified: head/usr.sbin/makefs/ffs.c
==============================================================================
--- head/usr.sbin/makefs/ffs.c  Mon May  8 18:30:56 2017        (r317966)
+++ head/usr.sbin/makefs/ffs.c  Mon May  8 18:42:38 2017        (r317967)
@@ -143,7 +143,7 @@ static  void        *ffs_build_dinode2(struct u
                                 fsnode *, fsinfo_t *);
 
 
-
+int    sectorsize;             /* XXX: for buf.c::getblk() */
        /* publicly visible functions */
 
 void
@@ -426,6 +426,8 @@ ffs_validate(const char *dir, fsnode *ro
                printf("ffs_validate: dir %s; %lld bytes, %lld inodes\n",
                    dir, (long long)fsopts->size, (long long)fsopts->inodes);
        }
+       sectorsize = fsopts->sectorsize;        /* XXX - see earlier */
+
                /* now check calculated sizes vs requested sizes */
        if (fsopts->maxsize > 0 && fsopts->size > fsopts->maxsize) {
                errx(1, "`%s' size of %lld is larger than the maxsize of %lld.",

Modified: head/usr.sbin/makefs/ffs/buf.c
==============================================================================
--- head/usr.sbin/makefs/ffs/buf.c      Mon May  8 18:30:56 2017        
(r317966)
+++ head/usr.sbin/makefs/ffs/buf.c      Mon May  8 18:42:38 2017        
(r317967)
@@ -52,6 +52,8 @@ __FBSDID("$FreeBSD$");
 #include "makefs.h"
 #include "buf.h"
 
+extern int sectorsize;         /* XXX: from ffs.c & mkfs.c */
+
 static TAILQ_HEAD(buftailhead,buf) buftail;
 
 int
@@ -60,7 +62,6 @@ bread(struct vnode *vp, daddr_t blkno, i
 {
        off_t   offset;
        ssize_t rv;
-       fsinfo_t *fs = vp->fs;
 
        assert (bpp != NULL);
 
@@ -68,7 +69,7 @@ bread(struct vnode *vp, daddr_t blkno, i
                printf("%s: blkno %lld size %d\n", __func__, (long long)blkno,
                    size);
        *bpp = getblk(vp, blkno, size, 0, 0, 0);
-       offset = (*bpp)->b_blkno * fs->sectorsize;
+       offset = (*bpp)->b_blkno * sectorsize;  /* XXX */
        if (debug & DEBUG_BUF_BREAD)
                printf("%s: blkno %lld offset %lld bcount %ld\n", __func__,
                    (long long)(*bpp)->b_blkno, (long long) offset,
@@ -125,10 +126,9 @@ bwrite(struct buf *bp)
 {
        off_t   offset;
        ssize_t rv;
-       fsinfo_t *fs = bp->b_fs;
 
        assert (bp != NULL);
-       offset = bp->b_blkno * fs->sectorsize;
+       offset = bp->b_blkno * sectorsize;      /* XXX */
        if (debug & DEBUG_BUF_BWRITE)
                printf("bwrite: blkno %lld offset %lld bcount %ld\n",
                    (long long)bp->b_blkno, (long long) offset,
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to