Commit Graph

672 Commits

Author SHA1 Message Date
pjd
cffa6fd685 Fix format string. 2004-06-07 13:40:40 +00:00
pjd
3b62f6e040 Don't allow for duplicated entries creation. 2004-06-07 13:33:09 +00:00
joerg
b2404db737 Add SVR4-compatible VTOC-style elements to the Sun label. The
FreeBSD kernel doesn't use them but sunlabel(8) shortly will,
and both these files are used by sunlabel(8).
2004-06-01 20:18:25 +00:00
phk
623c8fe8d0 Zap a redundant NULL 2004-05-30 18:04:06 +00:00
pjd
4a04a3b007 Dump some more informations:
- device state
	- list of used providers
	- total number of disks
	- number of disks online

Prodded by:	Alex Deiter <tiamat@komi.mts.ru>
2004-05-26 11:36:27 +00:00
pjd
b400b04c05 - Change command name from 'config' to 'configure'.
- Bump version number.
2004-05-21 15:23:48 +00:00
pjd
f44a01349d - Teach CONCAT class how to talk with geom(8).
- Remove provider if any disk was lost.
- Dump CONCAT version.

Supported by:	Wheel - Open Technologies - http://www.wheel.pl
2004-05-20 10:40:18 +00:00
pjd
86dae1fb27 Introduce STRIPE GEOM class. It implements RAID0 transformation and it
is intend to be fast. Just like CONCAT class it provides manual and
auto configuration methods.

Supported by:	Wheel - Open Technologies - http://www.wheel.pl
2004-05-20 10:20:49 +00:00
pjd
90c2eca016 Introduce NOP GEOM class. This is totally transparent GEOM class, but
it is very useful for tests. One is able to destroy its provider
forcibly if wants to test how other class handle such events.
One is also able to specify failure probability to check how other
classes handle I/O errors.

Supported by:	Wheel - Open Technologies - http://www.wheel.pl
2004-05-20 10:15:53 +00:00
sos
492da9f785 Dont try to finish devstat's if the disk pointer is NULL, this can happen
when a disk has been destroyed but still has outstanding bio's.

Reviewed by:	phk
2004-05-11 13:17:40 +00:00
pjd
6f00e1b72e Close some small wakeup<->msleep races. 2004-05-05 12:30:41 +00:00
pjd
f8606822ff Fix compilation on 64-bit architectures.
Noticed by:	Tinderbox
2004-05-04 07:45:39 +00:00
pjd
2a2290a736 Turn off debugging by default. 2004-05-03 21:11:54 +00:00
pjd
33d1430a62 Prefer signed type over unsigned to be able to assert negative
reference count.
2004-05-03 21:02:02 +00:00
pjd
3a548ca143 - Hold g_gate_list_mtx lock while generating/checking unit number.
Found by:	mtx_assert() g_gate.c:273
- Set command before returning to userland with ENOMEM error value.
	Found by:	assert() ggatel.c:108
2004-05-03 18:06:24 +00:00
pjd
ffc1c33f15 Make it compile on 64-bit architectures.
The biggest issue was that 16-bit atomic operations aren't supported
on all architectures.
2004-05-02 17:57:49 +00:00
pjd
7992868cbb Kernel bits of GEOM Gate. 2004-04-30 16:08:12 +00:00
marcel
55e79a3a58 Allow disks with a GPT to be used on big-endian machines. The GPT is
little-endian by definition and needs byte-swap operations for any
multi-byte field. While here fix indentation.
2004-04-30 05:05:39 +00:00
pjd
39b39ae544 - Don't check if 'gp' is non-NULL, it always is and GEOM wants to
dump geom configuration when 'pp' and 'cp' are NULL.
- Use tabs instead of spaces.
2004-04-20 17:07:55 +00:00
pjd
37382454e0 Calculate bio_completed properly or die!
Approved by:	phk
2004-04-04 20:37:28 +00:00
grehan
1101a7ee87 Move the name attribute to the end of the conftxt line to simplify
libdisk parsing (the name may be empty, or contain spaces).

Submitted by:  Suleiman Souhlal <refugee@segfaulted.com>
2004-04-01 01:33:37 +00:00
pjd
5fae899223 Move "is consumer attached?" check before G_VALID_PROVIDER() check,
because if consumer is not attached, its provider never will be valid,
so we never reach this check.

Approved by:	phk
2004-03-18 07:17:10 +00:00
phk
8940a1c435 Be more insistent on destroying geoms at unload time. Still not perfect,
but it will do (better) for now.

KASSERT that to have providers a class must have an access method.

Tag the new_provider event with the geom as well.
2004-03-11 08:16:23 +00:00
phk
9a7074f4cb Rearrange some of the GEOM debugging tools to be more structured.
Retire g_sanity() and corresponding debugflag (0x8)

  Retire g_{stall,release}_events().

  Under #ifdef DIAGNOSTIC:

    Make g_valid_obj() an official function and have it return an an
    non-zero integer which indicates the kind of object when found.

    Implement G_VALID_{CLASS,GEOM,CONSUMER,PROVIDER}() macros based
    on g_valid_obj().

    Sprinkle calls to these macros liberally over the infrastructure.

    Always check that we do not free a live object.
2004-03-10 08:49:08 +00:00
pjd
e213a22583 - Don't take sectorsize from first disk. Calculate it by finding
least common multiple of all disks sector sizes.
  This will allow to safely concatenate disks with different sector sizes.
