summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/util.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2018-09-27 21:08:39 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:08:10 -0400
commit71c9e0ba427ae0572693c133e33dad30efaf3aba (patch)
tree0fab58d78d2842a83b6d733bedf68927c84c3688 /fs/bcachefs/util.h
parenta2753581f6c5c05ea93978f8217a29115450ac58 (diff)
downloadlinux-stable-71c9e0ba427ae0572693c133e33dad30efaf3aba.tar.gz
linux-stable-71c9e0ba427ae0572693c133e33dad30efaf3aba.tar.bz2
linux-stable-71c9e0ba427ae0572693c133e33dad30efaf3aba.zip
bcachefs: bch2_extent_ptr_decoded_append()
This new helper for the move path avoids creating a new CRC entry when we already have one that matches the pointer being added. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/util.h')
-rw-r--r--fs/bcachefs/util.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/bcachefs/util.h b/fs/bcachefs/util.h
index 446216eb8c76..44e2c96b6509 100644
--- a/fs/bcachefs/util.h
+++ b/fs/bcachefs/util.h
@@ -581,6 +581,16 @@ size_t bch2_rand_range(size_t);
void memcpy_to_bio(struct bio *, struct bvec_iter, void *);
void memcpy_from_bio(void *, struct bio *, struct bvec_iter);
+static inline void memcpy_u64s_small(void *dst, const void *src,
+ unsigned u64s)
+{
+ u64 *d = dst;
+ const u64 *s = src;
+
+ while (u64s--)
+ *d++ = *s++;
+}
+
static inline void __memcpy_u64s(void *dst, const void *src,
unsigned u64s)
{