Removed TODOs around implicitly adjusting grm in mdir commit

There was an idea of making the necessary mid/rid adjustments to grm in
lfsr_mdir_commt implicitly.

Explored this, but:

1. It looked like the result would increase code size, though only by
   a small (~12 byte) amount.

2. It wouldn't actually work, because lfr_mkdir needs to create a grm
   for an mid/rid that doesn't actually exist at the time of commit.
   Such a grm can't be created and survive any implicit mid/rid
   adjustment.

So scratching that idea for now.
This commit is contained in:
Christopher Haster
2023-07-28 16:48:26 -05:00
parent 5f0161712c
commit 8499f4cfb2
-3
View File
@@ -7574,7 +7574,6 @@ int lfsr_remove(lfs_t *lfs, const char *path) {
// create a grm to remove the dstart entry
lfsr_grm_pushrm(&grm, dstart_mdir.mid, dstart_rid);
// TODO should we just make this an atomic remove?
// adjust rid if grm is on the same mdir as our dir
if (grm.rms[0].mid == mdir.mid
&& (lfs_ssize_t)grm.rms[0].rid > rid) {
@@ -7639,7 +7638,6 @@ int lfsr_rename(lfs_t *lfs, const char *old_path, const char *new_path) {
return LFS_ERR_NAMETOOLONG;
}
// TODO should we just make this an atomic rename?
// adjust old rid if grm is on the same mdir as new rid
if (grm.rms[0].mid == new_mdir.mid
&& (lfs_ssize_t)grm.rms[0].rid >= new_rid) {
@@ -7972,7 +7970,6 @@ static int lfsr_fs_fixgrm(lfs_t *lfs) {
lfsr_grm_t grm = lfs->grm;
lfsr_grm_poprm(&grm);
// TODO should this just be implicit in lfsr_mdir_commit? compare cost?
// make sure to adjust any remaining grms
if (grm.rms[0].mid == lfs->grm.rms[0].mid
&& grm.rms[0].rid >= lfs->grm.rms[0].rid) {