commit
4e7986f303
@ -0,0 +1,56 @@
|
|||||||
|
From d7ea03257825c173fcd4b8eed26fb177f638bfb3 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Fabio Valentini <decathorpe@gmail.com>
|
||||||
|
Date: Mon, 9 Oct 2023 01:33:38 +0200
|
||||||
|
Subject: [PATCH] Disambiguate num::Integer::div_ceil from <number>::div_ceil
|
||||||
|
|
||||||
|
---
|
||||||
|
src/bench.rs | 2 +-
|
||||||
|
src/hasher.rs | 4 ++--
|
||||||
|
src/testfiles.rs | 2 +-
|
||||||
|
3 files changed, 4 insertions(+), 4 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/bench.rs b/src/bench.rs
|
||||||
|
index 85603a8..5092a41 100644
|
||||||
|
--- a/src/bench.rs
|
||||||
|
+++ b/src/bench.rs
|
||||||
|
@@ -649,7 +649,7 @@ impl Bench {
|
||||||
|
fn time_hash(size: usize, params: &Params, tf: &TestFiles) -> f64 {
|
||||||
|
let mut hasher = hasher::Hasher::new(1.0, 0.0);
|
||||||
|
let chunk_size = params.chunk_pages * *PAGE_SIZE;
|
||||||
|
- let chunks_per_unit = (tf.unit_size as usize).div_ceil(&chunk_size);
|
||||||
|
+ let chunks_per_unit = Integer::div_ceil(&(tf.unit_size as usize), &chunk_size);
|
||||||
|
|
||||||
|
let started_at = Instant::now();
|
||||||
|
|
||||||
|
diff --git a/src/hasher.rs b/src/hasher.rs
|
||||||
|
index 6ee2084..7e5d3e5 100644
|
||||||
|
--- a/src/hasher.rs
|
||||||
|
+++ b/src/hasher.rs
|
||||||
|
@@ -580,9 +580,9 @@ impl DispatchThread {
|
||||||
|
// determined by each hash worker to avoid overloading the
|
||||||
|
// dispatch thread.
|
||||||
|
let file_size = self.file_size_normal.sample(&mut rng).round() as usize;
|
||||||
|
- let file_nr_chunks = file_size.div_ceil(&chunk_size).max(1);
|
||||||
|
+ let file_nr_chunks = Integer::div_ceil(&file_size, &chunk_size).max(1);
|
||||||
|
let anon_size = self.anon_size_normal.sample(&mut rng).round() as usize;
|
||||||
|
- let anon_nr_chunks = anon_size.div_ceil(&chunk_size);
|
||||||
|
+ let anon_nr_chunks = Integer::div_ceil(&anon_size, &chunk_size);
|
||||||
|
|
||||||
|
let hasher_thread = HasherThread {
|
||||||
|
tf: self.tf.clone(),
|
||||||
|
diff --git a/src/testfiles.rs b/src/testfiles.rs
|
||||||
|
index 28e046a..b7dc555 100644
|
||||||
|
--- a/src/testfiles.rs
|
||||||
|
+++ b/src/testfiles.rs
|
||||||
|
@@ -34,7 +34,7 @@ impl TestFiles {
|
||||||
|
base_path: PathBuf::from(base_path.as_ref()),
|
||||||
|
unit_size,
|
||||||
|
size,
|
||||||
|
- nr_files: size.div_ceil(&unit_size),
|
||||||
|
+ nr_files: Integer::div_ceil(&size, &unit_size),
|
||||||
|
comp,
|
||||||
|
prefix: String::from(DFL_PREFIX),
|
||||||
|
}
|
||||||
|
--
|
||||||
|
2.41.0
|
||||||
|
|
@ -0,0 +1,30 @@
|
|||||||
|
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,
|
||||||
|
)
|
||||||
|
};
|
Binary file not shown.
@ -0,0 +1,110 @@
|
|||||||
|
## START: Set by rpmautospec
|
||||||
|
## (rpmautospec version 0.3.5)
|
||||||
|
## RPMAUTOSPEC: autorelease, autochangelog
|
||||||
|
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
|
||||||
|
release_number = 10;
|
||||||
|
base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
|
||||||
|
print(release_number + base_release_number - 1);
|
||||||
|
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
|
||||||
|
## END: Set by rpmautospec
|
||||||
|
|
||||||
|
# Generated by rust2rpm 24
|
||||||
|
%bcond_without check
|
||||||
|
|
||||||
|
%global crate rd-hashd
|
||||||
|
|
||||||
|
Name: rust-rd-hashd
|
||||||
|
Version: 2.1.2
|
||||||
|
Release: %autorelease
|
||||||
|
Summary: Latency-sensitive pseudo workload for resctl-demo
|
||||||
|
|
||||||
|
License: Apache-2.0
|
||||||
|
URL: https://crates.io/crates/rd-hashd
|
||||||
|
Source: %{crates_source}
|
||||||
|
# hashd: build fix for 32bit archs
|
||||||
|
Patch0: https://github.com/facebookexperimental/resctl-demo/commit/dbe5735bdf005a24e54dd19559016a59f6f43536.patch
|
||||||
|
# * fix builds with Rust 1.73+ caused by ambiguous <number>::div_ceil calls
|
||||||
|
Patch1: 0001-Disambiguate-num-Integer-div_ceil-from-number-div_ce.patch
|
||||||
|
|
||||||
|
BuildRequires: rust-packaging >= 23
|
||||||
|
|
||||||
|
%global _description %{expand:
|
||||||
|
Latency-sensitive pseudo workload for resctl-demo.}
|
||||||
|
|
||||||
|
%description %{_description}
|
||||||
|
|
||||||
|
%package -n %{crate}
|
||||||
|
Summary: %{summary}
|
||||||
|
# (MIT OR Apache-2.0) AND Unicode-DFS-2016
|
||||||
|
# Apache-2.0
|
||||||
|
# Apache-2.0 OR BSL-1.0
|
||||||
|
# BSD-3-Clause
|
||||||
|
# MIT
|
||||||
|
# MIT OR Apache-2.0
|
||||||
|
# Unlicense OR MIT
|
||||||
|
License: Apache-2.0 AND BSD-3-Clause AND MIT AND Unicode-DFS-2016 AND (Apache-2.0 OR BSL-1.0) AND (MIT OR Apache-2.0) AND (Unlicense OR MIT)
|
||||||
|
# LICENSE.dependencies contains a full license breakdown
|
||||||
|
|
||||||
|
%description -n %{crate} %{_description}
|
||||||
|
|
||||||
|
%files -n %{crate}
|
||||||
|
%license LICENSE
|
||||||
|
%license LICENSE.dependencies
|
||||||
|
%doc README.md
|
||||||
|
%{_bindir}/rd-hashd
|
||||||
|
|
||||||
|
%prep
|
||||||
|
%autosetup -n %{crate}-%{version_no_tilde} -N
|
||||||
|
%patch -P0 -p2
|
||||||
|
%patch -P1 -p1
|
||||||
|
%cargo_prep
|
||||||
|
|
||||||
|
%generate_buildrequires
|
||||||
|
%cargo_generate_buildrequires
|
||||||
|
|
||||||
|
%build
|
||||||
|
%cargo_build
|
||||||
|
%{cargo_license_summary}
|
||||||
|
%{cargo_license} > LICENSE.dependencies
|
||||||
|
|
||||||
|
%install
|
||||||
|
%cargo_install
|
||||||
|
|
||||||
|
%if %{with check}
|
||||||
|
%check
|
||||||
|
%cargo_test
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%changelog
|
||||||
|
* Mon Jan 15 2024 Arkady L. Shane <tigro@msvsphere-os.ru> - 2.1.2-10
|
||||||
|
- Rebuilt for MSVSphere 9.3
|
||||||
|
|
||||||
|
* Sun Oct 08 2023 Fabio Valentini <decathorpe@gmail.com> - 2.1.2-10
|
||||||
|
- Fix builds with Rust 1.73+ caused by ambiguous <number>::div_ceil calls
|
||||||
|
|
||||||
|
* Mon Aug 07 2023 Fabio Valentini <decathorpe@gmail.com> - 2.1.2-9
|
||||||
|
- Regenerate with rust2rpm v24
|
||||||
|
|
||||||
|
* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.2-8
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
|
||||||
|
|
||||||
|
* Sat Jan 28 2023 Fabio Valentini <decathorpe@gmail.com> - 2.1.2-7
|
||||||
|
- Rebuild for CVE-2022-24765 and CVE-2022-29187 in libgit2
|
||||||
|
|
||||||
|
* Sat Jan 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.2-6
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
|
||||||
|
|
||||||
|
* Sat Jul 23 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.2-5
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
|
||||||
|
|
||||||
|
* Tue Feb 15 2022 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 2.1.2-4
|
||||||
|
- Rebuild with package notes
|
||||||
|
|
||||||
|
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.2-3
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
|
||||||
|
|
||||||
|
* Fri Oct 22 2021 Davide Cavalca <dcavalca@fedoraproject.org> - 2.1.2-2
|
||||||
|
- Build for epel8
|
||||||
|
|
||||||
|
* Thu Oct 21 2021 Davide Cavalca <dcavalca@fedoraproject.org> - 2.1.2-1
|
||||||
|
- Initial import; Fixes: RHBZ#1990927
|
Loading…
Reference in new issue