summaryrefslogtreecommitdiff
path: root/bch_bindgen/src/bcachefs.rs
diff options
context:
space:
mode:
authorTony Asleson <tasleson@redhat.com>2024-05-01 15:48:57 -0500
committerTony Asleson <tasleson@redhat.com>2024-05-07 12:20:49 -0500
commit3d63b901c6217a0ea7f169f5e4c66ca1d4ea1088 (patch)
tree668e1deffb390778377e78137b67896847342685 /bch_bindgen/src/bcachefs.rs
parent761ef99f91774591495e2cded7b5d44c059bcd5d (diff)
Handle mount with FS with 1 device
If the user passes a single device node during the mount and we have no information for it in the udev db, we read up the super block. When we do this, if the FS only has 1 block device we will simply go ahead and do the mount instead of walking all the block devices and reading up super blocks looking for devices with a matching FS UUID. Signed-off-by: Tony Asleson <tasleson@redhat.com>
Diffstat (limited to 'bch_bindgen/src/bcachefs.rs')
-rw-r--r--bch_bindgen/src/bcachefs.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/bch_bindgen/src/bcachefs.rs b/bch_bindgen/src/bcachefs.rs
index 837b0272..7b8a03df 100644
--- a/bch_bindgen/src/bcachefs.rs
+++ b/bch_bindgen/src/bcachefs.rs
@@ -59,6 +59,10 @@ impl bch_sb {
uuid::Uuid::from_bytes(self.user_uuid.b)
}
+ pub fn number_of_devices(&self) -> u8 {
+ self.nr_devices
+ }
+
/// Get the nonce used to encrypt the superblock
pub fn nonce(&self) -> nonce {
use byteorder::{LittleEndian, ReadBytesExt};