Skip to content

Commit

Permalink
Update bcachefs sources to bc01863fb6ef bcachefs: bcachefs_metadata_v…
Browse files Browse the repository at this point in the history
…ersion_disk_accounting_big_endian

Signed-off-by: Kent Overstreet <[email protected]>
  • Loading branch information
Kent Overstreet committed Nov 30, 2024
1 parent 6829fb2 commit de51418
Show file tree
Hide file tree
Showing 125 changed files with 4,508 additions and 2,939 deletions.
2 changes: 1 addition & 1 deletion .bcachefs_revision
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1dbc147a6eb08a0137a81a1fe4eb528186594bfe
bc01863fb6eff06f7b028e4c5cd8850d21d7f10d
14 changes: 7 additions & 7 deletions Makefile.compiler
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,11 @@ cc-option = $(call __cc-option, $(CC),\

# cc-option-yn
# Usage: flag := $(call cc-option-yn,-march=winchip-c6)
cc-option-yn = $(call try-run,\
$(CC) -Werror $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",y,n)
cc-option-yn = $(if $(call cc-option,$1),y,n)

# cc-disable-warning
# Usage: cflags-y += $(call cc-disable-warning,unused-but-set-variable)
cc-disable-warning = $(call try-run,\
$(CC) -Werror $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) -W$(strip $(1)) -c -x c /dev/null -o "$$TMP",-Wno-$(strip $(1)))
cc-disable-warning = $(if $(call cc-option,-W$(strip $1)),-Wno-$(strip $1))

# gcc-min-version
# Usage: cflags-$(call gcc-min-version, 70100) += -foo
Expand All @@ -75,8 +73,11 @@ ld-option = $(call try-run, $(LD) $(KBUILD_LDFLAGS) $(1) -v,$(1),$(2),$(3))

# __rustc-option
# Usage: MY_RUSTFLAGS += $(call __rustc-option,$(RUSTC),$(MY_RUSTFLAGS),-Cinstrument-coverage,-Zinstrument-coverage)
# TODO: remove RUSTC_BOOTSTRAP=1 when we raise the minimum GNU Make version to 4.4
__rustc-option = $(call try-run,\
$(1) $(2) $(3) --crate-type=rlib /dev/null --out-dir=$$TMPOUT -o "$$TMP",$(3),$(4))
echo '#![allow(missing_docs)]#![feature(no_core)]#![no_core]' | RUSTC_BOOTSTRAP=1\
$(1) --sysroot=/dev/null $(filter-out --sysroot=/dev/null,$(2)) $(3)\
--crate-type=rlib --out-dir=$(TMPOUT) --emit=obj=- - >/dev/null,$(3),$(4))

# rustc-option
# Usage: rustflags-y += $(call rustc-option,-Cinstrument-coverage,-Zinstrument-coverage)
Expand All @@ -85,5 +86,4 @@ rustc-option = $(call __rustc-option, $(RUSTC),\

# rustc-option-yn
# Usage: flag := $(call rustc-option-yn,-Cinstrument-coverage)
rustc-option-yn = $(call try-run,\
$(RUSTC) $(KBUILD_RUSTFLAGS) $(1) --crate-type=rlib /dev/null --out-dir=$$TMPOUT -o "$$TMP",y,n)
rustc-option-yn = $(if $(call rustc-option,$1),y,n)
6 changes: 3 additions & 3 deletions bch_bindgen/src/btree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ impl<'t> BtreeIter<'t> {
}
}

pub fn peek_upto<'i>(&'i mut self, end: c::bpos) -> Result<Option<BkeySC<'i>>, bch_errcode> {
pub fn peek_max<'i>(&'i mut self, end: c::bpos) -> Result<Option<BkeySC<'i>>, bch_errcode> {
unsafe {
let k = c::bch2_btree_iter_peek_upto(&mut self.raw, end);
let k = c::bch2_btree_iter_peek_max(&mut self.raw, end);
errptr_to_result_c(k.k).map(|_| {
if !k.k.is_null() {
Some(BkeySC {
Expand All @@ -99,7 +99,7 @@ impl<'t> BtreeIter<'t> {
}

pub fn peek(&mut self) -> Result<Option<BkeySC>, bch_errcode> {
self.peek_upto(SPOS_MAX)
self.peek_max(SPOS_MAX)
}

pub fn peek_and_restart(&mut self) -> Result<Option<BkeySC>, bch_errcode> {
Expand Down
20 changes: 20 additions & 0 deletions include/linux/fs_parser.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
/* Filesystem parameter description and parser
*
* Copyright (C) 2018 Red Hat, Inc. All Rights Reserved.
* Written by David Howells ([email protected])
*/

#ifndef _LINUX_FS_PARSER_H
#define _LINUX_FS_PARSER_H

struct constant_table {
const char *name;
int value;
};

extern int lookup_constant(const struct constant_table tbl[], const char *name, int not_found);

extern const struct constant_table bool_names[];

#endif /* _LINUX_FS_PARSER_H */
85 changes: 85 additions & 0 deletions include/linux/string_choices.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _LINUX_STRING_CHOICES_H_
#define _LINUX_STRING_CHOICES_H_

/*
* Here provide a series of helpers in the str_$TRUE_$FALSE format (you can
* also expand some helpers as needed), where $TRUE and $FALSE are their
* corresponding literal strings. These helpers can be used in the printing
* and also in other places where constant strings are required. Using these
* helpers offers the following benefits:
* 1) Reducing the hardcoding of strings, which makes the code more elegant
* through these simple literal-meaning helpers.
* 2) Unifying the output, which prevents the same string from being printed
* in various forms, such as enable/disable, enabled/disabled, en/dis.
* 3) Deduping by the linker, which results in a smaller binary file.
*/

#include <linux/types.h>

static inline const char *str_enable_disable(bool v)
{
return v ? "enable" : "disable";
}
#define str_disable_enable(v) str_enable_disable(!(v))

static inline const char *str_enabled_disabled(bool v)
{
return v ? "enabled" : "disabled";
}
#define str_disabled_enabled(v) str_enabled_disabled(!(v))

static inline const char *str_hi_lo(bool v)
{
return v ? "hi" : "lo";
}
#define str_lo_hi(v) str_hi_lo(!(v))

static inline const char *str_high_low(bool v)
{
return v ? "high" : "low";
}
#define str_low_high(v) str_high_low(!(v))

static inline const char *str_read_write(bool v)
{
return v ? "read" : "write";
}
#define str_write_read(v) str_read_write(!(v))

static inline const char *str_on_off(bool v)
{
return v ? "on" : "off";
}
#define str_off_on(v) str_on_off(!(v))

static inline const char *str_yes_no(bool v)
{
return v ? "yes" : "no";
}
#define str_no_yes(v) str_yes_no(!(v))

static inline const char *str_up_down(bool v)
{
return v ? "up" : "down";
}
#define str_down_up(v) str_up_down(!(v))

static inline const char *str_true_false(bool v)
{
return v ? "true" : "false";
}
#define str_false_true(v) str_true_false(!(v))

/**
* str_plural - Return the simple pluralization based on English counts
* @num: Number used for deciding pluralization
*
* If @num is 1, returns empty string, otherwise returns "s".
*/
static inline const char *str_plural(size_t num)
{
return num == 1 ? "" : "s";
}

#endif
1 change: 1 addition & 0 deletions include/linux/unaligned.h
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include <asm/unaligned.h>
Loading

0 comments on commit de51418

Please sign in to comment.