summaryrefslogtreecommitdiffstats
path: root/sys/geom
Commit message (Collapse)AuthorAgeFilesLines
* Save stack only when KTR_GEOM is both compiled into the kernel and enabledpjd2007-10-261-5/+5
| | | | | | | in debug.ktr.mask. Because saving stack is very expensive, it's better only to do it when one really wants to. Reported by: Dan Nelson
* First cut at support for booting a GPT labeled disk via the BIOS bootstrapjhb2007-10-243-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | on i386 and amd64 machines. The overall process is that /boot/pmbr lives in the PMBR (similar to /boot/mbr for MBR disks) and is responsible for locating and loading /boot/gptboot. /boot/gptboot is similar to /boot/boot except that it groks GPT rather than MBR + bsdlabel. Unlike /boot/boot, /boot/gptboot lives in its own dedicated GPT partition with a new "FreeBSD boot" type. This partition does not have a fixed size in that /boot/pmbr will load the entire partition into the lower 640k. However, it is limited in that it can only be 545k. That's still a lot better than the current 7.5k limit for boot2 on MBR. gptboot mostly acts just like boot2 in that it reads /boot.config and loads up /boot/loader. Some more details: - Include uuid_equal() and uuid_is_nil() in libstand. - Add a new 'boot' command to gpt(8) which makes a GPT disk bootable using /boot/pmbr and /boot/gptboot. Note that the disk must have some free space for the boot partition. - This required exposing the backend of the 'add' function as a gpt_add_part() function to the rest of gpt(8). 'boot' uses this to create a boot partition if needed. - Don't cripple cgbase() in the UFS boot code for /boot/gptboot so that it can handle a filesystem > 1.5 TB. - /boot/gptboot has a simple loader (gptldr) that doesn't do any I/O unlike boot1 since /boot/pmbr loads all of gptboot up front. The C portion of gptboot (gptboot.c) has been repocopied from boot2.c. The primary changes are to parse the GPT to find a root filesystem and to use 64-bit disk addresses. Currently gptboot assumes that the first UFS partition on the disk is the / filesystem, but this algorithm will likely be improved in the future. - Teach the biosdisk driver in /boot/loader to understand GPT tables. GPT partitions are identified as 'disk0pX:' (e.g. disk0p2:) which is similar to the /dev names the kernel uses (e.g. /dev/ad0p2). - Add a new "freebsd-boot" alias to g_part() for the new boot UUID. MFC after: 1 month Discussed with: marcel (some things might still change, but am committing what I have so far)
* Add the freebsd-zfs alias. Both APM and GPT have ZFS partitionmarcel2007-10-214-0/+17
| | | | types.
* Rename the kthread_xxx (e.g. kthread_create()) callsjulian2007-10-2011-34/+34
| | | | | | | | | | | to kproc_xxx as they actually make whole processes. Thos makes way for us to add REAL kthread_create() and friends that actually make theads. it turns out that most of these calls actually end up being moved back to the thread version when it's added. but we need to make this cosmetic change first. I'd LOVE to do this rename in 7.0 so that we can eventually MFC the new kthread_xxx() calls.
* When orphaning a provider, cancel events related to it.pjd2007-09-271-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Without this change the following situation was possible: 1. Provider is orphaned from within class' access() method on last write close - orphan provider event is send. 2. GEOM detects last write close on a provider and sends new provider event. 3. g_orphan_register() is called, and calls all orphan methods of attached consumers. 4. New provider event is executed on orphaned provider, all classes can taste already orphaned provider, and some may attach consumers to it. Those consumers will never go away, because the g_orphan_register() was already called. We end up with a zombie provider. With this change, at step 3, we will cancel new provider event. How to repeat this problem: # mdconfig -a -t malloc -s 10m # geli init -i 0 md0 # geli attach md0 # newfs -L test /dev/md0.eli # mount /dev/ufs/test /mnt/tmp # geli detach -l md0.eli # umount /mnt/tmp # glabel status Name Status Components ufs/test N/A N/A Reviewed by: phk Approved by: re (kensmith)
* LINT compiled just fine for me, but it seems it breaks tinerbox way ofpjd2007-09-231-1/+1
| | | | | | compiling LINT. Approved by: re (implicitly)
* Bring in the GEOM Virtualisation class, which allows to create huge GEOMpjd2007-09-236-0/+2437
| | | | | | | | | providers with limited physical storage and add physical storage as needed. Submitted by: Ivan Voras Sponsored by: Google Summer of Code 2006 Approved by: re (kensmith)
* Add support for Camellia encryption algorithm.pjd2007-09-012-1/+21
| | | | | | PR: kern/113790 Submitted by: Yoshisato YANAGISAWA <yanagisawa@csg.is.titech.ac.jp> Approved by: re (bmah)
* Have gpart synthesize a disk geometry if the underlying providermarcel2007-06-173-55/+189
| | | | | | | don't have it. Some partitioning schemes, as well as file systems, operate on the geometry and without it such schemes (e.g. MBR) and file systems (e.g. FAT) can't be created. This is useful for memory disks.
* Add the MBR partitioning scheme to g_part. This does not yetmarcel2007-06-131-0/+370
| | | | support the ability to install boot code.
* Prefix unknown (i.e. un-aliased) partition types with '!'. This ismarcel2007-06-062-4/+6
| | | | how they had to be given with ctlreq.
* Call sbuf_finish() before sbuf_data() and sbuf_len().marcel2007-06-061-0/+5
|
* Commit 14/14 of sched_lock decomposition.jeff2007-06-055-14/+14
| | | | | | | | | | | - Use thread_lock() rather than sched_lock for per-thread scheduling sychronization. - Use the per-process spinlock rather than the sched_lock for per-process scheduling synchronization. Tested by: kris, current@ Tested on: i386, amd64, ULE, 4BSD, libthr, libkse, PREEMPTION, etc. Discussed with: kris, attilio, kmacy, jhb, julian, bde (small parts each)
* Despite several examples in the kernel, the third argument ofdwmalone2007-06-043-5/+5
| | | | | | | | | | | | | sysctl_handle_int is not sizeof the int type you want to export. The type must always be an int or an unsigned int. Remove the instances where a sizeof(variable) is passed to stop people accidently cut and pasting these examples. In a few places this was sysctl_handle_int was being used on 64 bit types, which would truncate the value to be exported. In these cases use sysctl_handle_quad to export them and change the format to Q so that sysctl(1) can still print them.
* Fix a dereference in KASSERT.marcel2007-05-151-1/+1
|
* o Implement automatic commit. It's enabled when the flags parametermarcel2007-05-151-10/+35
| | | | | | | | | | | exists and contains the 'C' flag. o The partition label can be the empty string. It's how labels are cleared. o When an action fails, lower permissions when they were raised in order to allow the action. A failed action will not result in any uncommitted changes. o Allow the flags paremeter to be present but empty. It's the equivalent of not being present.
* Write the output parameter (if present) for the add, create, deletemarcel2007-05-091-3/+50
| | | | destroy and modify verbs.
* When reverting the creation of a partitioning scheme on a provider,marcel2007-05-091-2/+6
| | | | | | the failure to probe an existing partitioning scheme means that no previous partitioning scheme existed. Don't error. Just destroy the geom.
* MFp4:marcel2007-05-084-94/+102
| | | | | | | | | | | | 119373: o Remove the query verb, along with the request and response parameters. o Add the version and output parameters. 119390: [APM,GPT] Properly clear deleted entries. 119394: o Make the alias the standard and use the '!' to prefix literal partition types. o Treat schemes and partition types as case insensitive. 119462: [GPT] Fix a page fault caused when modifying a partition entry without a new partition type.
* When deleting key, flush write cache after each overwrite, so we don'tpjd2007-05-061-0/+5
| | | | overwrite data N times in cache and only once on disk.
* Allow to use ':' in d_ident, which is quite handy character.pjd2007-05-051-1/+2
|
* Handle GEOM::ident attribute by attaching 'sX' string at the end of identpjd2007-05-051-0/+32
| | | | | | received from the underlying provider, where X is pp->index value. OK'ed by: phk
* Because there are many strange hardware out there, allow to use onlypjd2007-05-051-0/+39
| | | | [a-zA-Z0-9-_@#%.] characters in d_ident field.
* - Extend disk structure to allow to store disk's serial number, which can bepjd2007-05-052-2/+7
| | | | | | | retrieved via GEOM::ident attribute. - Bump disk(9) ABI version. OK'ed by: phk
* Implement three new ioctls that can be used with GEOM provider:pjd2007-05-051-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DIOCGFLUSH - Flush write cache (sends BIO_FLUSH). DIOCGDELETE - Delete data (mark as unused) (sends BIO_DELETE). DIOCGIDENT - Get provider's uniqe and fixed identifier (asks for GEOM::ident attribute). First two are self-explanatory, but the last one might not be. Here are properties of provider's ident: - ident value is preserved between reboots, - provider can be detached/attached and ident is preserved, - provider's name can change - ident can't, - ident value should not be based on on-disk metadata; in other words copying whole data from one disk to another should not yield the same ident for the other disk, - there could be more than one provider with the same ident, but only if they point at exactly the same physical storage, this is the case for multipathing for example, - GEOM classes that consumes single providers and provide single providers, like geli, gbde, should just attach class name to the ident of the underlying provider, - ident is an ASCII string (is printable), - ident is optional and applications can't relay on its presence. The main purpose for this is that application and remember provider's ident and once it tries to open provider by its name again, it may compare idents to be sure this is the right provider. If it is not (idents don't match), then it can open provider by its ident. OK'ed by: phk
* Implement g_delete_data() similar to g_read_data() and g_write_data().pjd2007-05-052-0/+23
| | | | OK'ed by: phk
* - Implement helper g_handleattr_str() function for string attributespjd2007-05-052-7/+23
| | | | | | | handling. - Extend g_handleattr() to treat attribute as string when len=0. OK'ed by: phk
* Put the scheme (APM, GPT, etc) in the XML.marcel2007-04-271-1/+3
|
* If compressed length is zero, return a zero-filled block.simokawa2007-04-241-0/+7
| | | | MFC after: 1 week
* -) Correct sdcount for a plex when removing or adding subdisks.le2007-04-123-3/+93
| | | | | | -) Set correct sizes for plexes and volumes a subdisk has been removed. Submitted by: Ulf Lilleengen <lulf_AT_freebsd.org>
* Avoid infinite loop if the device string given for a drivele2007-04-121-6/+3
| | | | | | only consists of "/". Submitted by: Ulf Lilleengen <lulf_AT_freebsd.org>
* Use root_mounted().pjd2007-04-081-1/+1
|
* Fix a bug for over 4GB media.simokawa2007-04-071-1/+1
| | | | MFC after: 3 days
* Sysctl description is not a format string, so one % is enough.pjd2007-04-061-1/+1
|
* - Be more verbose when saying "foo" not found.delphij2007-03-301-10/+10
| | | | | | | - In gctl_get_geom(), don't issue error when we were not provided with an parameter, like gctl_get_provider() did. Reviewed by: pjd
* make_dev(9) can be (and is) called without Giant, so there is no need tokris2007-03-261-8/+0
| | | | | | drop the topology lock and acquire Giant around this call. Reviewed by: phk
* Add missing \n.pjd2007-03-221-2/+2
|
* Overhaul driver/subsystem api's:sam2007-03-212-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o make all crypto drivers have a device_t; pseudo drivers like the s/w crypto driver synthesize one o change the api between the crypto subsystem and drivers to use kobj; cryptodev_if.m defines this api o use the fact that all crypto drivers now have a device_t to add support for specifying which of several potential devices to use when doing crypto operations o add new ioctls that allow user apps to select a specific crypto device to use (previous ioctls maintained for compatibility) o overhaul crypto subsystem code to eliminate lots of cruft and hide implementation details from drivers o bring in numerous fixes from Michale Richardson/hifn; mostly for 795x parts o add an optional mechanism for mmap'ing the hifn 795x public key h/w to user space for use by openssl (not enabled by default) o update crypto test tools to use new ioctl's and add cmd line options to specify a device to use for tests These changes will also enable much future work on improving the core crypto subsystem; including proper load balancing and interposing code between the core and drivers to dispatch small operations to the s/w driver as appropriate. These changes were instigated by the work of Michael Richardson. Reviewed by: pjd Approved by: re
* Warn when user use sectorsize bigger than the page size, which will leadpjd2007-03-051-0/+4
| | | | | | | | to problems when the geli device is used with file system or as a swap. Hopefully will prevent problems like kern/98742 in the future. MFC after: 1 week
* Fix geli after last commit for UP systems that are running SMP kernel.pjd2007-03-021-1/+2
| | | | | Submitted by: Hyo geol, Lee <hyogeollee@gmail.com> MFC after: 1 week
* Use pause() rather than tsleep() on stack variables and function pointers.jhb2007-02-272-4/+4
|
* First cut at GEOM based multipath. This is an active/passive{/passive...}mjacob2007-02-272-0/+867
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | arrangement that has no intrinsic internal knowledge of whether devices it is given are truly multipath devices. As such, this is a simplistic approach, but still a useful one. The basic approach is to (at present- this will change soon) use camcontrol to find likely identical devices and and label the trailing sector of the first one. This label contains both a full UUID and a name. The name is what is presented in /dev/multipath, but the UUID is used as a true distinguishor at g_taste time, thus making sure we don't have chaos on a shared SAN where everyone names their data multipath as "Fred". The first of N identical devices (and N *may* be 1!) becomes the active path until a BIO request is failed with EIO or ENXIO. When this occurs, the active disk is ripped away and the next in a list is picked to (retry and) continue with. During g_taste events new disks that meet the match criteria for existing multipath geoms get added to the tail end of the list. Thus, this active/passive setup actually does work for devices which go away and come back, as do (now) mpt(4) and isp(4) SAN based disks. There is still a lot to do to improve this- like about 5 of the 12 recommendations I've received about it, but it's been functional enough for a while that it deserves a broader test base. Reviewed by: pjd Sponsored by: IronPort Systems MFC: 2 months
* Use tsleep() rather than msleep() with a NULL mtx parameter.jhb2007-02-232-2/+2
|
* Reduce the noise when plugging in (USB) mass storage devices, like a 4 portn_hibma2007-02-211-1/+1
| | | | | | | | | flash card reader. Also remove an 'Opened da0 -> <random number>' which is not needed on a daily basis (available through bootverbose). Reviewed by: phk, ken MFC after: 1 week
* #include <sys/systm.h> before <sys/geom.h> to get KASSERT(), and fix LINT build.rodrigc2007-02-081-0/+1
|
* Evolve the ctlreq interface added to geom_gpt into a genericmarcel2007-02-077-1619/+2782
| | | | | | | | | | | partitioning class that supports multiple schemes. Current schemes supported are APM (Apple Partition Map) and GPT. Change all GEOM_APPLE anf GEOM_GPT options into GEOM_PART_APM and GEOM_PART_GPT (resp). The ctlreq interface supports verbs to create and destroy partitioning schemes on a disk; to add, delete and modify partitions; and to commit or undo changes made.
* We expect 'bio_data != NULL' for BIO_{READ,WRITE,GETATTR}, but forpjd2007-01-281-2/+7
| | | | | | BIO_{DELETE,FLUSH} we expect 'bio_data == NULL'. Reviewed by: phk
* It is possible that GEOM taste provider before SMP is started.pjd2007-01-281-0/+7
| | | | | | | | We can't bind to a CPU which is not yet on-line, so add code that wait for CPUs to go on-line before binding to them. Reported by: Alin-Adrian Anton <aanton@spintech.ro> MFC after: 2 weeks
* Cylinder group bitmaps and blocks containing inode for a snapshotkib2007-01-231-0/+1
| | | | | | | | | | | | | | | | | | | | | file are after snaplock, while other ffs device buffers are before snaplock in global lock order. By itself, this could cause deadlock when bdwrite() tries to flush dirty buffers on snapshotted ffs. If, during the flush, COW activity for snapshot needs to allocate block and ffs_alloccg() selects the cylinder group that is being written by bdwrite(), then kernel would panic due to recursive buffer lock acquision. Avoid dealing with buffers in bdwrite() that are from other side of snaplock divisor in the lock order then the buffer being written. Add new BOP, bop_bdwrite(), to do dirty buffer flushing for same vnode in the bdwrite(). Default implementation, bufbdflush(), refactors the code from bdwrite(). For ffs device buffers, specialized implementation is used. Reviewed by: tegge, jeff, Russell Cattelan (cattelan xfs org, xfs changes) Tested by: Peter Holm X-MFC after: 3 weeks (if ever: it changes ABI)
* Softc may be NULL in g_journal_orphan(), so don't be surprised.pjd2006-12-021-3/+4
|
OpenPOWER on IntegriCloud