tag-returning: Tweaked some rbyd namelookup arguments
This is where I would've adopted tag-returns in lfs3_rbyd_namelookup, but it turns out this isn't possible. We are already muxing error codes with compare flags (lfs3_scmp_t)! In theory we could merge err + lfs3_cmp_t + lfs3_tag_t into one big 16-bit ordered tag mux abomination, but I decided that was probably overkill for now. As a plus this avoids an awkward temporary tag copy in lfs3_rbyd_namelookup as we search for a better tag. Turns out the out-pointers in lfs3_rbyd_namelookup are quite useful for staging things. No code changes.
This commit is contained in:
@@ -4907,8 +4907,8 @@ static int lfs3_rbyd_appendshrub(lfs3_t *lfs3, lfs3_rbyd_t *rbyd,
|
||||
// with the best matching name if not found
|
||||
static lfs3_scmp_t lfs3_rbyd_namelookup(lfs3_t *lfs3, const lfs3_rbyd_t *rbyd,
|
||||
lfs3_did_t did, const char *name, lfs3_size_t name_len,
|
||||
lfs3_srid_t *rid_,
|
||||
lfs3_tag_t *tag_, lfs3_rid_t *weight_, lfs3_data_t *data_) {
|
||||
lfs3_srid_t *rid_, lfs3_tag_t *tag_, lfs3_rid_t *weight_,
|
||||
lfs3_data_t *data_) {
|
||||
// empty rbyd? leave it up to upper layers to handle this
|
||||
if (rbyd->weight == 0) {
|
||||
return LFS3_ERR_NOENT;
|
||||
@@ -6264,8 +6264,8 @@ static lfs3_scmp_t lfs3_btree_namelookupleaf(lfs3_t *lfs3,
|
||||
static lfs3_scmp_t lfs3_btree_namelookup(lfs3_t *lfs3,
|
||||
const lfs3_btree_t *btree,
|
||||
lfs3_did_t did, const char *name, lfs3_size_t name_len,
|
||||
lfs3_bid_t *bid_,
|
||||
lfs3_tag_t *tag_, lfs3_bid_t *weight_, lfs3_data_t *data_) {
|
||||
lfs3_bid_t *bid_, lfs3_tag_t *tag_, lfs3_bid_t *weight_,
|
||||
lfs3_data_t *data_) {
|
||||
lfs3_rbyd_t rbyd;
|
||||
return lfs3_btree_namelookupleaf(lfs3, btree,
|
||||
did, name, name_len,
|
||||
|
||||
Reference in New Issue
Block a user