cvs commit: src/sys/kern subr_diskmbr.c subr_diskslice.c

Matthew Dillon dillon at crater.dragonflybsd.org
Sat May 19 02:47:51 PDT 2007


dillon      2007/05/19 02:46:18 PDT

DragonFly src repository

  Modified files:
    sys/kern             subr_diskmbr.c subr_diskslice.c 
  Log:
  Keep the ds_skip_* fields in struct diskslice properly synchronized.
  ds_skip_bsdlabel is inclusive of bsd_skip_platform but was being improperly
  set to 0 even when an mbr reserved sector existed.  The fields were not
  being properly reset for a slice whos disklabel is destroyed.
  
  Defer reading the disklabel on a slice until a partition on the slice
  is opened or a disklabel related DIOC ioctl is performed on the slice.
  In particular, we do not attempt to read the disklabel when opening the
  whole-disk-slice for the whole disk or the whole-slice-partition for a slice.
  
  Previously the code attempted to scan all available BSD slices for
  disklabels.
  
  When writing to a raw slice, do not snoop or do reserved-sector checks
  unless a disklabel has been loaded for the slice.  Typically a disklabel
  will only be loaded in two situations: (1) if filesystems are mounted from
  that slice or (2) the disklabel program has performed ioctls on the
  whole-slice-partition to set a disklabel.  Now writing to raw slices works
  almost the same as writing to the whole-disk-slice, with no interpretation.
  
  Remove all remaining references to the LABELSECTOR constant.  Instead,
  use the ds_skip_* fields to determine the sector where the disklabel
  starts within a slice.  These changes significantly cleaned up the
  snoop and reserved sector checking code in dscheck().
  
  Revision  Changes    Path
  1.24      +4 -2      src/sys/kern/subr_diskmbr.c
  1.37      +158 -87   src/sys/kern/subr_diskslice.c


http://www.dragonflybsd.org/cvsweb/src/sys/kern/subr_diskmbr.c.diff?r1=1.23&r2=1.24&f=u
http://www.dragonflybsd.org/cvsweb/src/sys/kern/subr_diskslice.c.diff?r1=1.36&r2=1.37&f=u





More information about the Commits mailing list