From 204abb9c5d9655d33fe567adaf3720205a84fc57 Mon Sep 17 00:00:00 2001 From: Yousef Moazzam Date: Sat, 24 May 2025 21:22:54 +0100 Subject: [PATCH 1/3] Add node type bits info to node mode docstrings --- src/node.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/node.rs b/src/node.rs index b2566a37e4..2963ab2d3a 100644 --- a/src/node.rs +++ b/src/node.rs @@ -89,7 +89,7 @@ type BlockListL4 = BlockList; #[repr(C, packed)] pub struct Node { /// This node's type & permissions. - /// - first four bits are permissions + /// - first four bits are the node's type /// - next four bits are permissions for the file's user /// - next four bits are permissions for the file's group /// - last four bits are permissions for everyone else @@ -223,7 +223,7 @@ impl Node { } /// This node's type & permissions. - /// - first four bits are permissions + /// - first four bits are the node's type /// - next four bits are permissions for the file's user /// - next four bits are permissions for the file's group /// - last four bits are permissions for everyone else From 13642ab159eb6b7ecc7682f1861d994d612f0c2b Mon Sep 17 00:00:00 2001 From: Yousef Moazzam Date: Sat, 24 May 2025 21:29:14 +0100 Subject: [PATCH 2/3] Clarify bit position using most/least significant bit terminology --- src/node.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/node.rs b/src/node.rs index 2963ab2d3a..0449557bc1 100644 --- a/src/node.rs +++ b/src/node.rs @@ -89,10 +89,10 @@ type BlockListL4 = BlockList; #[repr(C, packed)] pub struct Node { /// This node's type & permissions. - /// - first four bits are the node's type + /// - four most significant bits are the node's type /// - next four bits are permissions for the file's user /// - next four bits are permissions for the file's group - /// - last four bits are permissions for everyone else + /// - four least significant bits are permissions for everyone else pub mode: Le, /// The uid that owns this file @@ -223,10 +223,10 @@ impl Node { } /// This node's type & permissions. - /// - first four bits are the node's type + /// - four most significant bits are the node's type /// - next four bits are permissions for the file's user /// - next four bits are permissions for the file's group - /// - last four bits are permissions for everyone else + /// - four least significant bits are permissions for everyone else pub fn mode(&self) -> u16 { self.mode.to_ne() } From 3d06dd39ba9afc319fe537671247bb581a3b63a5 Mon Sep 17 00:00:00 2001 From: Yousef Moazzam Date: Sat, 24 May 2025 21:56:30 +0100 Subject: [PATCH 3/3] Refer to "node" rather than "file" in node mode docstrings --- src/node.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/node.rs b/src/node.rs index 0449557bc1..b2c2426497 100644 --- a/src/node.rs +++ b/src/node.rs @@ -90,8 +90,8 @@ type BlockListL4 = BlockList; pub struct Node { /// This node's type & permissions. /// - four most significant bits are the node's type - /// - next four bits are permissions for the file's user - /// - next four bits are permissions for the file's group + /// - next four bits are permissions for the node's user + /// - next four bits are permissions for the node's group /// - four least significant bits are permissions for everyone else pub mode: Le, @@ -224,8 +224,8 @@ impl Node { /// This node's type & permissions. /// - four most significant bits are the node's type - /// - next four bits are permissions for the file's user - /// - next four bits are permissions for the file's group + /// - next four bits are permissions for the node's user + /// - next four bits are permissions for the node's group /// - four least significant bits are permissions for everyone else pub fn mode(&self) -> u16 { self.mode.to_ne()