summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_diskslice.c
Commit message (Collapse)AuthorAgeFilesLines
...
* Don't attempt to copy the whole slices "struct" for DIOCGSLICEINFO.bde1998-06-061-2/+3
| | | | | | | | | The slices "struct" isn't really a struct; we allocate only part of it in the fully dangerously dedicated case. Since the "struct" is malloced, the page beyond it may not be mapped, so attempts to copy it would crash. This problem became larger when the full struct was bloated from < 1K to > 3K by the addition of (mostly unused) DEVFS tokens some time before 2.2.0 was released.
* Discussed with: bdeobrien1998-04-241-1/+1
|
* Create virgin disklabels with 8 (MAXPARTITIONS) partitions rather thanobrien1998-04-241-4/+2
| | | | | three (RAW_PART + 1); This makes ``disklabel -Brw sdN auto'' do the Right Thing.
* Add changes and code to implement a functional DEVFS.julian1998-04-191-1/+4
| | | | | | | | | | | | | | | | | | | | | This code will be turned on with the TWO options DEVFS and SLICE. (see LINT) Two labels PRE_DEVFS_SLICE and POST_DEVFS_SLICE will deliniate these changes. /dev will be automatically mounted by init (thanks phk) on bootup. See /sys/dev/slice/slice.4 for more info. All code should act the same without these options enabled. Mike Smith, Poul Henning Kamp, Soeren, and a few dozen others This code does not support the following: bad144 handling. Persistance. (My head is still hurting from the last time we discussed this) ATAPI flopies are not handled by the SLICE code yet. When this code is running, all major numbers are arbitrary and COULD be dynamically assigned. (this is not done, for POLA only) Minor numbers for disk slices ARE arbitray and dynamically assigned.
* Fixed an aliasing bug. It was too easy to defeat the check for movingbde1998-02-151-3/+13
| | | | | | or shrinking an open partition (by changing the label for a compatibility slice while partitions on the corresponding real slice are open, or vice versa).
* Make all file-system (MFS, FFS, NFS, LFS, DEVFS) related option new-style.eivind1998-01-241-1/+3
| | | | | | | | This introduce an xxxFS_BOOT for each of the rootable filesystems. (Presently not required, but encouraged to allow a smooth move of option *FS to opt_dontuse.h later.) LFS is temporarily disabled, and will be re-enabled tomorrow.
* Use ENOIOCTL instead of -1 (= ERESTART) for diskslice ioctls that arebde1997-12-061-2/+2
| | | | not handled at a particular level.
* Rename some local variables to avoid shadowing other local variables.phk1997-11-071-5/+5
| | | | Found by: -Wshadow
* Reject attempts to set an in-core label which says that the "disk"bde1997-09-161-4/+10
| | | | | | | | | | | | | | | | | | | or a partition is larger than the slice. Now `disklabel -Brw sdX auto' should fail properly on sliced disks without partition of type 165, e.g., on zip disks with the factory default formatting. Previously it set a bogus in-core label for the compatibility slice and used this to corrupt the MBR (the slice has offset 0 and size 0, but setting the label in effect corrupted its size to nonzero). `disklabel -Brw sdX auto' already failed properly on normally (not dangerously dedicated) sliced disks _with_ partition of type 165, because the compatibility slice has a nonzero offset so the MBR remained inaccessible when the size was corrupted. This bug only affected in-core labels. On-disk labels are checked carefully when they read and written.
* Removed unused #includes.bde1997-09-021-2/+1
|
* Don't include <sys/ioctl.h> in the kernel. Stage 1: don't includebde1997-03-241-2/+1
| | | | | it when it is not used. In most cases, the reasons for including it went away when the special ioctl headers became self-sufficient.
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notpeter1997-02-221-1/+1
| | | | ready for it yet.
* This is the kernel Lite/2 commit. There are some requisite userlanddyson1997-02-101-0/+1
| | | | | | | | | | | | | | | changes, so don't expect to be able to run the kernel as-is (very well) without the appropriate Lite/2 userland changes. The system boots and can mount UFS filesystems. Untested: ext2fs, msdosfs, NFS Known problems: Incorrect Berkeley ID strings in some files. Mount_std mounts will not work until the getfsent library routine is changed. Reviewed by: various people Submitted by: Jeffery Hsu <hsu@freebsd.org>
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
* Removed all references to b_cylinder (aka b_cylin). It was evil andbde1996-12-011-8/+1
| | | | | hasn't been used for a year or two since disksort() started sorting on b_pblkno.
* This update adds the support for != 512 byte sector SCSI devices tosos1996-12-011-1/+3
| | | | | | | | | | | | | | | | the sd & od drivers. There is also slight changes to fdisk & newfs in order to comply with different sectorsizes. Currently sectors of size 512, 1024 & 2048 are supported, the only restriction beeing in fdisk, which hunts for the sectorsize of the device. This is based on patches to od.c and the other system files by John Gumb & Barry Scott, minor changes and the sd.c patches by me. There also exist some patches for the msdos filesys code, but I havn't been able to test those (yet). John Gumb (john@talisker.demon.co.uk) Barry Scott (barry@scottb.demon.co.uk)
* Search for labels on all slices whenever any minor for a drive is opened.bde1996-10-291-44/+55
| | | | | | | | If DEVFS is configured, create devfs devices for previously invisible partitions on the slices. Fixed an old aliasing bug which caused E=17 errors from DEVFS for DIOCSDINFO when there were no real slices.
* Don't include <sys/conf.h> for the kernel in disk-related headers.bde1996-09-201-1/+2
| | | | | | | | | | It is needed for implementation details but very little of it is needed for the interface. Include it in the few places that didn't already include it. Include <sys/ioccom.h> in <sys/disklabel.h> (as already in <sys/diskslice.h>) so that all the disk-related headers are almost self-sufficient.
* dscheck() was returning without setting bp->b_error when given a negativepeter1996-08-021-1/+2
| | | | | | block number.. (assuming Debugger() returned). The disk drivers assume that dscheck() sets both error markers (bp->b_error and set B_ERROR in bp->b_flags) if it fails.
* Moved initialization of defaults for the label for the whole disk frombde1996-06-171-1/+21
| | | | | | | disklabel(8) to the kernel (dsopen()). Drivers should initialize the hardware values (rpm, interleave, skews). Drivers currently don't do this, but it usually doesn't matter since rotational position stuff is normally disabled.
* Clean up -Wunused warnings.gpalmer1996-06-121-2/+1
| | | | Reviewed by: bde
* Fixed removal of devfs entries for the real slice corresponding to thebde1996-04-191-10/+55
| | | | | | | | | compatibility slice. They were forgotten on last-close and then creating them on first-open failed. Devfs entries for slices other than the one containing the root file system are still invisible unless you open a non-devfs inode on the slice.
* Cleaned up naming and formatting in recent changes.bde1996-04-071-18/+15
|
* Fixed a bug in DEVFS code that was producing "name slot allocation failed"scrappy1996-04-051-15/+12
| | | | messages.
* changed from using dev_link() to devfs_link()scrappy1996-04-021-3/+3
|
* Convert from using dev_link() to dev_linkf()scrappy1996-04-011-15/+21
|
* Fixed group of disk devices (was wheel or games, now operator).bde1996-03-271-14/+14
| | | | | | | | | | | Added scsi control devices. Converted almost everything that I changed to use devfs_add_devswf() and verbose id macros. st.c: Renamed enrst* to erst* since that's what the current name is (enrst seems to be an old name).
* Fixed dangling pointer bugs in DIOCSDINFO.bde1996-01-281-7/+7
| | | | | Enabled DEVFS support. It doesn't work while devfs is mounted (add_devfs_devsw() doesn't work then), but seems to be safe.
* [Oops, forgot to commit this together with things that depend on it.]bde1996-01-271-11/+133
| | | | | | | | | | | First attempt at creating devfs entries for sliced devices. Doesn't quite work yet, so the heart of it is disabled. Added bdev and cdev args to dsopen(). Create devfs entries in dsopen() and (unsuccessfully) attempt to make them go away at the right times. DEVFS is #undefed at the start so that this shouldn't cause problems.
* Remove local TRUE & FALSE definitions.phk1996-01-161-5/+4
| | | | Fall into debugger on negative blk#.
* It's bad if the blockno is negative.phk1996-01-071-1/+4
|
* Remove transitory labelling code. Labels are now handled by essentiallybde1995-09-161-3/+3
| | | | | the original 4.4lite code. Machine Specific Partitions are now handled separately.
* Remove trailing whitespace.rgrimes1995-05-301-2/+2
|
* This should fix PR 438. Apparently I never tested disklabel on the blockdg1995-05-241-1/+4
| | | | | | | | | | device. v_numoutput wasn't incremented to match the b_iodone nesting. It's still fishy that vwakeup() clears B_WRITEINPROG before biodone() has finished; however, B_WRITEINPROG seems to be never used. Submitted by: Bruce Evans
* Fix reopening of open subdevices for DIOCSYNCSLICEINFO:bde1995-05-081-8/+45
| | | | | | | | | | | Reopen the bdev for the raw partition and not the cdev if only the bdev was open. Don't use a bogus limit for the number of partitions to possibly reopen (bug found by Julian). Add function dssize() to help fix wdsize() and sdsize(). The slice layer knows more about (un)open partitions and partition sizes than the driver layer.
* Change dsioctl() interface to allow DIOCSYNCSLICEINFO to update the caller'sbde1995-04-301-17/+70
| | | | | | slice pointer and to print the device name in error messages. Finishing implementing DIOCSYNCSLICEINFO (except for locking).
* Add ioctls DIOCGSLICEINFO and DIOCSYNCSLICEINFO. The latter isn'tbde1995-04-241-1/+24
| | | | finished or tested.
* Make bad144 debugging code conditional on ds_debug.bde1995-04-241-2/+2
|
* Don't warn about missing labels for non-BSD slices.bde1995-03-041-13/+38
| | | | | | | | | | | | Don't print debugging messages by default. Initialize the compatibility slice here and not in the machine-dependent code. Fix initialization of the label for the whole disk slice. Make it clear that write protection of labels doesn't apply when there is no label.
* Fix initialization of the copy of the label passed to setdisklabel().bde1995-02-221-115/+120
| | | | | | | | | | | | | Fix the sign of the adjustment after writing a label. Writing of labels should work now. Merge adjust_label() into fixlabel(). Detect more errors and don't write if there is an error. Adjust sectors/unit and total sectors to the numbers on the slice. Add a function dsname() to print slice device names consistently, and use it.
* Discard junk from partition tables when reading the tables for applicationsbde1995-02-211-43/+71
| | | | | | | | | | | | | | | | | | | the same as when initializing the in-core copies. Adjust checksums in labels after adjusting labels. This finishes fudging the on-disk label to make it coherent with the in-core label. Handle EIO during initialization better. Initialize the compatibility slice to the whole disk If there are no real slices. Don't warn about adjusting offsets in the label to make the 'c' partition start at 0. The 'c' offset is now always absolute on-disk and 0 in-core so an adjustment is usually required. Don't confuse LABEL_PART with RAW_PART so much. Check for partitions being within slices differently.
* Keep absolute offsets in on-disk labels for backwards compatibility. Thisbde1995-02-181-17/+106
| | | | | | | | | | | | | | | | requires complications to adjust the offsets to relative when a block containing the label is read and back to absolute when such a block is written. The adjustment is not made on the whole disk slice. Don't allow setting the offset of partition C to nonzero in in-core labels. This will cause some (nonstandard) disktab entries to fail. They will need to be changed to have relative offsets (and no partitions outside of the slice). Don't write protect the (nonexistent) label on the whole disk slice. Writing labels and bootstraps should work right now (except if there is no DOSpartition table).
* Add compatibility cruft.bde1995-02-161-30/+104
| | | | | | | | | | | | | | | | | | | | | | | | | Slice 0 is now for the first BSD slice. The first BSD slice is the first DOSpartition with id 0xa5 or the whole disk if their are no DOSpartitions (except the latter is not yet implemented). Existing partitions on it work the same as in 2.0 except the 'd' partition is no longer special and partitions are relative to the skice. Slice 1 is now for the whole disk and gets a read-only label describing the disk. Previously, slice 0 was for the whole disk and there was no label on it. Slices 2-31 are for DOSpartitions. Slice 0 is an alias for one of these if there is a BSD slice. Previously, slices 1-31 were for DOSpartitions. diskslice_machdep.c: Expand whole disk slice to include all DOSpartitions. More work is required for >1024 cylinders and to rewrite the label iff the driver is unsure about the geometry. subr_diskslice.c: New function dsisopen() to help handle media changes.
* $Id: -> $Id$phk1995-01-311-1/+1
|
* Separate go-away code from dsinit() to produce dsgone().bde1994-12-161-16/+27
| | | | | | | Call correct_writedisklabel() instead of writedisklabel() (temporary compatibility hack). Remove kludge for allowing a label on slice 0.
* subr_diskslice.c implements everything related to slices and labels exceptbde1994-12-121-0/+522
reading and writing the slice tables and labels. subr_dkbad.c implements everything related to bad sector remapping using the bad144 format.
OpenPOWER on IntegriCloud