From c3c7dacab2eb9922c80a965b3d9f175bc98b1916 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Wed, 29 May 2024 17:00:50 -0400 Subject: [PATCH] mount: minor cleanup Signed-off-by: Kent Overstreet --- src/commands/mount.rs | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/src/commands/mount.rs b/src/commands/mount.rs index f8edf9bc..474f58ff 100644 --- a/src/commands/mount.rs +++ b/src/commands/mount.rs @@ -86,20 +86,6 @@ fn parse_mount_options(options: impl AsRef) -> (Option, libc::c_ulo ) } -fn do_mount( - device: String, - target: impl AsRef, - options: impl AsRef, -) -> anyhow::Result<()> { - let (data, mountflags) = parse_mount_options(options); - - info!( - "mounting bcachefs filesystem, {}", - target.as_ref().display() - ); - mount_inner(device, target, "bcachefs", mountflags, data) -} - fn read_super_silent(path: impl AsRef) -> anyhow::Result { let mut opts = bcachefs::bch_opts::default(); opt_set!(opts, noexcl, 1); @@ -394,15 +380,16 @@ fn cmd_mount_inner(opt: Cli) -> anyhow::Result<()> { &opt.options ); - do_mount(devices, mountpoint, &opt.options)?; + let (data, mountflags) = parse_mount_options(&opt.options); + mount_inner(devices, mountpoint, "bcachefs", mountflags, data) } else { info!( "would mount with params: device: {}, options: {}", devices, &opt.options ); - } - Ok(()) + Ok(()) + } } pub fn mount(mut argv: Vec, symlink_cmd: Option<&str>) -> i32 {