summaryrefslogtreecommitdiff
path: root/lib/libdisk/chunk.c
Commit message (Collapse)AuthorAgeFilesLines
* + add u_long sector_size to struct disk (documented in libdisk.3)Jordan K. Hubbard2001-05-131-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + make Open_Disk sense the sector size by trying 512, 1024 and 2048 in this order. This makes the kernel note that dscheck(cd1): bio_bcount 512 is not on a sector boundary (ssize 2048) dscheck(cd1): bio_bcount 1024 is not on a sector boundary (ssize 2048) if 2048 is the sector size. If this worries anyone: the message is from /usr/src/sys/kern/subr_diskslice.c and shutups are to be placed there. + Have read_block and write_block use an additional parameter, the sector size. + replace all barfout calls with return NULL, 0, __LINE__, etc. Note that this does NOT emit diagnostics. More often than not, you don't want library functions to scribble on stderr -- it may not even be available. The right thing is to propagate the error condition to upper management. The app should take care of errors. + use d1->sector_size instead of 512 in various places. I've left many places untouched, especially those writing MBRs. I simply added another arg hardcoded as 512. This is because I would not know what I'm doing... I felt this approach would be reasonably backward compatible and not introduce any new bugs in critical software. Famous last words. Messing with MBRs might soon put me in the same screwup meister category as, uh, never mind. :-) + bump the max no of disks from 20 to 32 (due to PR 24503). PR: 8434 / 8436 / 24503 Submitted by: Jens Schweikhardt <schweikh@schweikhardt.net> Notes: svn path=/head/; revision=76551
* Add spaces around operators.David E. O'Brien2001-04-011-49/+51
| | | | | | | | It's OK, the Project and afford them now -- they aren't as expensive as they used to be. Notes: svn path=/head/; revision=75069
* Add back <err.h> for warn().David E. O'Brien2001-04-011-0/+1
| | | | | | | | (of course it's pretty stupid to call it, as printf doesn't work w/in sysinstall, and sysinstall is the only consumer of libdisk) Notes: svn path=/head/; revision=75064
* Libraries should _never_ call exit() themselves (or its alternate spellingDavid E. O'Brien2001-03-181-8/+7
| | | | | | | | | | | | | | `err()'). libdisk does! and additionally libdisk gets confused on Alpha disks with foreign disklabels, throws up its hands and exits. This is the cause of the "going no where without my init" install bug on the Alpha. So now on the Alpha, rather than call err(), we print the error string and continue processing. Submitted by: jkh Notes: svn path=/head/; revision=74426
* - Allow support for MBR boot loaders that are longer than one sector. AsJohn Baldwin2000-07-121-19/+0
| | | | | | | | | with fdisk, ensure that they are a multiple of the sector size in length. - Axe all the 1024 cylinder checks as they are no longer relevant with the fixed bootstrap. Notes: svn path=/head/; revision=63030
* Changes for PC-98.KATO Takenori2000-03-291-0/+71
| | | | Notes: svn path=/head/; revision=58794
* Remove BAD144 supportPoul-Henning Kamp1999-11-271-1/+0
| | | | Notes: svn path=/head/; revision=53749
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50476
* Fix erroneous format string.John Polstra1997-11-181-2/+2
| | | | Notes: svn path=/head/; revision=31222
* Revert $FreeBSD$ to $Id$Peter Wemm1997-02-221-1/+1
| | | | Notes: svn path=/head/; revision=22993
* Make the long-awaited change from $Id$ to $FreeBSD$Jordan K. Hubbard1997-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. Notes: svn path=/head/; revision=21673
* Make libdisk C++ aware:Joerg Wunsch1996-03-241-8/+9
| | | | | | | | | | - add __BEGIN_DECLS and __END_DECLS, - add a bunch of ``const'' qualifiers all over the place, - rename the `private' struct member into `private_data' to avoid the clash with the C++ keyword. Notes: svn path=/head/; revision=14792
* Merge RELENG_2_0_5 into HEADRodney W. Grimes1995-06-111-8/+22
| | | | Notes: svn path=/head/; revision=9202
* Remove trailing whitespace.Rodney W. Grimes1995-05-301-14/+14
| | | | Notes: svn path=/head/; revision=8881
* Remove Ontrack special from All_FreeBSD().Poul-Henning Kamp1995-05-251-1/+6
| | | | | | | Add chunk->disk pointer. Notes: svn path=/head/; revision=8745
* Get the CHUNK_COMPAT_BSD flag right.Poul-Henning Kamp1995-05-111-1/+4
| | | | Notes: svn path=/head/; revision=8436
* Recognize slice type #6 as dosPoul-Henning Kamp1995-05-081-3/+3
| | | | | | | handle OnTrack Disk manager correctly. Notes: svn path=/head/; revision=8346
* Whoops! An extra paren somehow got in there. Fixed.Jordan K. Hubbard1995-05-071-2/+2
| | | | Notes: svn path=/head/; revision=8312
* Always zero new chunks - keeps things like the private structures from havingJordan K. Hubbard1995-05-071-2/+2
| | | | | | | bogus data in them. Notes: svn path=/head/; revision=8311
* General sanitation and cleanup. Killed the "reserved" type, it wasn't.Poul-Henning Kamp1995-05-061-53/+59
| | | | Notes: svn path=/head/; revision=8303
* If in Create_Chunk we (type==freebsd && (flags&CHUNK_ALIGN)), then we willPoul-Henning Kamp1995-05-051-5/+38
| | | | | | | align this chunk properly. Have at it Jordan... Notes: svn path=/head/; revision=8290
* Add the private void *pointer to the chunks, and the functions to manage it.Poul-Henning Kamp1995-05-031-3/+6
| | | | | | | Make the reassignment of partition names less bogus. Notes: svn path=/head/; revision=8250
* foo -> unknown.Jordan K. Hubbard1995-05-011-5/+5
| | | | | | | I have to be able to show this stuff to the user. :-) Notes: svn path=/head/; revision=8207
* Now we do writes too.Poul-Henning Kamp1995-04-301-2/+3
| | | | Notes: svn path=/head/; revision=8178
* Next Iteration, getting better.Poul-Henning Kamp1995-04-291-3/+3
| | | | | | | | | | | Made an All_FreeBSD() function. Added a cmd-line interface (lowest rank) to the tst01 program. The tst01 program is harmless (worst it can do is coredump), but it is instructive to run, you can see what the slice-code things of your disk... Notes: svn path=/head/; revision=8157
* Sanitize and explain a little bit... Implement the first rules...Poul-Henning Kamp1995-04-291-10/+13
| | | | Notes: svn path=/head/; revision=8156
* This is a revision 0.00 of the backend stuff for the fdisk/disklabel stuffPoul-Henning Kamp1995-04-281-0/+365
in the new sysinstall. If you want to give a helping hand, then send email to phk@FreeBSD.ORG. DO NOT COMMIT TO THIS DIRECTORY! Notes: svn path=/head/; revision=8153