Adopted lazy geometry encoding
- LFSR_TAG_GEOMETRY ---> lfsr_data_fromgeometry
Not much to say about this one, LFSR_TAG_GEOMETRY is a bit of an
outlier.
I did consider deduplicating with the mptr encoder, but decided that
would be too hacky, and create problems for future metadata redundancy
things.
Still saves code though, which is nice:
code stack ctx
before: 35632 2440 636
after: 35580 (-0.1%) 2440 (+0.0%) 636 (+0.0%)
This commit is contained in:
+8
-14
@@ -995,15 +995,12 @@ code = '''
|
||||
// note we're messing around with internals to do this! this
|
||||
// is not a user API
|
||||
lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0;
|
||||
uint8_t geometry_buf[LFSR_GEOMETRY_DSIZE];
|
||||
lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_RATTRS(
|
||||
LFSR_RATTR(
|
||||
LFSR_RATTR__(
|
||||
LFSR_TAG_GEOMETRY, 0,
|
||||
LFSR_DATA_GEOMETRY(
|
||||
(&(lfsr_geometry_t){
|
||||
INC_BLOCK_SIZE,
|
||||
BLOCK_COUNT}),
|
||||
geometry_buf)))) => 0;
|
||||
(&(lfsr_geometry_t){
|
||||
INC_BLOCK_SIZE,
|
||||
BLOCK_COUNT}), LFSR_GEOMETRY_DSIZE))) => 0;
|
||||
lfsr_unmount(&lfs) => 0;
|
||||
|
||||
// mount should now fail
|
||||
@@ -1025,15 +1022,12 @@ code = '''
|
||||
// note we're messing around with internals to do this! this
|
||||
// is not a user API
|
||||
lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0;
|
||||
uint8_t geometry_buf[LFSR_GEOMETRY_DSIZE];
|
||||
lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_RATTRS(
|
||||
LFSR_RATTR(
|
||||
LFSR_RATTR__(
|
||||
LFSR_TAG_GEOMETRY, 0,
|
||||
LFSR_DATA_GEOMETRY(
|
||||
(&(lfsr_geometry_t){
|
||||
BLOCK_SIZE,
|
||||
INC_BLOCK_COUNT}),
|
||||
geometry_buf)))) => 0;
|
||||
(&(lfsr_geometry_t){
|
||||
BLOCK_SIZE,
|
||||
INC_BLOCK_COUNT}), LFSR_GEOMETRY_DSIZE))) => 0;
|
||||
lfsr_unmount(&lfs) => 0;
|
||||
|
||||
// mount should now fail
|
||||
|
||||
Reference in New Issue
Block a user