summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_disklabel.c
Commit message (Collapse)AuthorAgeFilesLines
* Convert buffer locking from using the B_BUSY and B_WANTED flags to usingmckusick1999-06-261-5/+5
| | | | | | | lockmgr locks. This commit should be functionally equivalent to the old semantics. That is, all buffer locking is done with LK_EXCLUSIVE requests. Changes to take advantage of LK_SHARED and LK_RECURSIVE will be done in future commits.
* Fix -Wuninitialized warning regarding zero-length var-args ctl element.dillon1998-12-141-2/+2
| | | | | ( this isn't really an error, but I think it is important to fix the warning ).
* Use only the correct raw partition for writing labels. Don't use thebde1998-10-171-9/+4
| | | | | | | | | | | | | | | | | | | | | partition that the label ioctl is being done on just because it has offset 0, since there is no guarantee that such a partition is large enough to contain the label. Don't use the wrong raw partition (0 instead of RAW_PART). This fixes problems rewriting bizarre labels (with a nonzero offset for the 'a' partition) in newfs(8). Such labels shouldn't normally be used, but creating them was allowed if the ioctl was done on the raw partition, and sysinstall creates them if the root partition isn't allocated first. Note that allowing write access to a partition other than the one that has been checked for write access doesn't increase security holes significantly, since write access to any partition already allows changing the in-core label. This fix should be in 3.0R. Rev.1.26 of newfs/newfs.c shouldn't be in 3.0R.
* fixup for alpha.jkh1998-10-161-1/+4
|
* When a buffer is removed from a buffer queue, remember it's block numbergibbs1998-09-151-26/+52
| | | | and use it as "the currently active" buffer in doing disk sort calculations.
* Used daddr_t's, not ints, to store disk block numbers. Updated printfbde1998-07-281-9/+11
| | | | | | | | formats and args to match. Fixed old printf format errors (all related; most were hidden by calling printf indirectly). This change somehow avoids compiler bugs for 64-bit longs on i386's, although it increases the number of 64-bit calculations.
* Don't depend on "implicit int".bde1998-02-201-2/+2
|
* Remove a bunch of variables which were unused both in GENERIC and LINT.phk1997-11-071-2/+1
| | | | Found by: -Wunused
* Convert tqdisksort to bufqdisksort. Honor the B_ORDERED buffer flaggibbs1997-09-211-77/+56
| | | | so that meta-data writes go out to the device in the right order.
* Use the correct size for a sector in the search for a label inbde1997-07-131-3/+3
| | | | readdisklabel(). Sectors may be larger than DEV_BSIZE.
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notpeter1997-02-221-1/+1
| | | | ready for it yet.
* 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-9/+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-3/+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)
* 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.
* Clean up various compiler warnings. Most (if not all) were benigngpalmer1996-05-081-2/+2
| | | | Reviewed by: bde
* disksort() is gone, all drivers now use tqdisksort().phk1996-05-031-72/+1
|
* Yet more b_flags fixes. The previous ones broke the clearing of B_DONEbde1996-04-191-1/+5
| | | | | | | and B_READ before writing. This was was fatal. They also broke the clearing of B_INVAL before doing i/o. This didn't actually matter. Submitted by: mostly by joerg
* More b_flags fixes.dyson1996-03-021-4/+4
|
* Fix a bug that b_flags was getting unnecessarily modified bydyson1996-03-011-3/+3
| | | | | the slice code. The effect up to now has been insignficant, but improved buffer allocation code will break with this problem.
* Update the wd.c driver to use the new TAILQ scheme for devicedyson1995-11-231-1/+94
| | | | | | buffer queue. Also, create a new subroutine 'tqdisksort' that is an improved version of the original disksort that also uses TAILQs.
* Remove transitory labelling code. Labels are now handled by essentiallybde1995-09-161-287/+16
| | | | | the original 4.4lite code. Machine Specific Partitions are now handled separately.
* Fix correct_writedisklabel() and writedisklabel(). Their setting ofbde1995-08-281-11/+14
| | | | | | | | | | | bp->b_flags has been broken for many years: a) they didn't set B_BUSY for doing i/o. This has been fatal since 1995/07/25 when biodone() started checking that B_BUSY is set. b) they didn't set B_INVAL for releasing the buffer. This at best just put a useless buffer in the LRU queue for a little while. Fix a couple of spelling errors and complete a couple of function pointer declarations.
* On closer inspection, it turns out that all of the callers of disksortdg1995-08-071-5/+1
| | | | are already at splbio()...so back out the last change to disksort.
* Since buffers can be pulled off of the disk queue at interrupt time anddg1995-08-071-2/+7
| | | | | | disksort is called at non-interrupt time and can be actively traversing the list when that happens, there is a very small window of vulnerability. Close it by protecting disksort with splbio().
* Remove trailing whitespace.rgrimes1995-05-301-5/+5
|
* Woops, add back that #define...it's used later in the file.dg1995-03-181-1/+8
|
* Fixed comments and removed b_cylinder #define.dg1995-03-181-13/+5
|
* Integrated change from 1.1.5: Fixed broken disksort to sort by pblknodg1995-03-181-13/+6
| | | | rather than by cylinder.
* Finish the previous change. The device name got lost in diskerr().bde1995-03-121-2/+2
|
* Use dsname() to get consistent names.bde1995-02-221-13/+6
|
* Adjust slice names in diskerr() for the rearranged slice numbers. Thebde1995-02-161-11/+11
| | | | | | | | | | | | mapping from numbers to names is messy for backwards compatibility. E.g., for driver "sd", unit "0": slice 0: omit the slice number for compatibility; names are sd0[a-h]. slice 1: omit the partition letter 'c' because the whole disk device shouldn't have anything to do with partitions; sd0 is the only name. slices 2-31: subtract 1 from slice number to compensate for the compatibility slice 0; names are sd0s[1-30][a-h].
* Print `slicename' and not a bogus pointer in diskerr()bde1994-12-221-2/+2
|
* Duplicate readdisklabel() and writedisklabel() and remove DOS stuff frombde1994-12-161-7/+145
| | | | | | | from the copies to create correct_readdisklabel() and correct_writedisklabel(). Print the slice number in diskerr() if it is nonzero.
* Julian Elischer's disklabel fixes.jkh1994-10-271-86/+146
|
* This basically allows you to stick a disklabel on any partition.phk1994-10-171-1/+4
| | | | | | | | For it to be useful, you must stick your disklabel on the partition which starts where the MBR says FreeBSD lives. If you don't do that, you might get a bad day. Oh, that probably also means that putting swap there is a bad idea...
* POSSIBLE BOGUS CODE found, (related to dos-partitions) in ufs_disksubr.c,phk1994-10-081-5/+11
| | | | | look for CC_WALL. Cosmetics, a couple of unused vars.
* Added $Id$dg1994-08-021-0/+1
|
* The big 4.4BSD Lite to FreeBSD 2.0.0 (Development) patch.rgrimes1994-05-251-4/+101
| | | | | Reviewed by: Rodney W. Grimes Submitted by: John Dyson and David Greenman
* BSD 4.4 Lite Kernel Sourcesrgrimes1994-05-241-0/+364
OpenPOWER on IntegriCloud