rust: mount: use libc::c_ulong for flags

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>
This commit is contained in:
Nicholas Sielicki 2023-10-18 00:59:02 -05:00 committed by Kent Overstreet
parent 29e27cc492
commit 974d9bf000

View 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