Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-6]: src Pull up following revision(s) (requested by hannken in ti...



details:   https://anonhg.NetBSD.org/src/rev/dc1bf5b3ba79
branches:  netbsd-6
changeset: 774369:dc1bf5b3ba79
user:      martin <martin%NetBSD.org@localhost>
date:      Mon Jul 30 08:05:33 2012 +0000

description:
Pull up following revision(s) (requested by hannken in ticket #449):
        sys/dev/fss.c: revision 1.82
        sys/dev/fss.c: revision 1.83
        usr.sbin/fssconfig/fssconfig.c: revision 1.9
Initialize `fss_flags' before setting an individual bit.
Not a real problem as there is only one valid bit yet.
>From Edgar Fuss via tech-kern%netbsd.org@localhost
Use `getdisksize()' to get the size of the mounted-on block device.
Should work for disks without partition table (wedges) now.
Minor fix to previous -- release vnode after last use, not before.

diffstat:

 sys/dev/fss.c                  |  13 +++++++------
 usr.sbin/fssconfig/fssconfig.c |   6 +++---
 2 files changed, 10 insertions(+), 9 deletions(-)

diffs (72 lines):

diff -r 55f7dfbb052b -r dc1bf5b3ba79 sys/dev/fss.c
--- a/sys/dev/fss.c     Mon Jul 30 07:55:58 2012 +0000
+++ b/sys/dev/fss.c     Mon Jul 30 08:05:33 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fss.c,v 1.81 2011/11/30 09:51:18 bouyer Exp $  */
+/*     $NetBSD: fss.c,v 1.81.4.1 2012/07/30 08:05:33 martin Exp $      */
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fss.c,v 1.81 2011/11/30 09:51:18 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fss.c,v 1.81.4.1 2012/07/30 08:05:33 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -622,8 +622,9 @@
     off_t *bsize, struct lwp *l)
 {
        int error, bits, fsbsize;
+       uint64_t numsec;
+       unsigned int secsize;
        struct timespec ts;
-       struct partinfo dpart;
        /* nd -> nd2 to reduce mistakes while updating only some namei calls */
        struct pathbuf *pb2;
        struct nameidata nd2;
@@ -705,17 +706,17 @@
        }
 
        sc->sc_bdev = vp->v_rdev;
-       vrele(vp);
 
        /*
         * Get the block device size.
         */
 
-       error = bdev_ioctl(sc->sc_bdev, DIOCGPART, &dpart, FREAD, l);
+       error = getdisksize(vp, &numsec, &secsize);
+       vrele(vp);
        if (error)
                return error;
 
-       *bsize = (off_t)dpart.disklab->d_secsize*dpart.part->p_size;
+       *bsize = (off_t)numsec*secsize;
 
        /*
         * Get the backing store
diff -r 55f7dfbb052b -r dc1bf5b3ba79 usr.sbin/fssconfig/fssconfig.c
--- a/usr.sbin/fssconfig/fssconfig.c    Mon Jul 30 07:55:58 2012 +0000
+++ b/usr.sbin/fssconfig/fssconfig.c    Mon Jul 30 08:05:33 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fssconfig.c,v 1.8 2011/08/30 18:30:13 joerg Exp $      */
+/*     $NetBSD: fssconfig.c,v 1.8.4.1 2012/07/30 08:05:33 martin Exp $ */
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -168,10 +168,10 @@
                err(1, "open: %s", argv[0]);
        }
 
+       fss.fss_flags = 0;
        if ((xflag || istmp) && isreg)
                fss.fss_flags |= FSS_UNLINK_ON_CREATE;
-       else
-               fss.fss_flags = 0;
+
        if (ioctl(fd, FSSIOCSET, &fss) < 0) {
                if (istmp)
                        unlink(fss.fss_bstore);



Home | Main Index | Thread Index | Old Index