aboutsummaryrefslogtreecommitdiff
path: root/sys/geom
Commit message (Collapse)AuthorAgeFilesLines
* The canonical way to print __func__ when using KASSERT() is to writeRui Paulo2010-10-133-10/+11
| | | | | | | ("%s", __func__). This avoids clang's -Wformat-string warnings. Notes: svn path=/head/; revision=213769
* Replace strlen(_PATH_DEV) with sizeof(_PATH_DEV) - 1.Andrey V. Elsukov2010-10-092-8/+8
| | | | | | | | | Suggested by: kib Approved by: kib (mentor) MFC after: 5 days Notes: svn path=/head/; revision=213662
* - Check flag with the bitwise operator, not the logical operator.Ulf Lilleengen2010-10-012-4/+4
| | | | | | | | Submitted by: arundel MFC after: 1 week Notes: svn path=/head/; revision=213318
* Some schemes can allocate memory for internal purposes but whenAndrey V. Elsukov2010-09-253-0/+3
| | | | | | | | | | | | | GEOM does withering this memory doesn't freed. Add G_PART_DESTROY call to g_part_wither. Also add missed g_free() call to G_PART_READ method for MBR and PC98 schemes. Submitted by: jh (previous version) Reviewed by: pjd Approved by: kib (mentor) Notes: svn path=/head/; revision=213174
* Change g_eli_debug to int, so one can turn off any GELI output by settingPawel Jakub Dawidek2010-09-252-3/+3
| | | | | | | | | kern.geom.eli.debug sysctl to -1. MFC after: 2 weeks Notes: svn path=/head/; revision=213165
* Ignore errors from BIO_FLUSH. It might confuse users that provider wasn'tPawel Jakub Dawidek2010-09-251-8/+6
| | | | | | | | | really killed. What we really care about are write errors only. MFC after: 2 weeks Notes: svn path=/head/; revision=213164
* Allow to configure GPT attributes. It shouldn't be allowed to set bootfailedPawel Jakub Dawidek2010-09-241-0/+85
| | | | | | | | | | | attribute (it should be allowed only to unset it), but for test purposes it might be useful, so the current code allows it. Reviewed by: arch@ (Message-ID: <20100917234542.GE1902@garage.freebsd.pl>) MFC after: 2 weeks Notes: svn path=/head/; revision=213135
* Update copyright years.Pawel Jakub Dawidek2010-09-237-7/+7
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=213072
* Add support for AES-XTS. This will be the default now.Pawel Jakub Dawidek2010-09-235-10/+73
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=213070
* Implement switching of data encryption key every 2^20 blocks.Pawel Jakub Dawidek2010-09-235-55/+171
| | | | | | | | | | This ensures the same encryption key won't be used for more than 2^20 blocks (sectors). This will be the default now. MFC after: 1 week Notes: svn path=/head/; revision=213067
* Make the code similar to the code in g_eli_integrity.c.Pawel Jakub Dawidek2010-09-231-3/+4
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=213063
* Define default overwrite count, so that userland can use it.Pawel Jakub Dawidek2010-09-232-1/+2
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=213062
* When trashing metadata, flush after each write.Pawel Jakub Dawidek2010-09-231-0/+7
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=213055
* Support attaching version 4 metadataBrian Somers2010-09-191-2/+4
| | | | | | | Reviewed by: pjd Notes: svn path=/head/; revision=212845
* Add support for dumping kernel to gconcat.Alexander Motin2010-09-161-0/+38
| | | | | | | Dumping goes to the component, where dump partition begins. Notes: svn path=/head/; revision=212754
* Change message when setting or unsetting attribute less confusing.Pawel Jakub Dawidek2010-09-151-2/+3
| | | | | | | | | | | | | | | Before: ada0 has <attrib> set After: <attrib> set on ada0 MFC after: 2 weeks Notes: svn path=/head/; revision=212706
* Make the message that informs about bootcode being written to disk lessPawel Jakub Dawidek2010-09-151-2/+2
| | | | | | | | | | | | | | | | | | confusing. Note there is still no information about 'partcode' being written to disk (gpart bootcode -p <partcode> <disk>). Maybe in the future all the messages printed by gpart(8) on success could be hidden under -v? PR: bin/150239 Reported by: Roddi <roddi@me.com> Submitted by: arundel MFC after: 2 weeks Notes: svn path=/head/; revision=212703
* - Change all places where G_TYPE_ASCNUM is used to G_TYPE_NUMBER.Pawel Jakub Dawidek2010-09-141-55/+118
| | | | | | | | It turns out the new type wasn't really needed. - Reorganize code a little bit. Notes: svn path=/head/; revision=212614
* Simplify the code a bit.Pawel Jakub Dawidek2010-09-141-12/+8
| | | | Notes: svn path=/head/; revision=212609
* - Remove gc_argname field. It was introduced for gpart(8), but if IPawel Jakub Dawidek2010-09-131-8/+4
| | | | | | | | | | understand everything correctly, we don't really need it. - Provide default numeric value as strings. This allows to simplify a lot of code. - Bump version number. Notes: svn path=/head/; revision=212554
* - Allow to specify value as const pointers.Pawel Jakub Dawidek2010-09-132-3/+3
| | | | | | | - Make optional string values always an empty string. Notes: svn path=/head/; revision=212547
* Correct bioq_disksort so that bioq_insert_tail() offers barrier semantic.Justin T. Gibbs2010-09-022-10/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the BIO_ORDERED flag for struct bio and update bio clients to use it. The barrier semantics of bioq_insert_tail() were broken in two ways: o In bioq_disksort(), an added bio could be inserted at the head of the queue, even when a barrier was present, if the sort key for the new entry was less than that of the last queued barrier bio. o The last_offset used to generate the sort key for newly queued bios did not stay at the position of the barrier until either the barrier was de-queued, or a new barrier (which updates last_offset) was queued. When a barrier is in effect, we know that the disk will pass through the barrier position just before the "blocked bios" are released, so using the barrier's offset for last_offset is the optimal choice. sys/geom/sched/subr_disk.c: sys/kern/subr_disk.c: o Update last_offset in bioq_insert_tail(). o Only update last_offset in bioq_remove() if the removed bio is at the head of the queue (typically due to a call via bioq_takefirst()) and no barrier is active. o In bioq_disksort(), if we have a barrier (insert_point is non-NULL), set prev to the barrier and cur to it's next element. Now that last_offset is kept at the barrier position, this change isn't strictly necessary, but since we have to take a decision branch anyway, it does avoid one, no-op, loop iteration in the while loop that immediately follows. o In bioq_disksort(), bypass the normal sort for bios with the BIO_ORDERED attribute and instead insert them into the queue with bioq_insert_tail(). bioq_insert_tail() not only gives the desired command order during insertion, but also provides barrier semantics so that commands disksorted in the future cannot pass the just enqueued transaction. sys/sys/bio.h: Add BIO_ORDERED as bit 4 of the bio_flags field in struct bio. sys/cam/ata/ata_da.c: sys/cam/scsi/scsi_da.c Use an ordered command for SCSI/ATA-NCQ commands issued in response to bios with the BIO_ORDERED flag set. sys/cam/scsi/scsi_da.c Use an ordered tag when issuing a synchronize cache command. Wrap some lines to 80 columns. sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c sys/geom/geom_io.c Mark bios with the BIO_FLUSH command as BIO_ORDERED. Sponsored by: Spectra Logic Corporation MFC after: 1 month Notes: svn path=/head/; revision=212160
* Correct offset conversion to little endian. It was implemented in version 2,Pawel Jakub Dawidek2010-08-282-7/+9
| | | | | | | | | | | but because of a bug it was a no-op, so we were still using offsets in native byte order for the host. Do it properly this time, bump version to 4 and set the G_ELI_FLAG_NATIVE_BYTE_ORDER flag when version is under 4. MFC after: 2 weeks Notes: svn path=/head/; revision=211927
* Remove bintime_cmp() function, unused since r200086.Alexander Motin2010-08-181-15/+0
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=211455
* Check that gsp is not NULL before access. It can be NULLAndrey V. Elsukov2010-08-031-1/+1
| | | | | | | | | | for some cases. Approved by: kib (mentor) MFC after: 1 week Notes: svn path=/head/; revision=210795
* Check that table is not NULL before access, it can be NULLAndrey V. Elsukov2010-08-031-1/+1
| | | | | | | | | | for some cases. Approved by: mav (mentor) MFC after: 2 weeks Notes: svn path=/head/; revision=210792
* Forward ioctl requests to original geom.Andrey V. Elsukov2010-08-021-0/+19
| | | | | | | | | | | PR: 148540 Silence from: luigi Reviewed by: pjd Approved by: mav (mentor) MFC after: 2 weeks Notes: svn path=/head/; revision=210747
* Release access for consumers that are opened, but will be destroyedAndrey V. Elsukov2010-08-021-0/+4
| | | | | | | | | | | | indirectly by orphan method. PR: 148688 Silence from: marcel Approved by: mav (mentor) MFC after: 2 weeks Notes: svn path=/head/; revision=210746
* Export PCI IDs of ATA/SATA controllers through CAM and ata(4) layers toAlexander Motin2010-07-252-0/+16
| | | | | | | | GEOM. This information needed for proper soft-RAID's on-disk metadata reading and writing. Notes: svn path=/head/; revision=210471
* Prevent access after free to table entry in case whenAndrey V. Elsukov2010-07-231-8/+8
| | | | | | | | | | | | user deletes partition that not yet created (changes doesn't committed to disk). PR: 148687 Approved by: mav (mentor) MFC after: 7 days Notes: svn path=/head/; revision=210401
* Fixed cache size decoding read from a label.Ruslan Ermilov2010-07-141-1/+1
| | | | | | | | | PR: kern/144732 Submitted by: Eugene Grosbein MFC after: 3 days Notes: svn path=/head/; revision=210046
* Add NTFS partition type to GEOM_MBR.Rui Paulo2010-06-263-2/+14
| | | | Notes: svn path=/head/; revision=209536
* 'unit' can be negative, so use signed type for it.Pawel Jakub Dawidek2010-06-141-1/+1
| | | | | | | | | Found by: Coverity Prevent CID: 3731 MFC after: 3 days Notes: svn path=/head/; revision=209187
* BIO_DELETE contains range we want to delete and doesn't provide any usefulPawel Jakub Dawidek2010-06-141-1/+1
| | | | | | | | | data, so there is no need to copy it to userland. MFC after: 3 days Notes: svn path=/head/; revision=209186
* fix a few cases where a string is passed via format argument instead ofAndriy Gapon2010-06-111-1/+1
| | | | | | | | | | | | | via %s Most of the cases looked harmless, but this is done for the sake of correctness. In one case it even allowed to drop an intermediate buffer. Found by: clang MFC after: 2 week Notes: svn path=/head/; revision=209062
* Untangle g_print_bio(), silencing Coverity.Edward Tomasz Napierala2010-06-101-8/+7
| | | | | | | | Found with: Coverity Prevent CID: 3566, 3567 Notes: svn path=/head/; revision=208992
* Try and narrow the gap in which you act on an event that has been canceled.Matt Jacob2010-06-081-0/+10
| | | | | | | | Obtained from: Jaako Heinonen MFC after: 1 month Notes: svn path=/head/; revision=208927
* Make sure not to pass NULL to g_orphan_provider().Edward Tomasz Napierala2010-06-051-1/+2
| | | | | | | | Found with: Coverity Prevent CID: 3411 Notes: svn path=/head/; revision=208812
* Don't leak memory on destruction.Marius Strobl2010-06-022-0/+12
| | | | | | | | Reviewed by: marcel MFC after: 3 days Notes: svn path=/head/; revision=208746
* g_label: fix possible NULL pointer dereferenceAndriy Gapon2010-05-311-4/+2
| | | | | | | | | | | in case glabel debug level is >= 1 and gp->provider list is empty for some reason Found by: clang static analyzer MFC after: 4 days Notes: svn path=/head/; revision=208672
* Fix some whitespace nits.Marius Strobl2010-05-241-10/+11
| | | | Notes: svn path=/head/; revision=208515
* Teach gpart about bootcode on APM.Nathan Whitehorn2010-05-161-0/+26
| | | | Notes: svn path=/head/; revision=208173
* Yet another potential dereference of a dead provider.Matt Jacob2010-05-141-1/+1
| | | | | | | | Sponsored by: Panasas MFC after: 1 week Notes: svn path=/head/; revision=208101
* Make sure to check that the active provider pointer points to something beforeMatt Jacob2010-05-141-1/+1
| | | | | | | | | | dereferencing the pointer. Sponsored by: Pansas MFC after: 1 week Notes: svn path=/head/; revision=208082
* - Don't return EAGAIN from gv_unload(). It was used to work around theJaakko Heinonen2010-05-104-5/+20
| | | | | | | | | | | | | | deadlock fixed in r207671. - Wait for worker process to exit at class unload. The worker process was not guaranteed to exit before the linker unloaded the module. - Use 0 as the worker process exit status instead of ENXIO and style the NOTREACHED comment. Reviewed by: lulf X-MFC after: r207671 Notes: svn path=/head/; revision=207878
* In g_zero_destroy_geom(), return 0 instead of EBUSY in the success case.Jaakko Heinonen2010-05-101-1/+1
| | | | | | | | | | EBUSY was probably used as a workaround for the deadlock fixed in r207671. Approved by: pjd X-MFC after: r207671 Notes: svn path=/head/; revision=207877
* - Remove obsolete flags.Ulf Lilleengen2010-05-081-6/+0
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=207789
* Fix deadlock between GEOM class unloading and withering. Withering can'tJaakko Heinonen2010-05-052-47/+54
| | | | | | | | | | | | proceed while g_unload_class() blocks the event thread. Fix this by not running g_unload_class() as a GEOM event and dropping the topology lock when withering needs to proceed. PR: kern/139847 Silence on: freebsd-geom Notes: svn path=/head/; revision=207671
* Re-calculate a geometry when reprobing as well.Marcel Moolenaar2010-04-251-0/+9
| | | | | | | | PR: kern/145452 Reported by: "Andrey V. Elsukov" <bu7cher@yandex.ru> Notes: svn path=/head/; revision=207181
* Fix undo for schemes that have internal partitions. Internal partitionsMarcel Moolenaar2010-04-251-1/+14
| | | | | | | | | | | | | | do not constitute user-visible or active partitions and as such should not prevent undoing pending operations. While here, initialize the last usable sector for the placeholder geom based on the null scheme, created to allow undoing the destruction of a scheme. This gives consistent output with "gpart show". Based on a patch from: "Andrey V. Elsukov" <bu7cher@yandex.ru> Notes: svn path=/head/; revision=207178