bcachefs-tools: update to 1.3.3.
This commit is contained in:
parent
505fb1cc66
commit
ebb38b5153
2 changed files with 67 additions and 24 deletions
|
@ -1,42 +1,85 @@
|
||||||
mount(2) takes an unsigned long parameter, which is not u64 on 32-bit
|
From f2b987745d46e763c63f47ae843d28684041fa48 Mon Sep 17 00:00:00 2001
|
||||||
architectures.
|
From: Nicholas Sielicki <linux@opensource.nslick.com>
|
||||||
|
Date: Wed, 18 Oct 2023 00:59:02 -0500
|
||||||
|
Subject: [PATCH 1/2] 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>
|
||||||
|
---
|
||||||
|
rust-src/src/cmd_mount.rs | 4 ++--
|
||||||
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/rust-src/src/cmd_mount.rs b/rust-src/src/cmd_mount.rs
|
||||||
|
index bb23c1a1..f7c6d920 100644
|
||||||
--- a/rust-src/src/cmd_mount.rs
|
--- a/rust-src/src/cmd_mount.rs
|
||||||
+++ b/rust-src/src/cmd_mount.rs
|
+++ b/rust-src/src/cmd_mount.rs
|
||||||
@@ -7,14 +7,14 @@
|
@@ -14,7 +14,7 @@ fn mount_inner(
|
||||||
use crate::key;
|
|
||||||
use crate::key::KeyLoc;
|
|
||||||
use crate::logger::SimpleLogger;
|
|
||||||
-use std::ffi::{CStr, CString, OsStr, c_int, c_char, c_void};
|
|
||||||
+use std::ffi::{CStr, CString, OsStr, c_int, c_char, c_ulong, c_void};
|
|
||||||
use std::os::unix::ffi::OsStrExt;
|
|
||||||
|
|
||||||
fn mount_inner(
|
|
||||||
src: String,
|
src: String,
|
||||||
target: impl AsRef<std::path::Path>,
|
target: impl AsRef<std::path::Path>,
|
||||||
fstype: &str,
|
fstype: &str,
|
||||||
- mountflags: u64,
|
- mountflags: u64,
|
||||||
+ mountflags: c_ulong,
|
+ mountflags: libc::c_ulong,
|
||||||
data: Option<String>,
|
data: Option<String>,
|
||||||
) -> anyhow::Result<()> {
|
) -> anyhow::Result<()> {
|
||||||
|
|
||||||
@@ -45,7 +45,7 @@
|
@@ -45,7 +45,7 @@ fn mount_inner(
|
||||||
|
|
||||||
/// Parse a comma-separated mount options and split out mountflags and filesystem
|
/// Parse a comma-separated mount options and split out mountflags and filesystem
|
||||||
/// specific options.
|
/// specific options.
|
||||||
-fn parse_mount_options(options: impl AsRef<str>) -> (Option<String>, u64) {
|
-fn parse_mount_options(options: impl AsRef<str>) -> (Option<String>, u64) {
|
||||||
+fn parse_mount_options(options: impl AsRef<str>) -> (Option<String>, c_ulong) {
|
+fn parse_mount_options(options: impl AsRef<str>) -> (Option<String>, libc::c_ulong) {
|
||||||
use either::Either::*;
|
use either::Either::*;
|
||||||
debug!("parsing mount options: {}", options.as_ref());
|
debug!("parsing mount options: {}", options.as_ref());
|
||||||
let (opts, flags) = options
|
let (opts, flags) = options
|
||||||
|
|
||||||
|
From 8369be0fcdfb796ec63cd91f03103b35f168d2eb Mon Sep 17 00:00:00 2001
|
||||||
|
From: Nicholas Sielicki <linux@opensource.nslick.com>
|
||||||
|
Date: Wed, 18 Oct 2023 23:39:04 -0500
|
||||||
|
Subject: [PATCH 2/2] btree_write_buffer: ensure atomic64_sub_return_release
|
||||||
|
availability
|
||||||
|
|
||||||
|
prior to this patch, on certain platforms (ie: armv7l), compilation fails due
|
||||||
|
to atomic64_sub_return_release not being defined here. Ensure that the atomics
|
||||||
|
header is pulled in, and ensure that it is available in all cases, regardless
|
||||||
|
of whether ATOMIC64_SPINLOCK is defined.
|
||||||
|
|
||||||
|
Signed-off-by: Nicholas Sielicki <linux@opensource.nslick.com>
|
||||||
|
---
|
||||||
|
include/linux/atomic.h | 6 ++++++
|
||||||
|
libbcachefs/btree_write_buffer.c | 1 +
|
||||||
|
2 files changed, 7 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/include/linux/atomic.h b/include/linux/atomic.h
|
||||||
|
index f4d047c1..dfaa3711 100644
|
||||||
|
--- a/include/linux/atomic.h
|
||||||
|
+++ b/include/linux/atomic.h
|
||||||
|
@@ -318,6 +318,12 @@ static inline s64 atomic64_cmpxchg_acquire(atomic64_t *v, s64 old, s64 new)
|
||||||
|
return atomic64_cmpxchg(v, old, new);
|
||||||
|
}
|
||||||
|
|
||||||
|
+static inline s64 atomic64_sub_return_release(s64 i, atomic64_t *v)
|
||||||
|
+{
|
||||||
|
+ smp_mb__before_atomic();
|
||||||
|
+ return atomic64_sub_return(i, v);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* __TOOLS_LINUX_ATOMIC_H */
|
||||||
|
diff --git a/libbcachefs/btree_write_buffer.c b/libbcachefs/btree_write_buffer.c
|
||||||
|
index 4e6241db..76b6f2dc 100644
|
||||||
--- a/libbcachefs/btree_write_buffer.c
|
--- a/libbcachefs/btree_write_buffer.c
|
||||||
+++ b/libbcachefs/btree_write_buffer.c
|
+++ b/libbcachefs/btree_write_buffer.c
|
||||||
@@ -340,7 +340,7 @@
|
@@ -9,6 +9,7 @@
|
||||||
bch2_journal_pin_add(&c->journal, trans->journal_res.seq, &wb->journal_pin,
|
#include "journal.h"
|
||||||
bch2_btree_write_buffer_journal_flush);
|
#include "journal_reclaim.h"
|
||||||
|
|
||||||
- atomic64_sub_return_release(btree_write_buffer_ref(new.idx), &wb->state.counter);
|
+#include <linux/atomic.h>
|
||||||
+ atomic64_sub_return(btree_write_buffer_ref(new.idx), &wb->state.counter);
|
#include <linux/sort.h>
|
||||||
out:
|
|
||||||
preempt_enable();
|
static int btree_write_buffered_key_cmp(const void *_l, const void *_r)
|
||||||
return ret;
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# Template file for 'bcachefs-tools'
|
# Template file for 'bcachefs-tools'
|
||||||
pkgname=bcachefs-tools
|
pkgname=bcachefs-tools
|
||||||
reverts="24_1"
|
reverts="24_1"
|
||||||
version=1.3.1
|
version=1.3.3
|
||||||
revision=1
|
revision=1
|
||||||
build_style=gnu-makefile
|
build_style=gnu-makefile
|
||||||
make_install_args="ROOT_SBINDIR=/usr/bin"
|
make_install_args="ROOT_SBINDIR=/usr/bin"
|
||||||
|
@ -15,7 +15,7 @@ maintainer="Leah Neukirchen <leah@vuxu.org>"
|
||||||
license="GPL-2.0-only"
|
license="GPL-2.0-only"
|
||||||
homepage="https://bcachefs.org/"
|
homepage="https://bcachefs.org/"
|
||||||
distfiles="https://github.com/koverstreet/bcachefs-tools/archive/refs/tags/v${version}.tar.gz"
|
distfiles="https://github.com/koverstreet/bcachefs-tools/archive/refs/tags/v${version}.tar.gz"
|
||||||
checksum=864899c262e5021e31e3b861936276831a1fa3f48ff70551392e2134e1dcd400
|
checksum=8561fc1b736e1fc8057c65e330e4c22f1b5642ebfba6b170dc49204eee496e23
|
||||||
|
|
||||||
export VERSION=v${version}
|
export VERSION=v${version}
|
||||||
export RUST_TARGET
|
export RUST_TARGET
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue