9ns: Make QTFILE == 0. Goddamn 9p
authorBarret Rhoden <brho@cs.berkeley.edu>
Tue, 20 Mar 2018 19:55:00 +0000 (15:55 -0400)
committerBarret Rhoden <brho@cs.berkeley.edu>
Mon, 30 Apr 2018 18:33:44 +0000 (14:33 -0400)
commit6d1fd6c15156c531fde3123809c77f81614073c2
tree03dbcc5ee9def2ddf52fe632d6b3d972b2a254aa
parent651a535ea9339ddb1a6df4ed8a0457365bf06530
9ns: Make QTFILE == 0.  Goddamn 9p

This is annoying, but translating qids back and forth just for one bit
isn't worth the bugs.

Zero wouldn't be as bad if there were a bunch of *values* for qid.type, so
that we're just doing == checks or switches  (still, don't use zero).  But
it's bits!  The worst possible decision.

This is OK, and you see it everywhere:

c->qid.type & QTDIR

this isn't, since QTFILE has the value 0:

c->qid.type & QTFILE

This is the same shit with O_READ modes.

Goddamn.

Told-off-by: Barret Rhoden <brho@cs.berkeley.edu>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
kern/include/ns.h
kern/include/tree_file.h
kern/src/mm.c
kern/src/ns/fs_file.c
kern/src/ns/tree_file.c