summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas Mühlbacher <tmuehlbacher@posteo.net>2024-07-19 23:00:27 +0200
committerThomas Mühlbacher <tmuehlbacher@posteo.net>2024-07-21 01:17:27 +0200
commit7c68f2758d1f274b6cb5a3691aab10c87b78aa26 (patch)
tree72a5ac91c6b026c10dd7786be063c9ff1e16de2d /src
parente218119b013cd98b853bf784e1548663c09c0535 (diff)
style: nix fmt
Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
Diffstat (limited to 'src')
-rw-r--r--src/commands/mount.rs48
1 files changed, 27 insertions, 21 deletions
diff --git a/src/commands/mount.rs b/src/commands/mount.rs
index 0f39214c..b9179e29 100644
--- a/src/commands/mount.rs
+++ b/src/commands/mount.rs
@@ -48,7 +48,10 @@ fn mount_inner(
let err = errno::errno().0;
- if ret == 0 || (err != libc::EACCES && err != libc::EROFS) || (mountflags & libc::MS_RDONLY) != 0 {
+ if ret == 0
+ || (err != libc::EACCES && err != libc::EROFS)
+ || (mountflags & libc::MS_RDONLY) != 0
+ {
break;
}
@@ -333,25 +336,26 @@ fn cmd_mount_inner(cli: &Cli) -> Result<()> {
// Grab the udev information once
let udev_info = udev_bcachefs_info()?;
- let (devices, mut sbs) = if let Some(("UUID" | "OLD_BLKID_UUID", uuid)) = cli.dev.split_once('=') {
- devs_str_sbs_from_uuid(&udev_info, uuid)?
- } else if cli.dev.contains(':') {
- // If the device string contains ":" we will assume the user knows the
- // entire list. If they supply a single device it could be either the FS
- // only has 1 device or it's only 1 of a number of devices which are
- // part of the FS. This appears to be the case when we get called during
- // fstab mount processing and the fstab specifies a UUID.
-
- let sbs = cli
- .dev
- .split(':')
- .map(read_super_silent)
- .collect::<Result<Vec<_>>>()?;
-
- (cli.dev.clone(), sbs)
- } else {
- devs_str_sbs_from_device(&udev_info, Path::new(&cli.dev))?
- };
+ let (devices, mut sbs) =
+ if let Some(("UUID" | "OLD_BLKID_UUID", uuid)) = cli.dev.split_once('=') {
+ devs_str_sbs_from_uuid(&udev_info, uuid)?
+ } else if cli.dev.contains(':') {
+ // If the device string contains ":" we will assume the user knows the
+ // entire list. If they supply a single device it could be either the FS
+ // only has 1 device or it's only 1 of a number of devices which are
+ // part of the FS. This appears to be the case when we get called during
+ // fstab mount processing and the fstab specifies a UUID.
+
+ let sbs = cli
+ .dev
+ .split(':')
+ .map(read_super_silent)
+ .collect::<Result<Vec<_>>>()?;
+
+ (cli.dev.clone(), sbs)
+ } else {
+ devs_str_sbs_from_device(&udev_info, Path::new(&cli.dev))?
+ };
ensure!(!sbs.is_empty(), "No device(s) to mount specified");
@@ -361,7 +365,9 @@ fn cmd_mount_inner(cli: &Cli) -> Result<()> {
}
for sb in &mut sbs {
- unsafe { bch_bindgen::sb_io::bch2_free_super(sb); }
+ unsafe {
+ bch_bindgen::sb_io::bch2_free_super(sb);
+ }
}
drop(sbs);