Commit Graph

104 Commits

Author SHA1 Message Date
Poul-Henning Kamp
2d20f433ed Sanitize the LABELSECTOR & LABELOFFSET definitions:
Remove sparc64 definitions.
	Remove fallback definitions.
2003-06-07 09:06:39 +00:00
Peter Wemm
b37d468c2a Gah! Set LABELSECTOR and LABELOFFSET correctly for amd64. This might
explain why I've been having trouble with libdisk and sysinstall...
2003-06-07 07:07:04 +00:00
Poul-Henning Kamp
56dde750d5 Make bsd_disklabel_le_enc calculate the checksum and fill it in.
(If there is a legitimate need to correctly encode and pack a
disklabel with an invalid checksum custom tools can be built for
that.)

Make bsd_disklabel_le_dec() validate the magics, number of partitions
(against a new parameter) and the checksum.

Vastly simplify the logic of the GEOM::BSD class implementation:

Let g_bsd_modify() always take a byte-stream label.

This simplifies all users, except the ioctl's which now have to
convert to a byte-stream first.  Their loss.

g_bsd_modify() is called with topology held now, and it returns
with it held.

Always update the md5sum in g_bsd_modify(), otherwise the check
is no use after the first modification of the label.  Make the
MD5 over the bytestream version of the label.

Move the rawoffset hack to g_bsd_modify() and remove all the
inram/ondisk conversions.

Don't configure hotspots in g_bsd_modify(), do it in taste instead,
we do not support moving the label to a different location on the
fly anyway.

This passes all current regression tests.
2003-05-02 22:46:13 +00:00
Poul-Henning Kamp
daabb372ca Separate the encoding/decoding functions for struct disklabel into a
separate source file which can be used from both kernel and userland code.
2003-04-17 07:39:03 +00:00
Poul-Henning Kamp
9f88fdfb88 NO_GEOM cleanup: Remove dkmakeminor(). 2003-04-03 08:51:22 +00:00
Poul-Henning Kamp
5777c5b989 NO_GEOM cleanup: unifdef 2003-01-30 13:12:31 +00:00
Poul-Henning Kamp
afdc2f6786 Add ioctl which overwrites the first BBSIZE bytes of a BSD labeled disk. 2003-01-26 21:49:44 +00:00
Poul-Henning Kamp
5bdd667ffe Put DIOCWLABEL under #ifdef NO_GEOM 2003-01-26 19:43:18 +00:00
Poul-Henning Kamp
718af14fe4 #ifdef NO_GEOM some bits here too. 2003-01-21 11:39:19 +00:00
Scott Long
f9d186edc8 After much delay and anticipation, welcome RAIDFrame into the FreeBSD
world.  This should be considered highly experimental.

Approved-by:	re
2002-10-20 08:17:39 +00:00
Poul-Henning Kamp
28dcd19b25 Correctly account for MAXPARTITIONS in the CTASSERT() which protects the
size of the disklabel structure.

Hit by:	schweikh
2002-10-13 17:28:14 +00:00
Chad David
9b30d71989 Correct the offset of the 'jfs' entry in fstypenames. 2002-10-10 22:09:32 +00:00
Poul-Henning Kamp
c111eed934 Divorce bsd disklabels, IBM PC MBR's and whatever the things are
called on NEC PC98 machines.

Sponsored by: DARPA & NAI Labs.
2002-10-01 19:29:19 +00:00
Poul-Henning Kamp
2382fb0a84 Make FreeBSD "struct disklabel" agnostic, step 312 of 723:
Rename bioqdisksort() to bioq_disksort().
Keep a #define around to avoid changing all diskdrivers right now.

Move it from subr_disklabel.c to subr_disk.c.
Move prototype from <sys/disklabel.h> to <sys/bio.h>

Sponsored by:   DARPA and NAI Labs.
2002-09-20 14:14:37 +00:00
Poul-Henning Kamp
f90c382c0c Make FreeBSD "struct disklabel" agnostic, step 311 of 723:
Rename diskerr() to disk_err() for naming consistency.

Drop the by now entirely useless struct disklabel argument.

Add a flag argument for new-line termination.

Fix a couple of printf-format-casts to %j instead of %l.

Correctly print the name of all bio commands.

Move the function from subr_disklabel.c to subr_disk.c,
and from <sys/disklabel.h> to <sys/disk.h>.

Use the new disk_err() throughout, #include <sys/disk.h> as needed.

