]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - libbcachefs/keylist.h
Update bcachefs sources to e99d29e402 bcachefs: zstd support, compression refactoring
[bcachefs-tools-debian] / libbcachefs / keylist.h
index b7c8a861e537e4ec2b247c27c079f7d68c6378f4..a8c8883ba0719ae736bcb17370de00d7d18322df 100644 (file)
@@ -58,6 +58,17 @@ static inline struct bkey_i *bch2_keylist_front(struct keylist *l)
 #define keylist_single(k)                                      \
        ((struct keylist) { .keys = k, .top = bkey_next(k) })
 
+static inline u64 keylist_sectors(struct keylist *keys)
+{
+       struct bkey_i *k;
+       u64 ret = 0;
+
+       for_each_keylist_key(keys, k)
+               ret += k->k.size;
+
+       return ret;
+}
+
 #ifdef CONFIG_BCACHEFS_DEBUG
 void bch2_verify_keylist_sorted(struct keylist *);
 #else