Renamed LFS_I_ORPHANS -> LFS_I_HASORPHANS
This better matches how other flags sometimes include the relevant verb, LFS_RBYD_ISSHRUB, LFSR_DATA_ONDISK, etc, and feels a bit more consistent.
This commit is contained in:
@@ -6701,7 +6701,7 @@ static inline bool lfsr_m_issync(uint32_t flags) {
|
|||||||
|
|
||||||
// internal fs flags
|
// internal fs flags
|
||||||
static inline bool lfsr_i_hasorphans(uint32_t flags) {
|
static inline bool lfsr_i_hasorphans(uint32_t flags) {
|
||||||
return flags & LFS_I_ORPHANS;
|
return flags & LFS_I_HASORPHANS;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline bool lfsr_i_isuncompacted(uint32_t flags) {
|
static inline bool lfsr_i_isuncompacted(uint32_t flags) {
|
||||||
@@ -9529,7 +9529,7 @@ eot:;
|
|||||||
// was mkconsistent successful?
|
// was mkconsistent successful?
|
||||||
if (lfsr_t_ismkconsistent(t->o.o.flags)
|
if (lfsr_t_ismkconsistent(t->o.o.flags)
|
||||||
&& !lfsr_t_isdirty(t->o.o.flags)) {
|
&& !lfsr_t_isdirty(t->o.o.flags)) {
|
||||||
lfs->flags &= ~LFS_I_ORPHANS;
|
lfs->flags &= ~LFS_I_HASORPHANS;
|
||||||
}
|
}
|
||||||
|
|
||||||
// was compaction successful? note we may need multiple passes if
|
// was compaction successful? note we may need multiple passes if
|
||||||
@@ -10817,7 +10817,7 @@ int lfsr_file_close(lfs_t *lfs, lfsr_file_t *file) {
|
|||||||
|
|
||||||
// fallback to just marking the filesystem as orphaned
|
// fallback to just marking the filesystem as orphaned
|
||||||
} else {
|
} else {
|
||||||
lfs->flags |= LFS_I_ORPHANS;
|
lfs->flags |= LFS_I_HASORPHANS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -13275,7 +13275,7 @@ static int lfsr_mountinited(lfs_t *lfs) {
|
|||||||
"%"PRId32".%"PRId32,
|
"%"PRId32".%"PRId32,
|
||||||
lfsr_mid_bid(lfs, mdir->mid) >> lfs->mdir_bits,
|
lfsr_mid_bid(lfs, mdir->mid) >> lfs->mdir_bits,
|
||||||
rid);
|
rid);
|
||||||
lfs->flags |= LFS_I_ORPHANS;
|
lfs->flags |= LFS_I_HASORPHANS;
|
||||||
|
|
||||||
// found an unknown file type?
|
// found an unknown file type?
|
||||||
} else if (lfsr_tag_isunknown(tag)) {
|
} else if (lfsr_tag_isunknown(tag)) {
|
||||||
@@ -13830,7 +13830,7 @@ int lfsr_fs_gc(lfs_t *lfs, lfs_soff_t steps, uint32_t flags) {
|
|||||||
// do we have any pending work?
|
// do we have any pending work?
|
||||||
uint32_t pending = flags & (
|
uint32_t pending = flags & (
|
||||||
((lfs->flags & (
|
((lfs->flags & (
|
||||||
LFS_I_ORPHANS
|
LFS_I_HASORPHANS
|
||||||
| LFS_I_UNCOMPACTED)) >> 16)
|
| LFS_I_UNCOMPACTED)) >> 16)
|
||||||
| ((lfsr_fs_canlookahead(lfs)) ? LFS_GC_LOOKAHEAD : 0)
|
| ((lfsr_fs_canlookahead(lfs)) ? LFS_GC_LOOKAHEAD : 0)
|
||||||
| LFS_GC_CKMETA
|
| LFS_GC_CKMETA
|
||||||
@@ -13895,7 +13895,7 @@ int lfsr_fs_gc(lfs_t *lfs, lfs_soff_t steps, uint32_t flags) {
|
|||||||
// clear any pending flags we make progress on
|
// clear any pending flags we make progress on
|
||||||
pending &= (
|
pending &= (
|
||||||
((lfs->flags & (
|
((lfs->flags & (
|
||||||
LFS_I_ORPHANS
|
LFS_I_HASORPHANS
|
||||||
| LFS_I_UNCOMPACTED)) >> 16)
|
| LFS_I_UNCOMPACTED)) >> 16)
|
||||||
| ((lfsr_fs_canlookahead(lfs)) ? LFS_GC_LOOKAHEAD : 0)
|
| ((lfsr_fs_canlookahead(lfs)) ? LFS_GC_LOOKAHEAD : 0)
|
||||||
// only consider our filesystem checked if we
|
// only consider our filesystem checked if we
|
||||||
|
|||||||
@@ -198,7 +198,8 @@ enum lfs_type {
|
|||||||
0x08000000 // Filesystem may have uncompacted metadata
|
0x08000000 // Filesystem may have uncompacted metadata
|
||||||
|
|
||||||
// internally used flags, don't use these
|
// internally used flags, don't use these
|
||||||
#define LFS_I_ORPHANS 0x01000000 // Filesystem may have untracked orphans
|
#define LFS_I_HASORPHANS \
|
||||||
|
0x01000000 // Filesystem may have untracked orphans
|
||||||
|
|
||||||
|
|
||||||
// Block types
|
// Block types
|
||||||
|
|||||||
@@ -4701,7 +4701,7 @@ code = '''
|
|||||||
// we should have cleaned up all grms/orphans
|
// we should have cleaned up all grms/orphans
|
||||||
assert(lfs.grm.mids[0] == -1);
|
assert(lfs.grm.mids[0] == -1);
|
||||||
assert(lfs.grm.mids[1] == -1);
|
assert(lfs.grm.mids[1] == -1);
|
||||||
assert(!(lfs.flags & LFS_I_ORPHANS));
|
assert(!(lfs.flags & LFS_I_HASORPHANS));
|
||||||
|
|
||||||
struct lfs_fsinfo fsinfo;
|
struct lfs_fsinfo fsinfo;
|
||||||
lfsr_fs_stat(&lfs, &fsinfo) => 0;
|
lfsr_fs_stat(&lfs, &fsinfo) => 0;
|
||||||
@@ -4835,7 +4835,7 @@ code = '''
|
|||||||
// we should have cleaned up all grms/orphans
|
// we should have cleaned up all grms/orphans
|
||||||
assert(lfs.grm.mids[0] == -1);
|
assert(lfs.grm.mids[0] == -1);
|
||||||
assert(lfs.grm.mids[1] == -1);
|
assert(lfs.grm.mids[1] == -1);
|
||||||
assert(!(lfs.flags & LFS_I_ORPHANS));
|
assert(!(lfs.flags & LFS_I_HASORPHANS));
|
||||||
|
|
||||||
struct lfs_fsinfo fsinfo;
|
struct lfs_fsinfo fsinfo;
|
||||||
lfsr_fs_stat(&lfs, &fsinfo) => 0;
|
lfsr_fs_stat(&lfs, &fsinfo) => 0;
|
||||||
@@ -4983,7 +4983,7 @@ code = '''
|
|||||||
// we should have cleaned up all grms/orphans
|
// we should have cleaned up all grms/orphans
|
||||||
assert(lfs.grm.mids[0] == -1);
|
assert(lfs.grm.mids[0] == -1);
|
||||||
assert(lfs.grm.mids[1] == -1);
|
assert(lfs.grm.mids[1] == -1);
|
||||||
assert(!(lfs.flags & LFS_I_ORPHANS));
|
assert(!(lfs.flags & LFS_I_HASORPHANS));
|
||||||
|
|
||||||
struct lfs_fsinfo fsinfo;
|
struct lfs_fsinfo fsinfo;
|
||||||
lfsr_fs_stat(&lfs, &fsinfo) => 0;
|
lfsr_fs_stat(&lfs, &fsinfo) => 0;
|
||||||
|
|||||||
@@ -6327,7 +6327,7 @@ code = '''
|
|||||||
// we should have cleaned up all grms/orphans
|
// we should have cleaned up all grms/orphans
|
||||||
assert(lfs.grm.mids[0] == -1);
|
assert(lfs.grm.mids[0] == -1);
|
||||||
assert(lfs.grm.mids[1] == -1);
|
assert(lfs.grm.mids[1] == -1);
|
||||||
assert(!(lfs.flags & LFS_I_ORPHANS));
|
assert(!(lfs.flags & LFS_I_HASORPHANS));
|
||||||
|
|
||||||
// which means there shouldn't be that many files left
|
// which means there shouldn't be that many files left
|
||||||
assert((lfs.mtree.u.weight & 0x7fffffff) <= (2 << lfs.mdir_bits));
|
assert((lfs.mtree.u.weight & 0x7fffffff) <= (2 << lfs.mdir_bits));
|
||||||
@@ -6466,7 +6466,7 @@ code = '''
|
|||||||
assert(lfs.grm.mids[1] == -1);
|
assert(lfs.grm.mids[1] == -1);
|
||||||
// if we introduce actual orphans, me _must not_ clear the orphan flag
|
// if we introduce actual orphans, me _must not_ clear the orphan flag
|
||||||
if (ORPHANS >= 3) {
|
if (ORPHANS >= 3) {
|
||||||
assert(lfs.flags & LFS_I_ORPHANS);
|
assert(lfs.flags & LFS_I_HASORPHANS);
|
||||||
}
|
}
|
||||||
|
|
||||||
// if we introduced actual orphans, we _must_ be marked as inconsistent
|
// if we introduced actual orphans, we _must_ be marked as inconsistent
|
||||||
@@ -6618,7 +6618,7 @@ code = '''
|
|||||||
// we should have cleaned up all grms/orphans
|
// we should have cleaned up all grms/orphans
|
||||||
assert(lfs.grm.mids[0] == -1);
|
assert(lfs.grm.mids[0] == -1);
|
||||||
assert(lfs.grm.mids[1] == -1);
|
assert(lfs.grm.mids[1] == -1);
|
||||||
assert(!(lfs.flags & LFS_I_ORPHANS));
|
assert(!(lfs.flags & LFS_I_HASORPHANS));
|
||||||
|
|
||||||
// which means there shouldn't be that many files left
|
// which means there shouldn't be that many files left
|
||||||
assert((lfs.mtree.u.weight & 0x7fffffff) <= (2 << lfs.mdir_bits));
|
assert((lfs.mtree.u.weight & 0x7fffffff) <= (2 << lfs.mdir_bits));
|
||||||
@@ -6771,7 +6771,7 @@ code = '''
|
|||||||
// we should have cleaned up all grms/orphans
|
// we should have cleaned up all grms/orphans
|
||||||
assert(lfs.grm.mids[0] == -1);
|
assert(lfs.grm.mids[0] == -1);
|
||||||
assert(lfs.grm.mids[1] == -1);
|
assert(lfs.grm.mids[1] == -1);
|
||||||
assert(!(lfs.flags & LFS_I_ORPHANS));
|
assert(!(lfs.flags & LFS_I_HASORPHANS));
|
||||||
|
|
||||||
// which means there shouldn't be that many files left
|
// which means there shouldn't be that many files left
|
||||||
assert((lfs.mtree.u.weight & 0x7fffffff) <= (2 << lfs.mdir_bits));
|
assert((lfs.mtree.u.weight & 0x7fffffff) <= (2 << lfs.mdir_bits));
|
||||||
@@ -6935,7 +6935,7 @@ code = '''
|
|||||||
// we should have cleaned up all grms/orphans
|
// we should have cleaned up all grms/orphans
|
||||||
assert(lfs.grm.mids[0] == -1);
|
assert(lfs.grm.mids[0] == -1);
|
||||||
assert(lfs.grm.mids[1] == -1);
|
assert(lfs.grm.mids[1] == -1);
|
||||||
assert(!(lfs.flags & LFS_I_ORPHANS));
|
assert(!(lfs.flags & LFS_I_HASORPHANS));
|
||||||
|
|
||||||
// which means there shouldn't be that many files left
|
// which means there shouldn't be that many files left
|
||||||
assert((lfs.mtree.u.weight & 0x7fffffff) <= (2 << lfs.mdir_bits));
|
assert((lfs.mtree.u.weight & 0x7fffffff) <= (2 << lfs.mdir_bits));
|
||||||
@@ -7097,7 +7097,7 @@ code = '''
|
|||||||
// we should have cleaned up all grms/orphans
|
// we should have cleaned up all grms/orphans
|
||||||
assert(lfs.grm.mids[0] == -1);
|
assert(lfs.grm.mids[0] == -1);
|
||||||
assert(lfs.grm.mids[1] == -1);
|
assert(lfs.grm.mids[1] == -1);
|
||||||
assert(!(lfs.flags & LFS_I_ORPHANS));
|
assert(!(lfs.flags & LFS_I_HASORPHANS));
|
||||||
|
|
||||||
// which means there shouldn't be that many files left
|
// which means there shouldn't be that many files left
|
||||||
assert((lfs.mtree.u.weight & 0x7fffffff) <= (2 << lfs.mdir_bits));
|
assert((lfs.mtree.u.weight & 0x7fffffff) <= (2 << lfs.mdir_bits));
|
||||||
@@ -7257,7 +7257,7 @@ code = '''
|
|||||||
// we should have cleaned up all grms/orphans
|
// we should have cleaned up all grms/orphans
|
||||||
assert(lfs.grm.mids[0] == -1);
|
assert(lfs.grm.mids[0] == -1);
|
||||||
assert(lfs.grm.mids[1] == -1);
|
assert(lfs.grm.mids[1] == -1);
|
||||||
assert(!(lfs.flags & LFS_I_ORPHANS));
|
assert(!(lfs.flags & LFS_I_HASORPHANS));
|
||||||
|
|
||||||
// which means there shouldn't be that many files left
|
// which means there shouldn't be that many files left
|
||||||
assert((lfs.mtree.u.weight & 0x7fffffff) <= (2 << lfs.mdir_bits));
|
assert((lfs.mtree.u.weight & 0x7fffffff) <= (2 << lfs.mdir_bits));
|
||||||
@@ -7445,7 +7445,7 @@ code = '''
|
|||||||
assert(lfs.grm.mids[1] == -1);
|
assert(lfs.grm.mids[1] == -1);
|
||||||
// if we introduce actual orphans, me _must not_ clear the orphan flag
|
// if we introduce actual orphans, me _must not_ clear the orphan flag
|
||||||
if (ORPHANS >= 3) {
|
if (ORPHANS >= 3) {
|
||||||
assert(lfs.flags & LFS_I_ORPHANS);
|
assert(lfs.flags & LFS_I_HASORPHANS);
|
||||||
}
|
}
|
||||||
|
|
||||||
// mdirs should have been compacted
|
// mdirs should have been compacted
|
||||||
|
|||||||
Reference in New Issue
Block a user