Commit Graph

1290 Commits

Author SHA1 Message Date
Sean Bruno
c4901b6798 Just a fixup for a KTRACE message I stumbled upon many moons ago.
Reviewed by:	Scott Long
MFC after:	2 days
2008-09-18 15:02:19 +00:00
Ulf Lilleengen
f805f204b6 - Add a new ioctl for getting the provider name of a geom provider.
- Add a routine for looking up a device and checking if it is a valid geom
  provider given a partial or full path to its device node.

Reviewed by:	phk
Approved by:	pjd (mentor)
2008-09-07 13:54:57 +00:00
Rui Paulo
89ea496520 Fix build. 2008-09-05 18:11:18 +00:00
Rui Paulo
87662ab391 Keep entries sorted. 2008-09-05 18:09:49 +00:00
Rui Paulo
35fa2f1bcd Include the vendor in the partition name. 2008-09-05 16:54:07 +00:00
Rui Paulo
d7255ff42e Detect Apple HFS GPT slices. 2008-09-05 12:49:14 +00:00
Attilio Rao
59d4932531 Decontextualize vfs_busy(), vfs_unbusy() and vfs_mount_alloc() functions.
Manpages are updated accordingly.

Tested by:	Diego Sardina <siarodx at gmail dot com>
2008-08-31 14:26:08 +00:00
Bjoern A. Zeeb
603724d3ab Commit step 1 of the vimage project, (network stack)
virtualization work done by Marko Zec (zec@).

This is the first in a series of commits over the course
of the next few weeks.

Mark all uses of global variables to be virtualized
with a V_ prefix.
Use macros to map them back to their global names for
now, so this is a NOP change only.

We hope to have caught at least 85-90% of what is needed
so we do not invalidate a lot of outstanding patches again.

Obtained from:	//depot/projects/vimage-commit2/...
Reviewed by:	brooks, des, ed, mav, julian,
		jamie, kris, rwatson, zec, ...
		(various people I forgot, different versions)
		md5 (with a bit of help)
Sponsored by:	NLnet Foundation, The FreeBSD Foundation
X-MFC after:	never
V_Commit_Message_Reviewed_By:	more people than the patch
2008-08-17 23:27:27 +00:00
Pawel Jakub Dawidek
ed6c3e478f Style(9). 2008-08-12 20:19:08 +00:00
Dag-Erling Smørgrav
2616144e43 Add sbuf_new_auto as a shortcut for the very common case of creating a
completely dynamic sbuf.

Obtained from:	Varnish
MFC after:	2 weeks
2008-08-09 11:14:05 +00:00
Peter Wemm
fbbc785240 Trivial commit to attempt to diagnose a svn problem. Add
comment that Tivo disks are APM, but do not have a DDR record.
2008-07-22 18:05:50 +00:00
Pawel Jakub Dawidek
5527ecd9a5 Clear passphrase buffer after use.
Submitted by:	Fabian Keil <fk@fabiankeil.de> (a bit different version)
2008-07-20 19:56:13 +00:00
Ulf Lilleengen
14e96b45e8 - When renaming a drive, also set the drive name in the gvinum header.
PR:		kern/125632
Approved by:	pjd (mentor)
MFC after:	3 days
2008-07-19 13:53:11 +00:00
Ulf Lilleengen
56af4c6141 - Fix a logic error when updating plex configuration.
Approved by:	pjd (mentor)
2008-07-11 16:46:29 +00:00
Robert Watson
4f7d1876d5 Introduce a new lock, hostname_mtx, and use it to synchronize access
to global hostname and domainname variables.  Where necessary, copy
to or from a stack-local buffer before performing copyin() or
copyout().  A few uses, such as in cd9660 and daemon_saver, remain
under-synchronized and will require further updates.

Correct a bug in which a failed copyin() of domainname would leave
domainname potentially corrupted.

MFC after:	3 weeks
2008-07-05 13:10:10 +00:00
Xin LI
6c97c325ff Avoid NULL deference.
Reviewed by:	ivoras
2008-06-30 15:21:42 +00:00
Ulf Lilleengen
7e7a4e1d18 - Fix spelling errors.
Approved by:    kib (mentor)
PR:             kern/124788
Submitted by:   Hywel Mallett <Hywel -at- hmallett.co.uk>
2008-06-20 19:48:18 +00:00
Marcel Moolenaar
f6aa3fccce Add the set and unset verbs used to set and clear attributes for
partition entries. Implement the setunset method for the MBR
scheme to control the active flag.
2008-06-18 01:13:34 +00:00
Marcel Moolenaar
d3532631de Finish the support for partition labels and add it to the XML. 2008-06-12 19:34:07 +00:00
Marcel Moolenaar
9a764aac3f Add the raw partition type to the XML. 2008-06-12 06:34:14 +00:00
Marcel Moolenaar
eab484f822 Add the raw partition type to the XML. 2008-06-12 06:26:36 +00:00
Marcel Moolenaar
a3354bb4a7 Add the raw partition type to the XML. 2008-06-12 05:56:03 +00:00
Marcel Moolenaar
0c132595dd Add the raw partiton type to the XML. 2008-06-12 05:28:47 +00:00
Marcel Moolenaar
40b075d366 Add the raw partition type to the XML. 2008-06-12 05:27:23 +00:00
Marcel Moolenaar
ab1e8f04c8 Add the partition label and the raw partition type to the XML. 2008-06-12 04:43:34 +00:00
Ed Schouten
06d425f92e Remove the distinction between device minor and unit numbers.
Even though we got rid of device major numbers some time ago, device
drivers still need to provide unique device minor numbers to make_dev().
These numbers are only used inside the kernel. They are not related to
device major and minor numbers which are visible in devfs. These are
actually based on the inode number of the device.

