summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/btree_cache.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-07-07 04:47:42 +0200
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 23:10:06 +0200
commit73bd774d28d2b2e6a05c31bf7afb9247e02a8e49 (patch)
tree21ab80d4b966d92647ea178bc5707a8534e5d123 /fs/bcachefs/btree_cache.h
parentbcachefs: Refactor bch_sb_field_ops handling (diff)
downloadlinux-73bd774d28d2b2e6a05c31bf7afb9247e02a8e49.tar.xz
linux-73bd774d28d2b2e6a05c31bf7afb9247e02a8e49.zip
bcachefs: Assorted sparse fixes
- endianness fixes - mark some things static - fix a few __percpu annotations - fix silent enum conversions Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/btree_cache.h')
-rw-r--r--fs/bcachefs/btree_cache.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/bcachefs/btree_cache.h b/fs/bcachefs/btree_cache.h
index 4c11975208b3..1e562b6efa62 100644
--- a/fs/bcachefs/btree_cache.h
+++ b/fs/bcachefs/btree_cache.h
@@ -45,7 +45,11 @@ static inline u64 btree_ptr_hash_val(const struct bkey_i *k)
case KEY_TYPE_btree_ptr:
return *((u64 *) bkey_i_to_btree_ptr_c(k)->v.start);
case KEY_TYPE_btree_ptr_v2:
- return bkey_i_to_btree_ptr_v2_c(k)->v.seq;
+ /*
+ * The cast/deref is only necessary to avoid sparse endianness
+ * warnings:
+ */
+ return *((u64 *) &bkey_i_to_btree_ptr_v2_c(k)->v.seq);
default:
return 0;
}