Bump __FreeBSD_version for the sake of the aac disk drivers #ifdefs.

Remove unused disklabel members of softc for aac, amr and mlx, which seem
to originally have been intended for diskerr() use, but which only rotted
and got Copy&Pasted at least two times to many.

Sponsored by:   DARPA & NAI Labs.
2002-09-20 12:52:03 +00:00
Poul-Henning Kamp
46714777f5 Retire now unused DIOCGDVIRGIN kludge.
Sponsored by:	DARPA & NAI Labs.
2002-09-20 09:31:14 +00:00
Poul-Henning Kamp
fbbdde85f8 Deal with a new exteded MBR paritition type
Submitted by:	Michal Mertl <mime@traveller.cz>
2002-09-08 15:13:33 +00:00
Alfred Perlstein
f341f36a88 forgot to actually commit the DK/FS TYPES split, do it now. 2002-08-16 09:07:15 +00:00
Poul-Henning Kamp
c4bacc1871 Remove the compat bits for the mis-aligned struct disklabel on alpha,
people got three times longer than I promised.

Sponsored by: DARPA & NAI Labs.
2002-06-19 08:37:02 +00:00
Tom Rhodes
d394511de3 More s/file system/filesystem/g 2002-05-16 21:28:32 +00:00
Poul-Henning Kamp
7110af7577 ARGH! SBLOCK is not unused. Try to get this right.
BBSIZE belongs in <sys/disklabel.h> (but shouldn't be a constant).

Define SBLOCK again, using the right math.

Sponsored by: DARPA & NAI Labs.
2002-05-12 20:21:40 +00:00
Alfred Perlstein
62563373ff De-K&R dkcksum() to fix some issues with c++.
Submitted by: Miguel Mendez <flynn@energyhq.homeip.net>
2002-04-17 18:09:27 +00:00
Poul-Henning Kamp
2dd527b3ac Move generic disk ioctls from <sys/disklabel.h> to <sys/disk.h>.
Sponsored by:	DARPA & NAI Labs
2002-04-08 09:20:07 +00:00
Poul-Henning Kamp
1265c0ce2b In reverence of the 3rd X11 development rule:
3.The only thing worse than generalizing from one example
	is generalizing from no examples at all.

Remove the fwcylinders attribute before anybody gets the idea that we
alone have squared the circle.

Sponsored by:	DARPA & NAI Labs.
2002-04-08 08:00:40 +00:00
Poul-Henning Kamp
1ae3f81d9b Constify.
Sponsored by: DARPA & NAI Labs.
2002-04-07 09:58:28 +00:00
Poul-Henning Kamp
f67ad03a25 Delete the bogus d_boot[01] fields from struct disklabel.
This shrinks the size 4 bytes on alpha, down to the same 276 bytes
as all other platforms.

Construct a hack to make old ioctls work on new kernels.

Once world is recompiled only the new and correct sysctls will be
used.

This hack will become annoying around 1st of may to make people
rebuild their worlds and it will be gone before 5.0.
2002-04-04 20:34:48 +00:00
Poul-Henning Kamp
e6952b6ee5 CTASSERT the size of struct dos_partition. 2002-04-04 09:36:15 +00:00
Poul-Henning Kamp
408ab1b875 Retire the bogus ioctl DIOCGPART in toto.
Once again we can notice that badly thought out hacks ferment and infect
far more code than initially expected.

Sponsored by:	DARPA and NAI Labs.
2002-04-02 11:52:13 +00:00
Poul-Henning Kamp
27252e8f45 Really sweep the broom on this one.
It's amazing how much cruft accumulate over the years...
2002-04-01 20:18:02 +00:00
Poul-Henning Kamp
97ec57d9a1 Remove various controller/disk type hacks for SMD, ST506 and ancient
SCSI stuff which have far outlived its sell by date.
2002-04-01 20:06:14 +00:00
Poul-Henning Kamp
81661c94b6 Here follows the new kernel dumping infrastructure.
Caveats:

The new savecore program is not complete in the sense that it emulates
enough of the old savecores features to do the job, but implements none
of the options yet.

I would appreciate if a userland hacker could help me out getting savecore
to do what we want it to do from a users point of view, compression,
email-notification, space reservation etc etc.  (send me email if
you are interested).

Currently, savecore will scan all devices marked as "swap" or "dump" in
/etc/fstab _or_ any devices specified on the command-line.

All architectures but i386 lack an implementation of dumpsys(), but
looking at the i386 version it should be trivial for anybody familiar
with the platform(s) to provide this function.

Documentation is quite sparse at this time, more to come.

Details:

ATA and SCSI drivers should work as the dump formatting code has been
removed.  The IDA, TWE and AAC have not yet been converted.

Dumpon now opens the device and uses ioctl(DIOCGKERNELDUMP) to set
the device as dumpdev.  To implement the "off" argument, /dev/null
is used as the device.

Savecore will fail if handed any options since they are not (yet)
implemented.  All devices marked "dump" or "swap" in /etc/fstab
will be scanned and dumps found will be saved to diskfiles
named from the MD5 hash of the header record.  The header record
is dumped in readable format in the .info file.  The kernel
is not saved.  Only complete dumps will be saved.

All maintainer rights for this code are disclaimed: feel free to
improve and extend.

Sponsored by:   DARPA, NAI Labs
2002-03-31 22:37:00 +00:00
Greg Lehey
9ef2b1f2b9 Add d_type and fstype names for JFS.
Requested by:	Hiten Pandya <hiten@uk.FreeBSD.org>
2002-03-28 06:10:03 +00:00
Poul-Henning Kamp
8dc8db2787 Revert last commit, it came too late to save alpha :-( 2002-03-23 16:54:19 +00:00
Poul-Henning Kamp
50abd3e193 Hide the ugly d_boot[01] from the kernel. 2002-03-23 16:03:13 +00:00
Bruce Evans
c58eb46e8a Fixed some style bugs in the removal of __P(()). The main ones were
not removing tabs before "__P((", and not outdenting continuation lines
to preserve non-KNF lining up of code with parentheses.  Switch to KNF
formatting and/or rewrap the whole prototype in some cases.
2002-03-23 08:46:52 +00:00
Alfred Perlstein
789f12fe69 Remove __P 2002-03-19 20:18:42 +00:00
Poul-Henning Kamp
00dcdc8d67 Add five GEOM oriented ioctls to get basic information about a geom device. 2002-03-19 13:54:15 +00:00
Jake Burkholder
1ffbafa265 LABELOFFSET is 128 for sparc64.
Submitted by:	tmm
Forgotten by:	obrien
2002-03-13 03:17:29 +00:00
Poul-Henning Kamp
875b0335f9 Hide the DIOCGPART ioctl from userland where it has no decent use.
It's use in the kernel is also highly suspect due to the total absense
of any kind of lifetime definition of the passed pointers.
2002-03-09 19:15:37 +00:00
Bruce Evans
e58b5938ea Uninlined most of the bloated inline functions in <sys/disklabel.h>. Some
of them need to become even larger to support devfs.
2002-01-17 18:33:18 +00:00
Bruce Evans
d7cd4f8ec3 Garbage-collect vestiges of disksort(). We now have only one disksort()
again, but its name has regressed to bioqdisksort().

Fixed some style bugs
2002-01-17 18:08:25 +00:00
Poul-Henning Kamp
20a3b67cb2 Rename the top 7 bits if disk minors to spare bits, rather than type bits. 2001-11-04 09:01:07 +00:00
Doug Rabson
c4e7b7e2e0 Put the label at the same place as i386 for compatibility. 2001-10-06 12:35:22 +00:00
David E. O'Brien
2af8d76dad Re-apply rev 1.178 -- style(9) the structure definitions.
I have to wonder how many other changes were lost in the KSE mildstone 2 merge.
2001-09-13 22:52:42 +00:00
Warner Losh
2fedd05ce9 Use ANSI prototype and function definition for dkcksum so that this
file can be included with C++ again.  This appears to have been broken
in 1.54 with the introduction of it as an inline function.
2001-01-14 05:14:37 +00:00
Poul-Henning Kamp
e6c8667208 Make a #define for the highest legal disk unit (0x1ff) 2000-12-15 16:41:40 +00:00
Poul-Henning Kamp
cb7e609a3c Make diskerr() always log with printf. 2000-11-26 19:29:15 +00:00
Jordan K. Hubbard
e7c2b5a51d Add a new ioctl for doing virgin disklabels.
Submitted by:	dillon
2000-10-31 07:05:40 +00:00
Poul-Henning Kamp
19cf3044c1 GC some LFS lint. 2000-09-19 10:25:01 +00:00
Poul-Henning Kamp
fa0c13fabb Add proper prototype for dkcksum(); 2000-09-16 18:57:51 +00:00