Module Name: src Committed By: bouyer Date: Thu Aug 23 08:59:47 UTC 2012
Modified Files: src/sys/dev [netbsd-5]: fss.c src/usr.sbin/fssconfig [netbsd-5]: fssconfig.c Log Message: Pull up following revision(s) (requested by hannken in ticket #1784): sys/dev/fss.c: revisions 1.82 and 1.83 via patch usr.sbin/fssconfig/fssconfig.c: revision 1.9 Initialize `fss_flags' before setting an individual bit. Use `getdisksize()' to get the size of the mounted-on block device. Should work for disks without partition table (wedges) now. To generate a diff of this commit: cvs rdiff -u -r1.60.4.5 -r1.60.4.6 src/sys/dev/fss.c cvs rdiff -u -r1.6.6.1 -r1.6.6.2 src/usr.sbin/fssconfig/fssconfig.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/fss.c diff -u src/sys/dev/fss.c:1.60.4.5 src/sys/dev/fss.c:1.60.4.6 --- src/sys/dev/fss.c:1.60.4.5 Wed Jan 25 18:06:26 2012 +++ src/sys/dev/fss.c Thu Aug 23 08:59:47 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: fss.c,v 1.60.4.5 2012/01/25 18:06:26 riz Exp $ */ +/* $NetBSD: fss.c,v 1.60.4.6 2012/08/23 08:59:47 bouyer Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -36,7 +36,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: fss.c,v 1.60.4.5 2012/01/25 18:06:26 riz Exp $"); +__KERNEL_RCSID(0, "$NetBSD: fss.c,v 1.60.4.6 2012/08/23 08:59:47 bouyer Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -589,8 +589,9 @@ fss_create_files(struct fss_softc *sc, s off_t *bsize, struct lwp *l) { int error, bits, fsbsize; + uint64_t numsec; + unsigned int secsize; struct timespec ts; - struct partinfo dpart; struct vattr va; struct nameidata nd; @@ -668,17 +669,17 @@ fss_create_files(struct fss_softc *sc, s } sc->sc_bdev = nd.ni_vp->v_rdev; - vrele(nd.ni_vp); /* * Get the block device size. */ - error = bdev_ioctl(sc->sc_bdev, DIOCGPART, &dpart, FREAD, l); + error = getdisksize(nd.ni_vp, &numsec, &secsize); + vrele(nd.ni_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 Index: src/usr.sbin/fssconfig/fssconfig.c diff -u src/usr.sbin/fssconfig/fssconfig.c:1.6.6.1 src/usr.sbin/fssconfig/fssconfig.c:1.6.6.2 --- src/usr.sbin/fssconfig/fssconfig.c:1.6.6.1 Sat Jun 18 17:00:26 2011 +++ src/usr.sbin/fssconfig/fssconfig.c Thu Aug 23 08:59:47 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: fssconfig.c,v 1.6.6.1 2011/06/18 17:00:26 bouyer Exp $ */ +/* $NetBSD: fssconfig.c,v 1.6.6.2 2012/08/23 08:59:47 bouyer Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -168,10 +168,10 @@ configure: 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);