mirror of
https://github.com/fiatjaf/nak.git
synced 2025-12-09 17:18:50 +00:00
fs: deterministic inode numbers.
This commit is contained in:
@@ -42,7 +42,7 @@ func CreateEventDir(
|
|||||||
h := parent.EmbeddedInode().NewPersistentInode(
|
h := parent.EmbeddedInode().NewPersistentInode(
|
||||||
ctx,
|
ctx,
|
||||||
&EventDir{ctx: ctx, evt: event},
|
&EventDir{ctx: ctx, evt: event},
|
||||||
fs.StableAttr{Mode: syscall.S_IFDIR},
|
fs.StableAttr{Mode: syscall.S_IFDIR, Ino: hexToUint64(event.ID)},
|
||||||
)
|
)
|
||||||
|
|
||||||
eventj, _ := easyjson.Marshal(event)
|
eventj, _ := easyjson.Marshal(event)
|
||||||
|
|||||||
@@ -3,6 +3,6 @@ package nostrfs
|
|||||||
import "strconv"
|
import "strconv"
|
||||||
|
|
||||||
func hexToUint64(hexStr string) uint64 {
|
func hexToUint64(hexStr string) uint64 {
|
||||||
v, _ := strconv.ParseUint(hexStr[0:16], 16, 64)
|
v, _ := strconv.ParseUint(hexStr[16:32], 16, 64)
|
||||||
return v
|
return v
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ func CreateNpubDir(ctx context.Context, sys *sdk.System, parent fs.InodeEmbedder
|
|||||||
return parent.EmbeddedInode().NewPersistentInode(
|
return parent.EmbeddedInode().NewPersistentInode(
|
||||||
ctx,
|
ctx,
|
||||||
npubdir,
|
npubdir,
|
||||||
fs.StableAttr{Mode: syscall.S_IFDIR},
|
fs.StableAttr{Mode: syscall.S_IFDIR, Ino: hexToUint64(pointer.PublicKey)},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user