Date: Sat, 15 Mar 2003 03:56:24 -0800 From: Alfred Perlstein <bright@mu.org> To: Poul-Henning Kamp <phk@phk.freebsd.dk> Cc: current@freebsd.org Subject: Re: can't boot with twe anymore. Message-ID: <20030315115624.GD4145@elvis.mu.org> In-Reply-To: <17808.1047722362@critter.freebsd.dk> References: <20030315022255.GW4145@elvis.mu.org> <17808.1047722362@critter.freebsd.dk>
next in thread | previous in thread | raw e-mail | index | archive | help
* Poul-Henning Kamp <phk@phk.freebsd.dk> [030315 01:59] wrote:
> In message <20030315022255.GW4145@elvis.mu.org>, Alfred Perlstein writes:
> >Poul-Henning you promised me a patch two nights ago "within a couple
> >of hours" It's now going on the 36th hour since.
>
> Ok, 2nd try, this even compiles:
That looks like it might work, but doesn't it work around instead
of fix the problem you found where twe does sparse unit assignment?
>
>
> Index: twe_compat.h
> ===================================================================
> RCS file: /home/ncvs/src/sys/dev/twe/twe_compat.h,v
> retrieving revision 1.6
> diff -u -r1.6 twe_compat.h
> --- twe_compat.h 8 Mar 2003 08:01:30 -0000 1.6
> +++ twe_compat.h 15 Mar 2003 09:58:06 -0000
> @@ -166,7 +166,7 @@
> # define TWE_BIO_LENGTH(bp) (bp)->bio_bcount
> # define TWE_BIO_LBA(bp) (bp)->bio_pblkno
> # define TWE_BIO_SOFTC(bp) (bp)->bio_disk->d_drv1
> -# define TWE_BIO_UNIT(bp) (bp)->bio_disk->d_unit
> +# define TWE_BIO_UNIT(bp) *(int *)(bp->bio_driver1)
> # define TWE_BIO_SET_ERROR(bp, err) do { (bp)->bio_error = err; (bp)->bio_flags |= BIO_ERROR;} while(0)
> # define TWE_BIO_HAS_ERROR(bp) ((bp)->bio_flags & BIO_ERROR)
> # define TWE_BIO_RESID(bp) (bp)->bio_resid
> Index: twe_freebsd.c
> ===================================================================
> RCS file: /home/ncvs/src/sys/dev/twe/twe_freebsd.c,v
> retrieving revision 1.24
> diff -u -r1.24 twe_freebsd.c
> --- twe_freebsd.c 8 Mar 2003 08:01:30 -0000 1.24
> +++ twe_freebsd.c 15 Mar 2003 09:57:24 -0000
> @@ -607,6 +607,7 @@
>
> debug_called(4);
>
> + bp->bio_driver1 = &sc->twed_drive->td_unit;
> TWED_BIO_IN;
>
> /* bogus disk? */
>
> --
> Poul-Henning Kamp | UNIX since Zilog Zeus 3.20
> phk@FreeBSD.ORG | TCP/IP since RFC 956
> FreeBSD committer | BSD since 4.3-tahoe
> Never attribute to malice what can adequately be explained by incompetence.
--
-Alfred Perlstein [alfred@freebsd.org]
'Instead of asking why a piece of software is using "1970s technology,"
start asking why software is ignoring 30 years of accumulated wisdom.'
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030315115624.GD4145>
