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-03-18 21:34:11 +00:00
2014-03-14 06:29:43 +00:00
2012-08-22 20:01:57 +00:00
2012-03-28 20:58:30 +00:00
2012-11-14 10:33:12 +00:00
2014-03-19 12:45:40 +00:00
2014-03-14 06:29:43 +00:00
2014-03-19 00:38:27 +00:00
2014-05-01 22:28:14 +00:00
2012-06-25 05:41:16 +00:00
2014-03-18 21:34:11 +00:00
2014-03-18 21:34:11 +00:00
2012-10-25 09:05:21 +00:00
2014-01-16 13:42:50 +00:00
2013-06-29 05:05:57 +00:00
2014-04-12 21:39:17 +00:00
2014-05-21 03:11:27 +00:00