summaryrefslogtreecommitdiff
path: root/fs
AgeCommit message (Collapse)AuthorFilesLines
2024-05-09bcachefs: kill bch2_dev_bkey_exists() in journal_ptrs_to_text()Kent Overstreet1-5/+0
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-09bcachefs: kill bch2_dev_bkey_exists() in discard_one_bucket_fast()Kent Overstreet1-2/+5
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-09bcachefs: kill bch2_dev_bkey_exists() in check_alloc_info()Kent Overstreet2-40/+44
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-09bcachefs: bch2_dev_have_ref()Kent Overstreet3-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>
2024-05-09bcachefs: kill bch2_dev_bkey_exists() in data_update_init()Kent Overstreet1-2/+10
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-09bcachefs: kill bch2_dev_bkey_exists() in bkey_pick_read_device()Kent Overstreet1-15/+22
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-09bcachefs: pass bch_dev to read_from_stale_dirty_pointer()Kent Overstreet1-2/+2
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-09bcachefs: bch2_dev_bucket_exists() uses bch2_dev_rcu()Kent Overstreet1-7/+5
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-09bcachefs: kill bch2_dev_bkey_exists() in btree_gc.cKent Overstreet1-10/+31
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-09bcachefs: bch2_extent_normalize() -> bch2_dev_rcu()Kent Overstreet1-1/+6
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-09bcachefs: bch2_bkey_has_target() -> bch2_dev_rcu()Kent Overstreet1-3/+10
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-09bcachefs: extent_ptr_invalid() -> bch2_dev_rcu()Kent Overstreet1-11/+19
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-09bcachefs: ptr_stale() -> dev_ptr_stale()Kent Overstreet6-16/+18
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-09bcachefs: extent_ptr_durability() -> bch2_dev_rcu()Kent Overstreet4-5/+21
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-09bcachefs: bch2_extent_merge() -> bch2_dev_rcu()Kent Overstreet1-3/+6
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-09bcachefs: ec_validate_checksums() -> bch2_dev_tryget()Kent Overstreet1-10/+12
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-09bcachefs: ob_dev()Kent Overstreet4-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>
2024-05-09bcachefs: move replica_set from bch_dev to bch_fsKent Overstreet3-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>
2024-05-09bcachefs: Kill bch2_dev_bkey_exists() in backpointer codeKent Overstreet6-52/+102
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-09bcachefs: PTR_BUCKET_POS() now takes bch_devKent Overstreet8-49/+57
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-09bcachefs: bch2_dev_iterate()Kent Overstreet2-7/+19
New helper for getting refs to devices as we iterate. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-09bcachefs: bch2_evacuate_bucket() -> bch2_dev_tryget()Kent Overstreet1-1/+6
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-09bcachefs: bch2_bucket_ref_update() now takes bch_devKent Overstreet3-28/+42
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-09bcachefs: bch2_trigger_alloc() -> bch2_dev_tryget()Kent Overstreet1-12/+11
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-09bcachefs: bch2_check_alloc_key() -> bch2_dev_tryget_noerror()Kent Overstreet4-12/+40
More elimination of bch2_dev_bkey_exists() usage. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-09bcachefs: Convert to bch2_dev_tryget_noerror()Kent Overstreet2-18/+4
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-09bcachefs: bch2_dev_tryget()Kent Overstreet2-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>
2024-05-09bcachefs: bch2_have_enough_devs() checks for nonexistent deviceKent Overstreet1-5/+7
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-09bcachefs: journal_replay_entry_early() checks for nonexistent deviceKent Overstreet1-8/+11
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-09bcachefs: bch2_dev_btree_bitmap_marked() -> bch2_dev_rcu()Kent Overstreet1-6/+19
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-09bcachefs: Pass device to bch2_bucket_do_index()Kent Overstreet1-6/+5
Eliminating bch2_dev_bkey_exists() uses and replacing them with proper checks; this one was unnecessary since the caller already has it. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-09bcachefs: Pass device to bch2_alloc_write_key()Kent Overstreet1-2/+2
More elimating bch2_dev_bkey_exists() Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-09bcachefs: bch2_dev_safe() -> bch2_dev_rcu()Kent Overstreet3-2/+3
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-09bcachefs: Debug asserts for ca->refKent Overstreet3-3/+37
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-09bcachefs: New helpers for device refcountsKent Overstreet9-41/+50
This will be used in the next patch for adding some new debug mode asserts. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-09bcachefs: bch2_print_allocator_stuck()Kent Overstreet5-76/+114
If we block on the allocator for more than 10 seconds, print out some useful debugging info. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-09bcachefs: bch2_bkey_drop_ptrs() declares loop iterKent Overstreet7-10/+2
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-09bcachefs: x-macroize journal flags enumsKent Overstreet11-33/+44
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-09bcachefs: On device add, prefer unused slotsKent Overstreet1-3/+22
We can't strictly guarantee that no pointers refer to nonexistent devices - we attempt to, but we need to be safe when the filesystem is corrupt. Therefore, change device_add to try to pick a slot that's never been used, or the slot that's been unused the longest. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-09bcachefs: Kill opts.buckets_nouseKent Overstreet4-24/+32
Now explicitly allocate and free the buckets_nouse bitmap - this is going to be used for online fsck. To go RW when we haven't check allocations, we'll do a much slimmed down version that just initializes the buckets_nouse bitmaps. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-09bcachefs: simplify bch2_trans_start_alloc_update()Kent Overstreet4-46/+37
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-09bcachefs: __mark_stripe_bucket() now takes bch_alloc_v4Kent Overstreet2-63/+38
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-09bcachefs: __mark_pointer now takes bch_alloc_v4Kent Overstreet3-41/+33
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-09bcachefs: kill bch2_dev_usage_update_m()Kent Overstreet5-63/+41
by using bucket_m_to_alloc() more, we can get some nice code cleanup. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-09bcachefs: alloc_data_type_set()Kent Overstreet4-31/+36
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-09bcachefs: dirty_sectors -> replicas_sectorsKent Overstreet1-4/+4
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-09bcachefs: delete old gen check bch2_alloc_write_key()Kent Overstreet1-3/+0
this was from metadata only gc - we don't need it anymore Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-09bcachefs: Correct the FS_IOC_GETFLAGS to FS_IOC32_GETFLAGS in ↵Youling Tang1-1/+1
bch2_compat_fs_ioctl() It should be FS_IOC32_GETFLAGS instead of FS_IOC_GETFLAGS in compat ioctl. Signed-off-by: Youling Tang <tangyouling@kylinos.cn> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-09bcachefs: Fix error path of bch2_link_trans()Youling Tang1-2/+2
In bch2_link_trans(), if bch2_inode_nlink_inc() fails, it needs to call bch2_trans_iter_exit() in the error path. Signed-off-by: Youling Tang <tangyouling@kylinos.cn> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-09bcachefs: Change destroy_inode to free_inodeYouling Tang1-11/+3
The vfs[1] documentation describes free_inode as follows: ``` free_inode this method is called from RCU callback. If you use call_rcu() in ->destroy_inode to free ‘struct inode’ memory, then it’s better to release memory in this method. ``` free_inode will be called by the RCU callback, so it might be better to move the inode free operation to destroy_inode. Similar to commit ae6b47b5653e ("fs/ntfs3: Change destroy_inode to free_inode"). Link: [1]: https://www.kernel.org/doc/html/latest/filesystems/vfs.html Signed-off-by: Youling Tang <tangyouling@kylinos.cn> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>