summaryrefslogtreecommitdiff
path: root/include/linux
AgeCommit message (Collapse)Author
2024-01-16Move c_src dirs back to toplevelKent Overstreet
We just wanted c sourcefiles out of the top level, not c source directories. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-01-16move Rust sources to top level, C sources into c_srcThomas Bertschinger
This moves the Rust sources out of rust_src/ and into the top level. Running the bcachefs executable out of the development tree is now: $ ./target/release/bcachefs command or $ cargo run --profile release -- command instead of "./bcachefs command". Building and installing is still: $ make && make install Signed-off-by: Thomas Bertschinger <tahbertschinger@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-01-10kill bd_buffered_fdKent Overstreet
this gets us back down to a single fd for opening block devices, which means we can use O_EXCL. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-01-10kill bd_sync_fdKent Overstreet
not needed with pwritev2(.., RWF_SYNC), and perhaps we can get down to one fd and then use O_EXCL for block devices. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-01-05atomic64_read_acquire() should be inlineKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-01-05linux header updatesKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-01-03Update bcachefs sources to 2a6125decb43 bcachefs: bch_sb_field_downgradeKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-12-29fix missing atomic64_read_acquire on 32 bitKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-12-19fix shrinker_free()Kent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-12-15Update bcachefs sources to 841a95c29f4c bcachefs: fix userspace build errorsKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-12-09bcachefs-tools: Guard the __struct_group() #define in kernel.hChris Webb
Our include/linux/byteorder.h uses the system <asm/byteorder.h> because we don't provide our own in include/asm. This then pulls in system <linux/stddef.h> which defines __struct_group. That definition collides with the unconditional #define __struct_group in our local include/linux/kernel.h, provoking preprocessor warnings. Signed-off-by: Chris Webb <chris@arachsys.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-12-09bcachefs-tools: Use sysinfo(2) directly to implement si_meminfo()Chris Webb
Use a single sysinfo(2) call to fill out struct sysinfo instead of multiple libc sysconf(3) requests, which will only make sysinfo(2) calls internally anyway. This also enables us to access other struct sysinfo fields, not just the three filled-out previously. As we provide our own definition of struct sysinfo in include/linux/mm.h to match the kernel, which is not guaranteed to align with the definition libc provides in <sys/sysinfo.h>, use syscall(SYS_sysinfo, ...) directly instead of the libc wrapper. Signed-off-by: Chris Webb <chris@arachsys.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-12-07fix fallback flex arrayAlexander Fougner
Signed-off-by: Alexander Fougner <fougner89@gmail.com>
2023-11-30Update bcachefs sources to 71a5b27e017d bcachefs: Make backpointer fsck wb ↵Kent Overstreet
flush check more rigorous Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-11-29add a fallback __DECLARE_FLEX_ARRAYv1.3.5Kent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-11-22Update bcachefs sources to 783085c3cc44 kbuild: Allow gcov to be enabled on ↵Kent Overstreet
the command line Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-11-12Update bcachefs sources to 3ca08ab51ec9 bcachefs: six locks: Simplify ↵Kent Overstreet
optimistic spinning Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-11-08btree_write_buffer: ensure atomic64_sub_return_release availabilityv1.3.3Nicholas Sielicki
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> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-11-07Fix build on 32 bitKent Overstreet
size_t is apparently not an unsigned long on 32 bit, which is what rounddown_pow_of_two() returns. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-11-02Update bcachefs sources to b9bd69421f73 bcachefs: x-macro-ify inode flags enumv1.3.1Kent Overstreet
2023-10-25Update bcachefs sources to 0d63ed13ea3d closures: Fix race in closure_sync()v1.3Kent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-19Update bcachefs sources to 24bdb6fed91c bcachefs: bch2_btree_id_str()Kent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-10-18Update bcachefs sources to a180af9dd349 bcachefs: Refactor memcpy into ↵Kent Overstreet
direct assignment Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-09-23Update bcachefs sources to f9c612bbf82d bcachefs: Fixes for building in ↵Kent Overstreet
userspace Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-09-19bcachefs-tools: fix endian problems between bit spinlocks and futexesBrian Foster
bcachefs format on a big-endian (s390x) machine crashes down in the rhashtable code imported from the kernel. The reason this occurs lies within the rht_lock() -> bit_spin_lock() code, the latter of which casts bitmaps down to 32-bits to satisfy the requirements of the futex interface. The specific problem here is that a 64 -> 32 bit cast doesn't refer to the lower 8 bytes on a big endian machine, which means setting bit number 0 in the 32-bit map actually corresponds to bit 32 in the 64-bit map. The rhashtable code specifically uses bit zero of the bucket pointer for exclusion and uses native bitops elsewhere (i.e. __rht_ptr()) to identify NULL pointers. If bit 32 of the pointer is set by the locking code instead of bit 0, an otherwise NULL pointer looks like a non-NULL value and results in a segfault. The bit spinlock code imported by the kernel is originally intended to work with unsigned long. The kernel code is able to throttle the cpu directly when under lock contention, while the userspace implementation relies on the futex primitives to emulate reliable blocking. Since the futex interface introduces the 32-bit requirement, isolate the associated userspace hack to that particular code. Restore the native bitmap behavior of the bit spinlock code to address the rhashtable problem described above. Since this is not compatible with the futex interface, create a futex wrapper specifically to convert the native bitmap type to a 32-bit virtual address and mask value for the purposes of waiting/waking when under lock contention. Signed-off-by: Brian Foster <bfoster@redhat.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-08-17Update bcachefs sources to a8115093df bcachefs: Fix divide by zero in ↵Kent Overstreet
rebalance_work()
2023-08-11Update bcachefs sources to b0788c47d9 bcachefs: Fix check_version_upgrade()Kent Overstreet
2023-08-01Update bcachefs sources to 33a60d9b05 bcachefs: Assorted fixes for clangKent Overstreet
2023-07-15Update bcachefs sources to e14d7c7195 bcachefs: Compression levelsKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-07-10Update bcachefs sources to 070ec8d07b bcachefs: Snapshot depth, skiplist fieldsv1.1Kent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-07-09Update bcachefs sources to da7d42a9a2 bcachefs: Add new assertions for ↵Kent Overstreet
shutdown path Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-07-07Update bcachefs sources to 25de2b00dc bcachefs: Change check for invalid key ↵Kent Overstreet
types Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-06-27get_random_u32_below()Kent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-06-27Update bcachefs sources to 84f132d569 bcachefs: fsck: Break walk_inode() up ↵Kent Overstreet
into multiple functions Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-06-18Switch to CLOCK_MONOTONIC_COARSEKent Overstreet
CLOCK_MONOTONIC requires a syscall, and is much more expensive. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-06-10Update bcachefs sources to ed6b7f81a7 six locks: Disable percpu read lock ↵Kent Overstreet
mode in userspace Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-06-04Update bcachefs sources to 7c0fe6f104 bcachefs: Fix bch2_fsck_ask_yn()Kent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-05-25Update bcachefs sources to 31c09369cd six locks: Fix an unitialized varKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-05-13Update bcachefs sources to 400f275d46 bcachefs: Fix check_overlapping_extents()Kent Overstreet
2023-05-02Update bcachefs sources to 6a20aede29 bcachefs: Fix quotas + snapshotsv0.29Kent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-04-26A small compile fixMikulas Patocka
Hi Here I'm sending a small compile fix for bcachefs-tools. Without this patch, I get this error: cargo build --release --manifest-path rust-src/Cargo.toml Compiling bch_bindgen v0.1.0 (/usr/src/git/bcachefs-tools/rust-src/bch_bindgen) error: failed to run custom build command for `bch_bindgen v0.1.0 (/usr/src/git/bcachefs-tools/rust-src/bch_bindgen)` Caused by: process didn't exit successfully: `/usr/src/git/bcachefs-tools/rust-src/target/release/build/bch_bindgen-733e88995ce9eab7/build-script-build` (exit status: 101) --- stderr warning: optimization flag '-fkeep-inline-functions' is not supported [-Wignored-optimization-argument] ../../include/linux/bit_spinlock.h:20:3: error: call to undeclared function 'futex'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] ../../include/linux/bit_spinlock.h:28:2: error: call to undeclared function 'futex'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] ../../include/linux/bit_spinlock.h:39:2: error: call to undeclared function 'futex'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] The futex() function is declared in /usr/include/x86_64-linux-gnu/urcu/futex.h It is not declared in linux/futex.h, so we need to include urcu/futex.h Mikulas Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-03-31Update bcachefs sources to 8fd009dd76 bcachefs: Rip out code for storing ↵v0.28Kent Overstreet
backpointers in alloc keys Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-03-06Update bcachefs sources to 3856459b1b bcachefs: ↵Kent Overstreet
bch2_btree_iter_peek_node_and_restart() Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-03-04Update bcachefs sources to 171da96d76 bcachefs: Drop some anonymous structs, ↵Kent Overstreet
unions
2023-03-02linux shim: hlist_unhashed()Kent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-02-27Update bcachefs sources to ca97ee3577 bcachefs: ↵Kent Overstreet
bch2_btree_iter_peek_and_restart_outlined() Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-02-20Update bcachefs sources to 8e1519ccb6 bcachefs: Add tracepoint & counter for ↵Kent Overstreet
btree split race Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-02-13Fix cpu_relax()Kent Overstreet
cpu_relax() is supposed to be a compiler barrier - this fixes a bug with btree_write_buffer_flush() getting stuck. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-02-09Update bcachefs sources to ea93c26e98 fixup! bcachefs: We can handle missing ↵Kent Overstreet
btree roots for all alloc btrees Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2022-12-19Change memory reclaimKent Overstreet
- Spin up a background thread to call the shrinkers every 1 second - Memory allocations will only call reclaim after a failed allocation, not every single time This will be a major performance boost on allocation intensive workloads. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>