On Thu, Dec 17, 2015 at 11:36 PM, NGie Cooper <yaneurab...@gmail.com> wrote:
> > > On Dec 17, 2015, at 21:55, Warner Losh <i...@freebsd.org> wrote: > > > > Author: imp > > Date: Fri Dec 18 05:55:24 2015 > > New Revision: 292428 > > URL: https://svnweb.freebsd.org/changeset/base/292428 > > > > Log: > > No need to test command values this way. There can be only one, even > > though the encoding is bit-wise today... > > What if a third party has defined other BIOs in addition to these and are > doing bitwise ORs? I know $work specialized the buf layer — but we don’t > use nandfs(4) today… not sure about others... > Those applications would fail. But they would fail hard in FreeBSD's default stack due to the pervasive use of switch statements and direct tests for equality. Only one bit can ever be set in the stack today and have things actually work as intended. The only reason they are assigned as bits was so that drivers could pass whole classes of commands up / down the stack by looking at a bitmask, rather than a series of if statements. This consideration isn't relevant to the changes I made, which merely obfuscated the tests for no benefit. Warner _______________________________________________ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"