summaryrefslogtreecommitdiff
path: root/lib/btrfs/btrfsitem/item_dir.go
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2023-03-17 01:46:40 -0400
committerLuke Shumaker <lukeshu@lukeshu.com>2023-03-17 02:51:43 -0400
commitc30c43f3690931218b88680b337d11a57a2fdc45 (patch)
treea682afa37eaa5a5cee8f8b7a587edc7a40372355 /lib/btrfs/btrfsitem/item_dir.go
parente082cfb3b8f8226067078cc410e4997fd1cf14df (diff)
tree-wide: Ensure that all existing type doc comments follow the expected format
This is a notable improvement in the docs for btrfsitem.
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"`