It would eventually be nice to remove minor numbers entirely, but we
don't want to be too agressive here.

Because the 8-15 bits of the device number field (si_drv0) are still
reserved for the major number, there is no 1:1 mapping of the device
minor and unit numbers. Because this is now unused, remove the
restrictions on these numbers.

The MAXMAJOR definition was actually used for two purposes. It was used
to convert both the userspace and kernelspace device numbers to their
major/minor pair, which is why it is now named UMINORMASK.

minor2unit() and unit2minor() have now become useless. Both minor() and
dev2unit() now serve the same purpose. We should eventually remove some
of them, at least turning them into macro's. If devfs would become
completely minor number unaware, we could consider using si_drv0 directly,
just like si_drv1 and si_drv2.

Approved by:	philip (mentor)
2008-05-29 12:50:46 +00:00
Ulf Lilleengen
4e70f1decf - Recognize the 'volume' parameter when creating a plex.
PR:		kern/75632
Approved by:	pjd (mentor)
MFC after:	1 day
2008-05-22 10:27:03 +00:00
Pawel Jakub Dawidek
9097a8e66e - Assert that we don't send new provider event for a provider which has
G_PF_WITHER flag set.
- Fix typo in assertion condition (sorry, but I forgot who report that).
2008-05-18 22:50:50 +00:00
Pawel Jakub Dawidek
f02642d79e Play nice with DDB pager.
Educated by:	jhb's BSDCan presentation
2008-05-18 21:13:10 +00:00
Marcel Moolenaar
5db670520f Implement the G_PART_DUMPCONF method for all 6 schemes. Also call
the method for the (indent == NULL) case (i.e. the kern.geom.conftxt
sysctl). The purpose is to extend the conftxt output with scheme-
specific fields which can be used by libdisk. In particular, have
the schemes dump the xs and xt fields, which contain the backward
compatible values for class type and partition type. This allows
libdisk to work with the legacy slicers as well as with gpart and
helps/promotes migration.
2008-04-23 20:13:05 +00:00
Marcel Moolenaar
4d32fcb42b Add the bootcode verb for installing boot code. Boot code
is supported for the MBR, GPT and PC98 schemes, where GPT
installs boot code into the PMBR.
2008-04-13 19:54:54 +00:00
Marcel Moolenaar
e0fbffe617 Change the order from SI_ORDER_FIRST to SI_ORDER_ANY (within
SI_SUB_DRIVERS) to avoid loading schemes before all the GEOM
classes have been loaded and initialized. Otherwise we may
end up using mutexes that haven't been initialized (due to
g_retaste() posting an event).
2008-03-29 17:33:29 +00:00
Marcel Moolenaar
b03fab128b Add support for PC-9800 partition tables. 2008-03-28 17:58:55 +00:00
Marcel Moolenaar
856744ba93 When retasting, wither any existing GEOMs of the same class. This
allows the class to create a different GEOM for the same provider
as well as avoid that we end up with multiple GEOMs of the same
class with the same name.

For example, when a disk contains a PC98 partition table but
only MBR is supported, then the partition table can be treated
as a MBR. If support for PC98 is later loaded as a module, the
MBR scheme is pre-empted for the PC98 scheme as expected.
2008-03-28 06:31:12 +00:00
Marcel Moolenaar
4ffca444a5 Redefine G_PART_SCHEME_DECLARE() from populating a private linker set
to declaring a proper module. The module event handler is part of the
gpart core and will add the scheme to an internal list on module load
and will remove the scheme from the internal list on module unload.
This makes it possible to dynamically load and unload partitioning
schemes.
2008-03-23 01:31:59 +00:00
Marcel Moolenaar
8a8fcb0089 Add g_retaste(), which given a class will present all non-open providers
to it for tasting. This is useful when the class, through means outside
the scope of GEOM, can claim providers previously unclaimed.

The g_retaste() function posts an event which is handled by the
g_retaste_event().

