Module Name: src
Committed By: martin
Date: Mon Jul 30 08:05:33 UTC 2012
Modified Files:
src/sys/dev [netbsd-6]: fss.c
src/usr.sbin/fssconfig [netbsd-6]: fssconfig.c
Log Message:
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 [email protected]
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.
To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.81.4.1 src/sys/dev/fss.c
cvs rdiff -u -r1.8 -r1.8.4.1 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.81 src/sys/dev/fss.c:1.81.4.1
--- src/sys/dev/fss.c:1.81 Wed Nov 30 09:51:18 2011
+++ src/sys/dev/fss.c Mon Jul 30 08:05:33 2012
@@ -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 @@ 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;
/* nd -> nd2 to reduce mistakes while updating only some namei calls */
struct pathbuf *pb2;
struct nameidata nd2;
@@ -705,17 +706,17 @@ fss_create_files(struct fss_softc *sc, s
}
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
Index: src/usr.sbin/fssconfig/fssconfig.c
diff -u src/usr.sbin/fssconfig/fssconfig.c:1.8 src/usr.sbin/fssconfig/fssconfig.c:1.8.4.1
--- src/usr.sbin/fssconfig/fssconfig.c:1.8 Tue Aug 30 18:30:13 2011
+++ src/usr.sbin/fssconfig/fssconfig.c Mon Jul 30 08:05:33 2012
@@ -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 @@ 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);