Subject: query about bounds_check_with_label()
To: None <port-i386@NetBSD.ORG>
From: Alasdair Baird <alasdair@wildcat.demon.co.uk>
List: port-i386
Date: 01/13/1997 20:26:56
I was having a poke through i386/disksubr.c and came upon
the following fragment of code:

> /*
>  * Determine the size of the transfer, and make sure it is 
>  * within the boundaries of the partition. Adjust transfer 
>  * if needed, and signal errors or early completion.
>  */
> int   
> bounds_check_with_label(bp, lp, wlabel)
>         struct buf *bp; 
>         struct disklabel *lp;
>         int wlabel;
> {
>         struct partition *p = lp->d_partitions + DISKPART(bp->b_dev);
>         int labelsector = lp->d_partitions[2].p_offset + LABELSECTOR;
>         int sz;

What made my eyes stop upon this bit of code was the use of the
constant "2" for identifying the partition offset from which a
label is found.

Am I confused, or should this be the constant "RAW_PART", which
would then locate the label from within partition d rather than c?


   Alasdair.