You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
rust-rd-hashd/SOURCES/dbe5735bdf005a24e54dd195590...

31 lines
1.0 KiB

From dbe5735bdf005a24e54dd19559016a59f6f43536 Mon Sep 17 00:00:00 2001
From: Tejun Heo <htejun@fb.com>
Date: Wed, 20 Oct 2021 11:10:07 -1000
Subject: [PATCH] hashd: build fix for 32bit archs
---
rd-hashd/src/testfiles.rs | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/rd-hashd/src/testfiles.rs b/rd-hashd/src/testfiles.rs
index 28e046a..c3893b1 100644
--- a/rd-hashd/src/testfiles.rs
+++ b/rd-hashd/src/testfiles.rs
@@ -4,6 +4,7 @@ use log::{debug, trace, warn};
use num::Integer;
use rand::rngs::SmallRng;
use rand::SeedableRng;
+use std::convert::TryInto;
use std::ffi::OsStr;
use std::fs;
use std::io::{Read, Seek, SeekFrom, Write};
@@ -177,7 +178,7 @@ impl TestFiles {
libc::posix_fadvise(
f.as_raw_fd(),
0,
- self.unit_size as i64,
+ self.unit_size.try_into().unwrap(),
libc::POSIX_FADV_DONTNEED,
)
};