Don Lewis 5b892e7363 Initialize r_flags the same way in all cases using a sanitized copy of
flags that has several bits cleared. The RF_WANTED and RF_FIRSTSHARE
bits are invalid in this context, and we want to defer setting RF_ACTIVE
in r_flags until later.  This should make rman_get_flags() return
the correct answer in all cases.

Add a KASSERT() to catch callers which incorrectly pass the RF_WANTED
or RF_FIRSTSHARE flags.

Do a strict equality check on the share type bits of flags.  In
particular, do an equality check on RF_PREFETCHABLE.  The previous
code would allow one type of mismatch of RF_PREFETCHABLE but disallow
the other type of mismatch.  Also, ignore the the RF_ALIGNMENT_MASK
bits since alignment validity should be handled by the amask check.
This field contains an integer value, but previous code did a strange
bitwise comparison on it.

Leave the original value of flags unmolested as a minor debug aid.

Change the start+amask overflow check to a KASSERT() since it is just
meant to catch a highly unlikely programming error in the caller.

Reviewed by:	jhb
MFC after:	1 month
2014-05-28 16:57:17 +00:00
..
2014-04-07 20:44:00 +00:00
2014-05-27 19:46:11 +00:00
2014-03-31 16:37:41 +00:00
2014-05-28 16:28:22 +00:00
2014-05-21 21:30:00 +00:00
2014-04-17 12:22:08 +00:00
2014-02-06 13:28:06 +00:00
2014-04-30 20:52:38 +00:00
2014-04-05 22:43:18 +00:00
2014-05-15 03:47:52 +00:00