summaryrefslogtreecommitdiff
path: root/lib/btrfs/btrfsitem/item_dir.go
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2023-03-17 18:38:14 -0400
committerLuke Shumaker <lukeshu@lukeshu.com>2023-03-17 18:38:14 -0400
commit0f85e72d1331b49b52925d6cc5ad083a0376104c (patch)
tree9ba66e893d6f66096f6b06284d09c8eb3e50facc /lib/btrfs/btrfsitem/item_dir.go
parentc0f33186aa7a8903c5e7406024f13fad48cd14e3 (diff)
parent1ea26f04701fa66e36b058f3efb3a6c7059cdc5c (diff)
Merge branch 'lukeshu/lint'
Diffstat (limited to 'lib/btrfs/btrfsitem/item_dir.go')
-rw-r--r--lib/btrfs/btrfsitem/item_dir.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/btrfs/btrfsitem/item_dir.go b/lib/btrfs/btrfsitem/item_dir.go
index c1b3c09..cd16d57 100644
--- a/lib/btrfs/btrfsitem/item_dir.go
+++ b/lib/btrfs/btrfsitem/item_dir.go
@@ -19,10 +19,14 @@ func NameHash(dat []byte) uint64 {
return uint64(^crc32.Update(1, crc32.MakeTable(crc32.Castagnoli), dat))
}
-// key.objectid = inode of directory containing this entry
-// key.offset =
-// - for DIR_ITEM and XATTR_ITEM = NameHash(name)
-// - for DIR_INDEX = index id in the directory (starting at 2, because "." and "..")
+// A DirEntry is an member of a directory.
+//
+// Key:
+//
+// key.objectid = inode of directory containing this entry
+// key.offset = one of:
+// - for DIR_ITEM and XATTR_ITEM = NameHash(name)
+// - for DIR_INDEX = index id in the directory (starting at 2, because of "." and "..")
type DirEntry struct { // complex DIR_ITEM=84 DIR_INDEX=96 XATTR_ITEM=24
Location btrfsprim.Key `bin:"off=0x0, siz=0x11"`
TransID int64 `bin:"off=0x11, siz=8"`