summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_disk.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove last two 'uses' of d_subtype in tree. No point in settingkrw2015-08-121-2/+1
| | | | | | | | it to 0 immediately after a bzero() of the entire label. Nor in swapping endianness since nobody looks at it. Don't touch the actual field in disklabel. Yet. ok deraadt@ as part of larger diff that needs splitting up.
* Zap a couple of extra blank lines that keep showing up in diffs I'mkrw2015-07-291-3/+1
| | | | trying to build.
* Convert sectors to DEV_BSIZE block values were necessary to find,krw2015-07-281-7/+11
| | | | | | | | | | read and validate disklabels on GPT partitioned disks. Makes it much more likely GPT partitioned disks with non-512-byte sectors will work. Part of the larger reverted GPT work. ok deraadt@
* Always initialize the b_error field and B_ERROR flag before usingkrw2015-07-261-3/+5
| | | | | | | a buf. Otherwise stale data might cause a successful I/O to be seen as a failed I/O. ok tedu@
* Revert attempted GPT code cleanup. Too much code, too little testing.krw2015-07-231-253/+192
| | | | Requested by deraadt@
* Cleanup/rejig GPT code to be more readable, support different endiankrw2015-05-091-192/+253
| | | | | | | | | archs and different sized disk sectors. Make MBR have higher priority than GPT. Add many paranoia checks and associated DPRINTF's to make further development easier. Keep everything hidden behind #ifdef GPT. Tested and ok doug@ mpi@. Nothing bad seen by millert@.
* Bring back '#include <lib/libz/zlib.h>', but inside #ifdev GPT. GPTkrw2015-03-151-1/+5
| | | | | | routines use crc32(). ok jsg@ doug@
* Remove some includes include-what-you-use claims don'tjsg2015-03-141-3/+1
| | | | | | | have any direct symbols used. Tested for indirect use by compiling amd64/i386/sparc64 kernels. ok tedu@ deraadt@
* remove the second void * argument on tasks.dlg2015-01-271-4/+4
| | | | | | | | | | | | | | | | | | | | | when workqs were introduced, we provided a second argument so you could pass a thing and some context to work on it in. there were very few things that took advantage of the second argument, so when i introduced pools i suggested removing it. since tasks were meant to replace workqs, it was requested that we keep the second argument to make porting from workqs to tasks easier. now that workqs are gone, i had a look at the use of the second argument again and found only one good use of it (vdsp(4) on sparc64 if you're interested) and a tiny handful of questionable uses. the vast majority of tasks only used a single argument. i have since modified all tasks that used two args to only use one, so now we can remove the second argument. so this is a mechanical change. all tasks only passed NULL as their second argument, so we can just remove it. ok krw@
* Rework disklabel reading taskq to plug holes pointed out by jsing@.krw2014-12-301-28/+34
| | | | | | Diff from dlg@. ok jsing@
* Replace last workq in tree (reading disklabels from newly attachedkrw2014-12-281-23/+25
| | | | | | disks) with taskq. Diff originally from blambert@. ok kettenis@
* Zap a sneaky trailing blank that was hiding in plain view.krw2014-12-201-2/+2
|
* Zap local variable that shadows another local variable. Fixes a panic causedkettenis2014-12-201-2/+1
| | | | | | by passing random stack garbage as the size to free(9). From David Imhoff
* Zap a bunch of leading/trailing whitespace.krw2014-12-201-10/+10
|
* primary change: move uvm_vnode out of vnode, keeping only a pointer.tedu2014-12-161-5/+5
| | | | | | objective: vnode.h doesn't include uvm_extern.h anymore. followup changes: include uvm_extern.h or lock.h where necessary. ok and help from deraadt
* correct test logic. ok guenthertedu2014-11-031-2/+2
|
* deobfuscate by pulling le conversions up. use mallocarray.tedu2014-11-031-8/+16
|
* pass size argument to free()deraadt2014-11-031-2/+2
| | | | ok doug tedu
* remove uneeded proc.h includesjsg2014-09-141-2/+1
| | | | ok mpi@ kspillner@
* Recognize EFI protective and system partitions. Do not put disklabel entriesmiod2014-08-301-2/+4
| | | | | | | for the protective ones when creating a fake label, but do, for the system ones, so that we may eventually copy boot code to them. From Markus Mueller
* Initial support to read GPT partition tables in the kernel, if option GPT.miod2014-07-131-1/+323
| | | | | | | Contributed by Markus Mueller; code based upon Bitrig's GPT support, with stricter GPT structures validation and support for alternate header places. ok deraadt@ jsing@ krw@
* add a size argument to free. will be used soon, but for now default to 0.tedu2014-07-121-2/+2
| | | | after discussions with beck deraadt kettenis.
* Remove the temporary dospartoff work around.jsing2014-07-121-19/+1
| | | | | | From Markus Mueller. ok krw@ miod@ tedu@
* reboot(9): Add MI reboot entry functionuebayasi2014-07-111-3/+3
| | | | | | | | Now, for kernel to "reboot" (reboot, halt, or shutdown), MD boot(9) is called in some places. This change introduces a new MI function reboot(9) which is simply a wrapper to call MD boot(9). OK kettenis@ deraadt@
* this doesnt talk to uvm directly, so doesnt need uvm_extern.hdlg2014-07-021-2/+1
| | | | deraadt says go ahead
* When a disklabel is read from a MBR partitioned disk, don'tkrw2014-01-241-2/+5
| | | | | | | | replace the OpenBSD bounds with the A6 MBR partition limits. Thus preserving any changes the user makes with the 'b' command in disklabel. Reported, tested & ok blambert@, ok deraadt@
* Delete spurious if statement.krw2014-01-231-4/+1
| | | | ok phessler@ deraadt@ jsing@ guenther@
* Write disklabel in correct spot on devices with non-512-byte sectors.krw2014-01-221-14/+39
| | | | | | | | For now and until 5.5 is cut, also read from current/incorrect spot so people don't immediately lose their existing disklabels on such devices. Problem spotted by David Vasek.
* bzero -> memsettedu2014-01-211-11/+11
|
* now that all the direct users of disksort have been removed, we can nowdlg2013-11-201-97/+1
| | | | | | | | | | | | | | | | safely remove disksort. most hardware and pretty much all of the kernel has moved to logical block addressing when dealing with disks, so the assumptions disksort was built against arent useful these days. it also has bad edge cases with lots of sequential writes being able to starve other io requests in the system. these issues have been addressed by becks nscan implementation, which disksort was previously deprecated in favour of. this removes the guts of disksort and the bufq wrapper around it. ok miod@
* panic expects a format stringderaadt2013-11-181-2/+2
|
* Sprinkle (long long) casts where %lld is being used to print daddr_tkrw2013-11-011-9/+10
| | | | | | variables. Some random whitespace/knf repairs encountered on the way. ok miod@ on inspection, feedback & more suggestions from millert@
* KNF a long line.krw2013-10-201-2/+3
|
* Use daddr_t * instead of int * for the partoffp parameter tokrw2013-10-191-2/+2
| | | | | | | | | | | | readdoslabel(). Ditto all the MD variables whose addresses are passed to readdoslabel() via partoffp. Fix some 512-byte block vs disk sector confusion in hppa and sgi. All the DL_GETxxxxx() defines return disk sector values. All DL_SETxxxx() take disk sector values. These changes should be no-ops until a drive using non-512-byte-sectors is encountered. ok deraadt@
* Display correct values (i.e. blocks where blocks are meant) inkrw2013-10-141-6/+6
| | | | diskerr() messages by doing DL_SECTOBLK() dance repeatedly.
* disk sizes, partition sizes and partition offsets are u_int64_tkrw2013-10-071-5/+5
| | | | | values rather than daddr_t values. So use u_int64_t to store them and %llu to print them in checkdisklabel().
* When a partition is changing to UNUSED, we try to save kernel-setkrw2013-09-031-9/+4
| | | | | | | | | | | | values for the p_fragblock and p_cpg fields. But we were saving the info for open partitions only. Instead, look at all partitions. And stop discarding the new partition type. In addition to general betterness, this lets you change the RAW_PART partition (a.k.a. 'c') to UNUSED. This problem was pointed out by Federico Giannici via misc@. ok otto@
* Uncomment kprintf format attributes for sys/kernsyl2013-08-081-2/+2
| | | | tested on vax (gcc3) ok miod@
* don't use empty format stringsf2013-07-031-3/+2
| | | | | | this is necessary to enable -Wformat or -Wno-error=format ok deraadt@
* final removal of daddr64_t. daddr_t has been 64 bit for a long enoughderaadt2013-06-111-5/+5
| | | | | test period; i think 3 years ago the last bugs fell out. ok otto beck others
* When attaching disks, feed the disklabel's checksum toblambert2013-04-241-2/+4
| | | | | | | | the random pool as unique-esque-but-not-secret data. inspired by conversations with tedu@/deraadt@ ok deraadt@
* Comment out recently added __attribute__((__format__(__kprintf__))) annotationsmiod2013-02-171-2/+2
| | | | | | in MI code; gcc 2.95 does not accept such annotation for function pointer declarations, only function prototypes. To be uncommented once gcc 2.95 bites the dust.
* Add explicit __attribute__ ((__format__(__kprintf__)))) to the functions andmiod2013-02-091-2/+2
| | | | | | function pointer arguments which are {used as,} wrappers around the kernel printf function. No functional change.
* Tweak FAT detection/usage. Recognize 'bare' FAT media that lackskrw2012-04-071-8/+13
| | | | | | | | | | the 0x55aa signature. Don't try FAT detection if we have found an OpenBSD MBR partition. Don't try to read a disklabel from 'bare' FAT media. There can't be one. Finally, don't allow the writing of a disklabel on 'bare' FAT media. There is no safe spot for it, and splatting it in the middle of the FAT structures has not proved helpful.
* Some whitespace/paren tweaks. Rename the mbr testing variable fromkrw2012-03-311-6/+6
| | | | 'fattest' to 'mbrtest'. No change to .o.
* DUIDs are only valid when booting off of a disk, so make sure we arephessler2012-02-101-15/+18
| | | | | | actually doing so before using them OK deraadt@, krw@
* When disklabels can't be read before attempting to mount root, makekrw2012-01-211-3/+9
| | | | | | | the message less scary and print out the failing devices to improve troubleshooting. ok jsing@
* Do not wait for DKF_OPENED to be set if we never actually created ajsing2012-01-211-2/+3
| | | | | | | | callback for this disk. Fixes an issue found by krw on macppc. ok krw@
* Ensure that all disk attach callbacks have completed before attemptingjsing2012-01-161-2/+16
| | | | | | to locate the root via DUID. ok krw@
* Always set DKF_OPENED in the disk attach callback.jsing2012-01-131-5/+7
|