freebsd-skq/sys/dev/vinum
Bosko Milekic 9ed346bab0 Change and clean the mutex lock interface.
mtx_enter(lock, type) becomes:

mtx_lock(lock) for sleep locks (MTX_DEF-initialized locks)
mtx_lock_spin(lock) for spin locks (MTX_SPIN-initialized)

similarily, for releasing a lock, we now have:

mtx_unlock(lock) for MTX_DEF and mtx_unlock_spin(lock) for MTX_SPIN.
We change the caller interface for the two different types of locks
because the semantics are entirely different for each case, and this
makes it explicitly clear and, at the same time, it rids us of the
extra `type' argument.

The enter->lock and exit->unlock change has been made with the idea
that we're "locking data" and not "entering locked code" in mind.

Further, remove all additional "flags" previously passed to the
lock acquire/release routines with the exception of two:

MTX_QUIET and MTX_NOSWITCH

The functionality of these flags is preserved and they can be passed
to the lock/unlock routines by calling the corresponding wrappers:

mtx_{lock, unlock}_flags(lock, flag(s)) and
mtx_{lock, unlock}_spin_flags(lock, flag(s)) for MTX_DEF and MTX_SPIN
locks, respectively.

Re-inline some lock acq/rel code; in the sleep lock case, we only
inline the _obtain_lock()s in order to ensure that the inlined code
fits into a cache line. In the spin lock case, we inline recursion and
actually only perform a function call if we need to spin. This change
has been made with the idea that we generally tend to avoid spin locks
and that also the spin locks that we do have and are heavily used
(i.e. sched_lock) do recurse, and therefore in an effort to reduce
function call overhead for some architectures (such as alpha), we
inline recursion for this case.

Create a new malloc type for the witness code and retire from using
the M_DEV type. The new type is called M_WITNESS and is only declared
if WITNESS is enabled.

Begin cleaning up some machdep/mutex.h code - specifically updated the
"optimized" inlined code in alpha/mutex.h and wrote MTX_LOCK_SPIN
and MTX_UNLOCK_SPIN asm macros for the i386/mutex.h as we presently
need those.

Finally, caught up to the interface changes in all sys code.

Contributors: jake, jhb, jasone (in no particular order)
2001-02-09 06:11:45 +00:00
..
COPYRIGHT
makestatetext Cosmetic changes. 2000-02-29 06:07:01 +00:00
request.h Add flag XFR_BUFLOCKED to identify buffers which have been locked. 2000-12-20 05:10:08 +00:00
statetexts.h Cosmetic changes. 2000-02-29 06:07:01 +00:00
vinum.c Get rid of the last traces of ACTUALLY_LKM_NOT_KERNEL 2000-10-23 08:35:41 +00:00
vinumconfig.c Allocate lock table and mutex not only for parity plexes, but also for 2001-02-02 07:14:13 +00:00
vinumdaemon.c Change and clean the mutex lock interface. 2001-02-09 06:11:45 +00:00
vinumext.h Change linkage to parity maintenance operations. 2000-05-11 07:22:18 +00:00
vinumhdr.h Make intr_nesting_level per-process, rather than per-cpu. Setup 2001-01-21 19:25:07 +00:00
vinuminterrupt.c give_plex_to_volume: Recalculate volume size after attaching. 2000-12-20 05:13:26 +00:00
vinumio.c Correct check for partition c. Previously the check was for drive 2, 2001-01-20 03:46:19 +00:00
vinumio.h Change parity maintenance ioctls. 2000-05-11 07:23:16 +00:00
vinumioctl.c Rename detached plexes and subdisks correctly (off by one error) 2000-12-20 05:16:46 +00:00
vinumkw.h Add 'dumpconfig' keyword. 2000-06-02 04:04:31 +00:00
vinumlock.c Change and clean the mutex lock interface. 2001-02-09 06:11:45 +00:00
vinummemory.c Make intr_nesting_level per-process, rather than per-cpu. Setup 2001-01-21 19:25:07 +00:00
vinumparser.c Rearrange #includes to make more sense. This is still not the reform 2000-12-20 05:17:29 +00:00
vinumraid5.c bre5: don't bufdone the user bp on error, let vinumstart() do it. 2001-01-10 05:07:14 +00:00
vinumrequest.c vinumstart: Don't check for B_DONE on return from bre(), it doesn't 2001-01-10 05:07:52 +00:00
vinumrevive.c Re-commit revision 1.32, which grog incorrectly backed out in revision 1.33. 2000-12-20 11:17:09 +00:00
vinumstate.c start_object: Set the revive length correctly. 2000-06-07 03:34:18 +00:00
vinumstate.h
vinumutil.c plex_org: Add case for RAID-4. 2000-02-29 06:16:44 +00:00
vinumvar.h struct rangelock: Remove the field 'plex' from the entry. Range locks 2001-01-14 06:34:57 +00:00