summaryrefslogtreecommitdiffstats
path: root/fs (follow)
Commit message (Collapse)AuthorAgeFilesLines
* bcachefs: Plumb bch_validate_flags to sb_field_ops.validate()Kent Overstreet2024-05-0913-47/+38
| | | | Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
* bcachefs: s/bkey_invalid_flags/bch_validate_flagsKent Overstreet2024-05-0931-110/+110
| | | | | | | We're about to start using bch_validate_flags for superblock section validation - it's no longer bkey specific. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
* bcachefs: fsync() should not return -EROFSKent Overstreet2024-05-091-1/+4
| | | | | | | fsync has a slightly odd usage of -EROFS, where it means "does not support fsync". I didn't choose it... Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
* bcachefs: Invalid devices are now checked for by fsck, not .invalid methodsKent Overstreet2024-05-092-25/+1
| | | | Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
* bcachefs: kill bch2_dev_bkey_exists() in bch2_check_fix_ptrs()Kent Overstreet2024-05-092-14/+24
| | | | Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
* bcachefs: kill bch2_dev_bkey_exists() in bch2_read_endio()Kent Overstreet2024-05-091-14/+19
| | | | Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
* bcachefs: bch2_dev_get_ioref() checks for device not presentKent Overstreet2024-05-099-37/+23
| | | | Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
* bcachefs: bch2_dev_get_ioref2(); io_read.cKent Overstreet2024-05-091-5/+9
| | | | Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
* bcachefs: bch2_dev_get_ioref2(); debug.cKent Overstreet2024-05-091-4/+4
| | | | Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
* bcachefs: bch2_dev_get_ioref2(); journal_io.cKent Overstreet2024-05-091-4/+3
| | | | Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
* bcachefs: bch2_dev_get_ioref2(); io_write.cKent Overstreet2024-05-091-10/+11
| | | | Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
* bcachefs: bch2_dev_get_ioref2(); btree_io.cKent Overstreet2024-05-091-15/+18
| | | | Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
* bcachefs: bch2_dev_get_ioref2(); backpointers.cKent Overstreet2024-05-091-2/+2
| | | | Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
* bcachefs: bch2_dev_get_ioref2(); alloc_background.cKent Overstreet2024-05-092-11/+26
| | | | Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
* bcachefs: for_each_bset() declares loop iterKent Overstreet2024-05-096-34/+14
| | | | Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
* bcachefs: Move BCACHEFS_STATFS_MAGIC value to UAPI magic.hPetr Vorel2024-05-081-1/+2
| | | | | | | | | | | | | | | | Move BCACHEFS_STATFS_MAGIC value to UAPI <linux/magic.h> under BCACHEFS_SUPER_MAGIC definition (use common approach for name) and reuse the definition in bcachefs_format.h BCACHEFS_STATFS_MAGIC. There are other bcachefs magic definitions: BCACHE_MAGIC, BCHFS_MAGIC, which use UUID_INIT() and are used only in libbcachefs. Therefore move only BCACHEFS_STATFS_MAGIC value, which can be used outside of libbcachefs for f_type field in struct statfs in statfs() or fstatfs(). Suggested-by: Su Yue <glass.su@suse.com> Signed-off-by: Petr Vorel <pvorel@suse.cz> Acked-by: Brian Foster <bfoster@redhat.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
* bcachefs: Improve sysfs internal/btree_cacheKent Overstreet2024-05-082-5/+30
| | | | Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
* bcachefs: Allocator prefers not to expand mi.btree_allocated bitmapKent Overstreet2024-05-083-11/+66
| | | | | | | | | | | We now have a small bitmap in the member info section of the superblock for "regions that have btree nodes", so that if we ever have to scan for btree nodes in repair we don't have to scan the whole device(s). This tweaks the allocator to prefer allocating from regions that are already marked in this bitmap. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
* bcachefs: Better bucket alloc tracepointsKent Overstreet2024-05-082-111/+51
| | | | | | | | | | Tracepoints are garbage, and perf trace even cuts off some of our fields. Much nicer to just trace a string, and then we can build nicely formatted output with printbufs. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
* bcachefs: Move nocow unlock to bch2_write_endio()Kent Overstreet2024-05-082-19/+8
| | | | | | | | This fixes a lifetime issue; bch2_nocow_write_unlock() uses PTR_BUCKET_POS(), which needs the device - but we drop our ref to the device in bch2_write_endio(). Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
* bcachefs: kill bch2_dev_bkey_exists() in journal_ptrs_to_text()Kent Overstreet2024-05-081-5/+0
| | | | Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
* bcachefs: kill bch2_dev_bkey_exists() in discard_one_bucket_fast()Kent Overstreet2024-05-081-2/+5
| | | | Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
* bcachefs: kill bch2_dev_bkey_exists() in check_alloc_info()Kent Overstreet2024-05-082-40/+44
| | | | Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
* bcachefs: bch2_dev_have_ref()Kent Overstreet2024-05-083-7/+7
| | | | | | | | bch2_dev_bkey_exists() is going away; bch2_dev_have_ref() documents that we're looking up a device without checking if it's present because we have a reference to it already. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
* bcachefs: kill bch2_dev_bkey_exists() in data_update_init()Kent Overstreet2024-05-081-2/+10
| | | | Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
* bcachefs: kill bch2_dev_bkey_exists() in bkey_pick_read_device()Kent Overstreet2024-05-081-15/+22
| | | | Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
* bcachefs: pass bch_dev to read_from_stale_dirty_pointer()Kent Overstreet2024-05-081-2/+2
| | | | Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
* bcachefs: bch2_dev_bucket_exists() uses bch2_dev_rcu()Kent Overstreet2024-05-081-7/+5
| | | | Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
* bcachefs: kill bch2_dev_bkey_exists() in btree_gc.cKent Overstreet2024-05-081-10/+31
| | | | Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
* bcachefs: bch2_extent_normalize() -> bch2_dev_rcu()Kent Overstreet2024-05-081-1/+6
| | | | Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
* bcachefs: bch2_bkey_has_target() -> bch2_dev_rcu()Kent Overstreet2024-05-081-3/+10
| | | | Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
* bcachefs: extent_ptr_invalid() -> bch2_dev_rcu()Kent Overstreet2024-05-081-11/+19
| | | | Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
* bcachefs: ptr_stale() -> dev_ptr_stale()Kent Overstreet2024-05-086-16/+18
| | | | Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
* bcachefs: extent_ptr_durability() -> bch2_dev_rcu()Kent Overstreet2024-05-084-5/+21
| | | | Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
* bcachefs: bch2_extent_merge() -> bch2_dev_rcu()Kent Overstreet2024-05-081-3/+6
| | | | Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
* bcachefs: ec_validate_checksums() -> bch2_dev_tryget()Kent Overstreet2024-05-081-10/+12
| | | | Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
* bcachefs: ob_dev()Kent Overstreet2024-05-084-14/+22
| | | | | | | Wrapper around bch2_dev_have_ref() for open_buckets; we do guarantee that the device an open_bucket points to exists. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
* bcachefs: move replica_set from bch_dev to bch_fsKent Overstreet2024-05-083-10/+5
| | | | | | | | This is needed for the next patch - the write submit path has to be able to allocate a replica bio even when we weren't able to get a ref on the device. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
* bcachefs: Kill bch2_dev_bkey_exists() in backpointer codeKent Overstreet2024-05-086-52/+102
| | | | Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
* bcachefs: PTR_BUCKET_POS() now takes bch_devKent Overstreet2024-05-088-49/+57
| | | | Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
* bcachefs: bch2_dev_iterate()Kent Overstreet2024-05-082-7/+19
| | | | | | New helper for getting refs to devices as we iterate. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
* bcachefs: bch2_evacuate_bucket() -> bch2_dev_tryget()Kent Overstreet2024-05-081-1/+6
| | | | Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
* bcachefs: bch2_bucket_ref_update() now takes bch_devKent Overstreet2024-05-083-28/+42
| | | | Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
* bcachefs: bch2_trigger_alloc() -> bch2_dev_tryget()Kent Overstreet2024-05-081-12/+11
| | | | Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
* bcachefs: bch2_check_alloc_key() -> bch2_dev_tryget_noerror()Kent Overstreet2024-05-084-12/+40
| | | | | | More elimination of bch2_dev_bkey_exists() usage. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
* bcachefs: Convert to bch2_dev_tryget_noerror()Kent Overstreet2024-05-082-18/+4
| | | | Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
* bcachefs: bch2_dev_tryget()Kent Overstreet2024-05-082-0/+25
| | | | | | | | | | | Most uses of bch2_dev_bkey_exists() are going away, where we assume that because a key references a device the device most exist - instead, we'll be explicitly checking if the device exists and getting a reference to it. This adds the new helpers. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
* bcachefs: bch2_have_enough_devs() checks for nonexistent deviceKent Overstreet2024-05-081-5/+7
| | | | Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
* bcachefs: journal_replay_entry_early() checks for nonexistent deviceKent Overstreet2024-05-081-8/+11
| | | | Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
* bcachefs: bch2_dev_btree_bitmap_marked() -> bch2_dev_rcu()Kent Overstreet2024-05-081-6/+19
| | | | Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>