summaryrefslogtreecommitdiff
path: root/sys/geom
Commit message (Collapse)AuthorAgeFilesLines
* Properly return the UUID represented by the alias.Marcel Moolenaar2010-01-021-1/+1
| | | | | | | | | PR: 142174 Submitted by: Przemyslaw Laczynski <torindel@gmail.com> Pointy hat to: rpaulo Notes: svn path=/head/; revision=201374
* Call wakeup() only for the first request on the queue.Alexander Motin2009-12-301-2/+8
| | | | Notes: svn path=/head/; revision=201264
* (S)LIST_HEAD_INITIALIZER takes a (S)LIST_HEAD as an argument.Antoine Brodin2009-12-281-1/+1
| | | | | | | | | | | | Fix some wrong usages. Note: this does not affect generated binaries as this argument is not used. PR: 137213 Submitted by: Eygene Ryabinkin (initial version) MFC after: 1 month Notes: svn path=/head/; revision=201145
* Add BIO_DELETE support to ada(4):Alexander Motin2009-12-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | - For SSDs use TRIM feature of DATA SET MANAGEMENT command, as defined by ACS-2 specification working draft. - For CompactFlash use CFA ERASE command, same as ad(4) does. With this patch, `newfs -E /dev/ada1` was able to restore write speed of my heavily weared OCZ Vertex SSD (firmware 1.4) up to the initial level for the most part of it's capacity. Previous 1.3 firmware, even reportiong TRIM capabilty bit set, was not working, reporting ABORT error for every DSM command. I have no idea whether it is normal, but for some reason it takes 200ms to handle any TRIM command on this drive, that was making delete extremely slow. But TRIM command is able to accept long list of LBAs and the length of that list seems doesn't affect it's execution time. Implemented request clusting algorithm allowed me to rise delete rate up to reasonable numbers, when many parallel DELETE requests running. Notes: svn path=/head/; revision=201139
* Make geom_concat to passthrough stripe parameters of the first component,Alexander Motin2009-12-241-5/+8
| | | | | | | hoping that rest will fit. Notes: svn path=/head/; revision=200942
* As soon as geom_raid3 reports it's own stripe as sector size, report largestAlexander Motin2009-12-241-0/+14
| | | | | | | | underlying provider's stripe, multiplied by number of data disks in array, due to transformation done, as array stripe. Notes: svn path=/head/; revision=200940
* As soon as mirror has no own stripes, report largest stripe of unrerlyingAlexander Motin2009-12-241-0/+9
| | | | | | | components, hoping others fit, if they are not equal. Notes: svn path=/head/; revision=200935
* Add two disk ioctls, giving user-level tools information about disk/arrayAlexander Motin2009-12-241-1/+6
| | | | | | | stripe (optimal access block) size and offset. Notes: svn path=/head/; revision=200934
* Make geom_stripe report it's stripe size to upper layers.Alexander Motin2009-12-241-0/+2
| | | | Notes: svn path=/head/; revision=200933
* Make graid3 fallback to malloc() when component request size is biggerAlexander Motin2009-12-212-9/+15
| | | | | | | then maximal prepared UMA zone size. This fixes crash with MAXPHYS > 128K. Notes: svn path=/head/; revision=200821
* Add Microsoft and NetBSD partition types handling.Rui Paulo2009-12-143-0/+41
| | | | Notes: svn path=/head/; revision=200539
* Simplify partition type parsing by using a data-oriented model.Rui Paulo2009-12-143-63/+68
| | | | | | | While there add more Apple and Linux partition types. Notes: svn path=/head/; revision=200534
* Change 'load' balancing mode algorithm:Alexander Motin2009-12-032-30/+26
| | | | | | | | | | | | | | | | - Instead of measuring last request execution time for each drive and choosing one with smallest time, use averaged number of requests, running on each drive. This information is more accurate and timely. It allows to distribute load between drives in more even and predictable way. - For each drive track offset of the last submitted request. If new request offset matches previous one or close for some drive, prefer that drive. It allows to significantly speedup simultaneous sequential reads. PR: kern/113885 Reviewed by: sobomax Notes: svn path=/head/; revision=200086
* Provide a set of sysctls and tunables to disable device node creationEdward Tomasz Napierala2009-11-289-29/+68
| | | | | | | | | | | | | for specific "kinds" of disk labels - for example, GPT UUIDs. Reason for this is that sometimes, other GEOM classes attach to these device nodes instead of the proper ones - e.g. they attach to /dev/gptid/XXX instead of /dev/ada0p2, which is annoying. Reviewed by: pjd (earlier version) MFC after: 1 month Notes: svn path=/head/; revision=199875
* Add a missing check for Apple HFS partitions.Rui Paulo2009-11-121-0/+2
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=199232
* We need to allocate space for the header in the create path also.Robert Noland2009-11-121-0/+3
| | | | | | | | | | | | This fixes a null pointer dereference with "gpart create -s GPT" after the previous commit. Reported by: Yuri Pankov Pointyhat to: me MFC after: 1 week Notes: svn path=/head/; revision=199228
* Fix handling of GPT headers when size is > 92 bytes.Robert Noland2009-11-071-68/+93
| | | | | | | | | | | | | | | | | | | | It is valid for an on-disk GPT header to report a header size which is greater than 92 bytes. Previously, we would read in the sector and copy only the 92 bytes that we know how to deal with before calculating the checksum for comparison. This meant that when we did the checksum, we overshot the buffer and took in random memory, so the checksum would fail. We now determine the size of the header and allocate enough space to preserve the entire on-disk contents. This allows us to be correctly calculate the checksum and be able to modify and write the header back to the disk, while preserving data that we might not understand. Reported by: Kris Weston Approved by: marcel@ MFC after: 2 weeks Notes: svn path=/head/; revision=199017
* Set the active flag in the PMBR when we install bootcode on a GPTRobert Noland2009-10-141-0/+3
| | | | | | | | | | | partitioned disk. Some BIOS require this to be set before they will boot the device. Approved by: marcel MFC after: 2 weeks Notes: svn path=/head/; revision=198097
* If provider is open for writing when we taste it, skip it for classes thatPawel Jakub Dawidek2009-10-096-0/+25
| | | | | | | | | | | | | | | | | | | | | | | depend on on-disk metadata. This was we won't attach to providers that are used by other classes. For example we don't want to configure partitions on da0 if it is part of gmirror, what we really want is partitions on mirror/foo. During regular work it works like this: if provider is open for writing a class receives the spoiled event from GEOM and detaches, once provider is closed the taste event is send again and class can rediscover its metadata if it is still there. This doesn't work that way when new class arrives, because GEOM gives all existing providers for it to taste, also those open for writing. Classes have to decided on their own if they want to deal with such providers (eg. geom_dev) or not (classes modified by this commit). Reported by: des, Oliver Lehmann <lehmann@ans-netz.de> Tested by: des, Oliver Lehmann <lehmann@ans-netz.de> Discussed with: phk, marcel Reviewed by: marcel MFC after: 3 days Notes: svn path=/head/; revision=197898
* - Improve error message consistency and wording.Ulf Lilleengen2009-10-056-21/+21
| | | | Notes: svn path=/head/; revision=197767
* The first 96 bytes may not be zeroes. It can contain trivial bootMarcel Moolenaar2009-09-281-5/+5
| | | | | | | | | | | | | | | | code that merely emits an error and waits for a key press before rebooting. The error being that extended partitions are not bootable. The origin is presumed to be Windows 2000; Windows XP does not do this... For now, ignore the first 96 bytes when checking that the EBR is (for the most part) all zeroes. Tested by: Mario Lobo <mlobo@digiart.art.br> MFC after: 1 week Notes: svn path=/head/; revision=197608
* Don't create more partitions than can fit in the table by checkingMarcel Moolenaar2009-09-241-0/+4
| | | | | | | that the index is within bounds. Notes: svn path=/head/; revision=197449
* Remove unused variable.Edward Tomasz Napierala2009-09-081-2/+0
| | | | Notes: svn path=/head/; revision=196986
* Do not check proper request alignment here in geom_dev in production.Alexander Motin2009-09-081-2/+2
| | | | | | | | | | It will be checked any way later by g_io_check() in g_io_schedule_down(). It is only needed here to not trigger panic from additional check, when INVARIANTS enabled. So cover it with #ifdef INVARIANTS. It saves two 64bit divisions per request. Notes: svn path=/head/; revision=196964
* MFp4:Alexander Motin2009-09-061-2/+2
| | | | | | | | | Remove msleep() timeout from g_io_schedule_up/down(). It works fine without it, saving few percents of CPU on high request rates without need to rearm callout twice per request. Notes: svn path=/head/; revision=196904
* Add support for changing providers priority.Pawel Jakub Dawidek2009-09-061-9/+62
| | | | | | | Submitted by: Mel Flynn Notes: svn path=/head/; revision=196879
* Remove artificial MAX_IO_SIZE constant, equal to DFLTPHYS * 2. Use MAXPHYSAlexander Motin2009-09-041-7/+6
| | | | | | | | instead. It is NULL change for GENERIC kernel, but allows 'fast' mode to work on systems with increased MAXPHYS. Notes: svn path=/head/; revision=196837
* Simplify g_disk_ident_adjust() function and allow any printable characterPawel Jakub Dawidek2009-09-041-28/+15
| | | | | | | | | | in serial number. Discussed with: trasz Obtained from: Wheel Sp. z o.o. (http://www.wheel.pl) Notes: svn path=/head/; revision=196823
* There's no need for checking result of M_WAITOK allocation.Pawel Jakub Dawidek2009-08-271-4/+0
| | | | Notes: svn path=/head/; revision=196580
* Fix an obvious topology lock leak.Pawel Jakub Dawidek2009-08-271-0/+1
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=196579
* The start of the EFI GPT partition in the PMBR can always be representedMarcel Moolenaar2009-08-171-3/+3
| | | | | | | | | | | | | by CHS addressing. Don't define these fields as 0xff, but rather define them correctly. This prevents boot problems on PCs where GPT is being used. PR: 115406 Submitted by: Kent Hauser <kent@khauser.net> Approved by: re (kib) Notes: svn path=/head/; revision=196333
* - Fix the issue with read access count modification on RAID-5 plexes properly.Ulf Lilleengen2009-07-181-4/+6
| | | | | | | | | | | | If the access counts were not increased and decreased in equal numbers by gvinum consumers, the read access count would be inconsistent with the write access count. Instead, modify the read access count with the write access count directly to prevent any inconsistencies. Approved by: re (kib) Notes: svn path=/head/; revision=195752
* Revert revisions 188839 and 188868. Use of the ioctl in geom_dev.cMarcel Moolenaar2009-07-083-49/+0
| | | | | | | | | | | | | | | is invalid because the ioctl happens without prior open. The ioctl got introduced to provide backward compatibility for extended partitions, but it ended up not being used because it didn't work as expected. Since there are no consumers of the ioctl and the implementation is broken, the best fix is to remove the code entirely. Spotted by: phk Approved by: re (kensmith) Notes: svn path=/head/; revision=195436
* Fix a panic which (reportedly) can happen when unmounting a filesystemEdward Tomasz Napierala2009-07-012-1/+3
| | | | | | | | | | | | with I/O requests in flight on kernels compiled with "options INVARIANTS". Also, make it obvious it's not right to call g_valid_obj() (and macros using it, e.g. G_VALID_CONSUMER()) without topology lock held. Approved by: re (kib) Reported by: pho Notes: svn path=/head/; revision=195257
* Make gjournal work with kernel compiled with "options DIAGNOSTIC".Edward Tomasz Napierala2009-06-303-8/+17
| | | | | | | | | | Previously, it would panic immediately. Reviewed by: pjd Approved by: re (kib) Notes: svn path=/head/; revision=195195
* - Apply the same naming rules of LVM names as done in the LVM code itself.Ulf Lilleengen2009-06-241-16/+27
| | | | | | | PR: kern/135874 Notes: svn path=/head/; revision=194924
* Do not stop the loop when an empty or deleted directory entry is found.John Hay2009-06-241-1/+3
| | | | | | | Rather just skip over it. Notes: svn path=/head/; revision=194811
* Fix tabs, slightly improve comments.Ivan Voras2009-06-181-9/+9
| | | | | | | | Approved by: gnn (mentor) (original) Noticed by: stas Notes: svn path=/head/; revision=194433
* Add support for labels derived from GPT metadata.Ivan Voras2009-06-133-0/+168
| | | | | | | | | | Approved by: gnn (mentor) Reviewed by: pjd PR: 128398 Submitted by: Marius Nuennerich < marius at nuenneri.ch > Notes: svn path=/head/; revision=194092
* As discussed in the devsummit, introduce two fields in theLuigi Rizzo2009-06-112-0/+88
| | | | | | | | | | struct bio to store classification information, and a hook for classifier functions that can be called by g_io_request(). This code is from Fabio Checconi as part of his GSOC work. Notes: svn path=/head/; revision=193981
* Simplify.Pawel Jakub Dawidek2009-06-051-4/+2
| | | | Notes: svn path=/head/; revision=193547
* Crank the debug level necessary to display the "Label foo is removed"Doug Barton2009-05-301-4/+4
| | | | | | | and "Label for provider ..." messages up from 0 to 1. Notes: svn path=/head/; revision=193131
* Place hostnames and similar information fully under the prison system.Jamie Gritton2009-05-292-5/+2
| | | | | | | | | | | | | | | | | | | | The system hostname is now stored in prison0, and the global variable "hostname" has been removed, as has the hostname_mtx mutex. Jails may have their own host information, or they may inherit it from the parent/system. The proper way to read the hostname is via getcredhostname(), which will copy either the hostname associated with the passed cred, or the system hostname if you pass NULL. The system hostname can still be accessed directly (and without locking) at prison0.pr_host, but that should be avoided where possible. The "similar information" referred to is domainname, hostid, and hostuuid, which have also become prison parameters and had their associated global variables removed. Approved by: bz (mentor) Notes: svn path=/head/; revision=193066
* - Unbreak 64 bit platforms by casting off_t to intmax.Ulf Lilleengen2009-05-261-3/+3
| | | | Notes: svn path=/head/; revision=192808
* - Fix wrong print on BIO_DONE.Ulf Lilleengen2009-05-261-46/+46
| | | | | | | | | | - Use db_printf instead of printf. While here, apply this to other ddb commands as well. Pointed out by: pjd Notes: svn path=/head/; revision=192803
* - Add 'show bio' DDB command.Ulf Lilleengen2009-05-261-0/+70
| | | | | | | MFC after: 3 weeks Notes: svn path=/head/; revision=192797
* Check return value of gctl_get_asciiparam().Edward Tomasz Napierala2009-05-121-0/+4
| | | | | | | | Found with: Coverity Prevent(tm) CID: 1118 Notes: svn path=/head/; revision=192021
* Remove the thread argument from the FSD (File-System Dependent) parts ofAttilio Rao2009-05-111-1/+1
| | | | | | | | | | | | | | | | | | | | the VFS. Now all the VFS_* functions and relating parts don't want the context as long as it always refers to curthread. In some points, in particular when dealing with VOPs and functions living in the same namespace (eg. vflush) which still need to be converted, pass curthread explicitly in order to retain the old behaviour. Such loose ends will be fixed ASAP. While here fix a bug: now, UFS_EXTATTR can be compiled alone without the UFS_EXTATTR_AUTOSTART option. VFS KPI is heavilly changed by this commit so thirdy parts modules needs to be recompiled. Bump __FreeBSD_version in order to signal such situation. Notes: svn path=/head/; revision=191990
* - Split up the BIO queue into a queue for new and one for completed requests.Ulf Lilleengen2009-05-065-86/+98
| | | | | | | | | | | | | | | | | | | | | | | This is necessary for two reasons: 1) In order to avoid collisions with the use of a BIOs flags set by a consumer or a provider 2) Because GV_BIO_DONE was used to mark a BIO as done, not enough flags was available, so the consumer flags of a BIO had to be misused in order to support enough flags. The new queue makes it possible to recycle the GV_BIO_DONE flag into GV_BIO_GROW. As a consequence, gvinum will now work with any other GEOM class under it or on top of it. - Use bio_pflags for storing internal flags on downgoing BIOs, as the requests appear to come from a consumer of a gvinum volume. Use bio_cflags only for cloned BIOs. - Move gv_post_bio to be used internally for maintenance requests. - Remove some cases where flags where set without need. PR: kern/133604 Notes: svn path=/head/; revision=191856
* - Fix a case where a RAID5 volume would think that it is supposed to grow a newUlf Lilleengen2009-05-061-2/+1
| | | | | | | subdisk after a parity rebuild. Notes: svn path=/head/; revision=191855