- Mark unused function arguments.
- Other minor cleanups.
2004-03-09 11:18:53 +00:00
pjd
635aabbaa2 Print a space character between string given as a macro argument and
bio description.
2004-03-09 11:00:24 +00:00
phk
4b105bbf3a Don't panic on providers already withered when we wither a geom. 2004-03-07 17:33:15 +00:00
jhb
2642ed4029 kthread_exit() no longer requires Giant, so don't force callers to acquire
Giant just to call kthread_exit().

Requested by:	many
2004-03-05 22:42:17 +00:00
pjd
104959c8ef Correct year in copyrights. 2004-03-04 10:22:42 +00:00
pjd
a9cc917261 - Remove d_valid field, we can use d_consumer field to check if disk
is valid.
- Use SYSCTL_DECL() instead of using own, ugly extern.
2004-03-03 22:29:24 +00:00
pjd
dcb69fe7b1 Removed unused fields. 2004-03-01 17:33:11 +00:00
pjd
182ad8928d We don't need d_length field. 2004-03-01 17:32:48 +00:00
pjd
2e191a7e19 Even if we're sure that we can't be orphaned here, we have to define
orphan field - we're enforcing it in GEOM. This will reach KASSERT
in INVARIANTS case.

Add missing space.

Approved by:	scottl (mentor)
2004-02-27 15:34:21 +00:00
pjd
bb9aeae50f Remove unused field.
Approved by:	scottl (mentor)
2004-02-27 15:32:49 +00:00
phk
ad925439e0 Device megapatch 4/6:
Introduce d_version field in struct cdevsw, this must always be
initialized to D_VERSION.

Flip sense of D_NOGIANT flag to D_NEEDGIANT, this involves removing
four D_NOGIANT flags and adding 145 D_NEEDGIANT flags.
2004-02-21 21:10:55 +00:00
pjd
e02d6ef4bb Introduce CONCAT GEOM class for disk concatenation.
It allows manual and automatic (based on on-disk metadata) concatenation.

Reviewed by:	phk, scottl
Approved by:	scottl (mentor)
2004-02-19 15:19:49 +00:00
phk
49c92e5706 Change the disk(9) API in order to make device removal more robust.
Previously the "struct disk" were owned by the device driver and this
gave us problems when the device disappared and the users of that device
were not immediately disappearing.

Now the struct disk is allocate with a new call, disk_alloc() and owned
by geom_disk and just abandonned by the device driver when disk_create()
is called.

Unfortunately, this results in a ton of "s/\./->/" changes to device
drivers.

Since I'm doing the sweep anyway, a couple of other API improvements
have been carried out at the same time:

The Giant awareness flag has been flipped from DISKFLAG_NOGIANT to
DISKFLAG_NEEDSGIANT

A version number have been added to disk_create() so that we can detect,
report and ignore binary drivers with old ABI in the future.

Manual page update to follow shortly.
2004-02-18 21:36:53 +00:00
phk
c9a89db245 Do not check error code from closing ->access() calls, we know they succeed. 2004-02-14 17:59:44 +00:00
phk
14df0ab802 Add a KASSERT which checks that a class never fails a closing ->access()
call.
2004-02-14 17:58:57 +00:00
phk
124977fbb6 Remove the absolute count g_access_abs() function since experience has
shown that it is not useful.

Rename the relative count g_access_rel() function to g_access(), only
the name has changed.

Change all g_access_rel() calls in our CVS tree to call g_access() instead.

Add an #ifndef BURN_BRIDGES #define of g_access_rel() for source
code compatibility.
2004-02-12 22:42:11 +00:00
phk
87cf92606a Give both consumers and providers a {void *private, u_int index} which
the implementing class can use to hang internal info from.
2004-02-12 20:32:11 +00:00
pjd
c681583fbc Added g_print_bio() function to print informations about given bio.
Approved by:	phk, scottl (mentor)
2004-02-11 18:21:32 +00:00
pjd
1af94a8033 Now we have g_topology_assert_not(), so use it to detect deadlocks.
Approved by:	phk, scottl (mentor)
2004-02-10 15:55:17 +00:00
pjd
e8bed31902 Added macro which will be used to assert, that the topology lock is not held.
Approved by:	phk, scottl (mentor)
2004-02-10 15:53:28 +00:00
phk
853b4bc47c don't call sbuf_clear() right after sbuf_new(), it is not necessary. 2004-02-10 10:54:19 +00:00
phk
3f5293e827 Polish the work/state engine in preparation for HW-crypto support. 2004-02-08 10:19:18 +00:00
phk
fd04c07950 Add a missing error case return.
Problem reported by:	Flemming Jacobsen <fj@batmule.dk>
2004-02-08 09:39:02 +00:00
phk
bcf2cf333e We don't need to hold Giant to create the worker kthread. 2004-02-07 23:01:17 +00:00
pjd
9ebcd20d35 Allow decreasing access count even if there is no disk anymore.
This will allow closing disks that were removed while opened.

Approved by:	phk, scottl (mentor)
2004-02-06 23:10:49 +00:00
le
eb1889fd1b Fix memory leak.
PR:            kern/58634
Submitted by:  le
Approved by:   phk
2004-02-06 22:51:04 +00:00