diff options
author | Jakob Unterwurzacher | 2024-05-05 22:25:19 +0200 |
---|---|---|
committer | Jakob Unterwurzacher | 2024-05-05 22:25:19 +0200 |
commit | 5a2d4614ed75d4b32e0f45e93a225f8e1b7350c9 (patch) | |
tree | 3cc283b48d0d0361722c68b497f19705d5aa3f31 /internal/inomap/inomap_test.go | |
parent | c85c092189df44e9a88ad30c1f91cfc7fbeb4ccb (diff) |
inomap: export NextSpillIno()
This will be used in reverse mode. Switch to atomic increment to avoid
a "nextSpillInoUnlocked" helper.
Diffstat (limited to 'internal/inomap/inomap_test.go')
-rw-r--r-- | internal/inomap/inomap_test.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/internal/inomap/inomap_test.go b/internal/inomap/inomap_test.go index 430ec94..ce5b880 100644 --- a/internal/inomap/inomap_test.go +++ b/internal/inomap/inomap_test.go @@ -107,6 +107,9 @@ func TestSpill(t *testing.T) { if out1&spillBit == 0 { t.Error("spill bit not set") } + if out1 != spillSpaceStart { + t.Errorf("unexpected first spill inode number %d", out1) + } out2 := m.Translate(q) if out2&spillBit == 0 { t.Error("spill bit not set") @@ -114,6 +117,11 @@ func TestSpill(t *testing.T) { if out1 != out2 { t.Errorf("unstable mapping: %d vs %d", out1, out2) } + q.Ino = maxPassthruIno + 2 + out3 := m.Translate(q) + if out3 != out1+1 { + t.Errorf("unexpected 2nd spill inode number %d", out1) + } } // TestUniqueness checks that unique (Dev, Flags, Ino) tuples get unique inode |