diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2020-07-25 21:07:37 +0200 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 23:08:43 +0200 |
commit | 4580baec7fbee2fdceb9b5b2b337ea3734a6d2b8 (patch) | |
tree | c3c10eaad6c7205e46e46bbfe58eec8402d07252 /fs/bcachefs/btree_cache.h | |
parent | bcachefs: Ensure we wake up threads locking node when reusing it (diff) | |
download | linux-4580baec7fbee2fdceb9b5b2b337ea3734a6d2b8.tar.xz linux-4580baec7fbee2fdceb9b5b2b337ea3734a6d2b8.zip |
bcachefs: Remove some uses of PAGE_SIZE in the btree code
For portability to userspace, we should try to avoid working in kernel
pages.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/btree_cache.h')
-rw-r--r-- | fs/bcachefs/btree_cache.h | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/fs/bcachefs/btree_cache.h b/fs/bcachefs/btree_cache.h index 2160012c734f..d0d3a85bb8be 100644 --- a/fs/bcachefs/btree_cache.h +++ b/fs/bcachefs/btree_cache.h @@ -79,14 +79,9 @@ static inline size_t btree_max_u64s(struct bch_fs *c) return (btree_bytes(c) - sizeof(struct btree_node)) / sizeof(u64); } -static inline size_t btree_page_order(struct bch_fs *c) -{ - return get_order(btree_bytes(c)); -} - static inline size_t btree_pages(struct bch_fs *c) { - return 1 << btree_page_order(c); + return btree_bytes(c) / PAGE_SIZE; } static inline unsigned btree_blocks(struct bch_fs *c) |