summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/darray.h
Commit message (Collapse)AuthorAgeFilesLines
* bcachefs: Convert split_devs() to darrayKent Overstreet2024-01-011-0/+1
| | | | | | | Bit of cleanup & modernization: also moving this code to util.c, it'll be used by userspace as well. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
* bcachefs: darray_for_each() now declares loop iterKent Overstreet2024-01-011-2/+5
| | | | Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
* bcachefs: DARRAY_PREALLOCATED()Kent Overstreet2024-01-011-11/+17
| | | | | | Add support to darray for preallocating some number of elements. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
* bcachefs: Switch darray to kvmalloc()Kent Overstreet2024-01-011-1/+1
| | | | | | | | We sometimes use darrays for quite large buffers - the btree write buffer in particular needs large buffers, since it must be sized to hold all the write buffer keys outstanding in the journal. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
* bcachefs: Factor out darray resize slowpathKent Overstreet2024-01-011-11/+17
| | | | | | | | Move the slowpath (actually growing the darray) to an out-of-line function; also, add some helpers for the upcoming btree write buffer rewrite. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
* bcachefs: Convert bch2_fs_open() to darrayKent Overstreet2023-11-051-0/+6
| | | | | | Open coded dynamic arrays are deprecated. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
* bcachefs: Assorted fixes for clangKent Overstreet2023-10-221-3/+3
| | | | | | | clang had a few more warnings about enum conversion, and also didn't like the opts.c initializer. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
* bcachefs: bch2_buffered_write large folio conversionKent Overstreet2023-10-221-0/+5
| | | | Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
* bcachefs: Fix bch2_evict_subvolume_inodes()Kent Overstreet2023-10-221-5/+10
| | | | | | | | This fixes a bug in bch2_evict_subvolume_inodes(): d_mark_dontcache() doesn't handle the case where i_count is already 0, we need to grab and put the inode in order for it to be dropped. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
* bcachefs: darraysKent Overstreet2023-10-221-0/+77
Inspired by CCAN darray - simple, stupid resizable (dynamic) arrays. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>