Event suggested by: phk
2008-03-23 01:23:35 +00:00
Ulf Lilleengen
1cf9b83c6d - Fix a memory leak when re-discovering a gvinum configuration.
Approved by:	pjd (mentor)
MFC after:	1 week
2008-03-18 08:48:51 +00:00
Marcel Moolenaar
909f20c80d Add support for VTOC8 labels (aka sun disk labels). When a label does
not have VTOC information about the partitions, it will be created.
This is because the VTOC information is used for the partition type
and FreeBSD's sunlabel(8) does not create nor use VTOC information.
For this purpose, new tags have been added to support FreeBSD's
partition types.
2008-03-02 00:52:49 +00:00
Marcel Moolenaar
028de8786a Follow-up improvements to the handling of false positives: If the
partition table is empty, check to see if we have something that
looks sufficiently like a BPB. On non-i386 machines, the boot
sector typically doesn't contain boot code; the end of the boot
sector is all zeroes. This is also where the partition table is
for MBRs.
We only check the sector size and cluster size, as that seems to
be the most reliable across implementations, BPB versions and
platforms.
2008-02-29 22:41:36 +00:00
Marcel Moolenaar
6291ef2d80 Better handle false positives. The MBR differs from the boot sector
only because there's a partition table where the boot sector has
boot code. Boot sectors without boot code look like a MBR for all
practical purposes. This change adds a check for the partition table
and fails the probe when it's obvously invalid. The assumption being
that the sector contains a boot sector and not a MBR.
More checks are needed to distinguish a boot secto without boot code
from a (empty) MBR.
2008-02-28 22:30:41 +00:00
Andrew Thompson
764fa86761 geom_lvm(4) is now known as geom_linux_lvm(4). 2008-02-20 07:52:43 +00:00
Andrew Thompson
1332875338 Add a geom class to map Linux LVM logical volumes.
The logical disks will appear as /dev/lvm/<vol group>-<logical vol>, for
instance /dev/lvm/vg0-home. G_LINUX_LVM currently supports linear stripes with
segments on multiple physical disks. The metadata is read only, logical
volumes can not be allocated or resized.

Reviewed by:	Ivan Voras

Previously known as geom_lvm(4), rename requested by des, phk.
2008-02-20 07:45:36 +00:00
Scott Long
7bbd40c57e Teach the dump and minidump code to respect the maxioszie attribute of
the disk; the hard-coded assumption of 64K doesn't work in all cases.
2008-02-15 06:26:25 +00:00
Andrew Thompson
15df4265ef Unbreak build, size_t is larger on 64bit platforms. 2008-02-11 09:20:01 +00:00
Andrew Thompson
77b65eef19 Add a geom class to map Linux LVM logical volumes.
The logical disks will appear as /dev/lvm/<vol group>-<logical vol>, for
instance /dev/lvm/vg0-home. GLVM currently supports linear stripes with
segments on multiple physical disks. The metadata is read only, logical
volumes can not be allocated or resized.

Reviewed by:	Ivan Voras
2008-02-11 03:05:11 +00:00
Marcel Moolenaar
392ffade03 Various fixes:
o  BSD disklabels have relative offsets. Even for the BSD in MBR slice
   setup, except when the mbroffset ioctl is supported. Since we don't
   support that ioctl, bsdlabel(8) expects relative offsets. So, when
   reading an existing disklabel, correct for disklabels that mistakenly
   have the mbroffset offsets.
o  Don't take the geometry seriously, because it's untrustworthy. We do
   expect the numbers to be within range. This means that the secperunit
   field will not be computed from secpercyl and ncyls, but simply is
   the mediasize in sectors.
o  Don't enforce partitions to be aligned to track boundaries. The
   default label, constructed by bsdlabel(8), puts partition a at offset
   BBSIZE bytes, which commonly means sector 16.
2007-12-24 01:01:59 +00:00
Poul-Henning Kamp
015a11e695 Chop DIOCGDELETE from userland up in 1024 sector chunks to give geom_disk
or any other bio chopping geom a reasonable size of work.

Check for delivered signals between chunks, because the request size
and service time is unbounded.
2007-12-16 19:38:26 +00:00
Poul-Henning Kamp
eed6cda966 Don't limit BIO_DELETE requests to MAXPHYS, they perform no data
transfers, so they are not subject to the VM system limitation.
2007-12-16 18:03:31 +00:00
Marcel Moolenaar
3959198cc5 Decode as many or as few partition entries as the label claims there
are. We have already checked it against the caller provided maxpart.
2007-12-09 22:44:22 +00:00
Marcel Moolenaar
4275d83ab5 Fix a bug in the add verb, where we failed to keep the list
of partitions in index-order. This is assumed by the APM, MBR
and BSD partitioning schemes.
2007-12-09 22:26:42 +00:00