]> git.sesse.net Git - bcachefs-tools-debian/commitdiff
rust: mount: use libc::c_ulong for flags
authorNicholas Sielicki <linux@opensource.nslick.com>
Wed, 18 Oct 2023 05:59:02 +0000 (00:59 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Wed, 8 Nov 2023 16:32:36 +0000 (11:32 -0500)
libc proper treats mount flags as an unsigned long, which is usually u64,
except when it isn't. When preparing mount flags, use the libc::c_ulong type
instead of u64 to allow for this.

This fixes compiling this file under armv7l.

Signed-off-by: Nicholas Sielicki <linux@opensource.nslick.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
rust-src/src/cmd_mount.rs

index bb23c1a16bb8426f7f643d87d5c05f2ce5c0e8cb..f7c6d920cfde33e42c4bcea1797f38d16ae3d055 100644 (file)
@@ -14,7 +14,7 @@ fn mount_inner(
     src: String,
     target: impl AsRef<std::path::Path>,
     fstype: &str,
-    mountflags: u64,
+    mountflags: libc::c_ulong,
     data: Option<String>,
 ) -> anyhow::Result<()> {
 
@@ -45,7 +45,7 @@ fn mount_inner(
 
 /// Parse a comma-separated mount options and split out mountflags and filesystem
 /// specific options.
-fn parse_mount_options(options: impl AsRef<str>) -> (Option<String>, u64) {
+fn parse_mount_options(options: impl AsRef<str>) -> (Option<String>, libc::c_ulong) {
     use either::Either::*;
     debug!("parsing mount options: {}", options.as_ref());
     let (opts, flags) = options