bcachefs: Refactor open_bucket code

Prep work for adding a hash table of open buckets - instead of embedding
a bch_extent_ptr, we need to refer to the bucket directly so that we're
not calling sector_to_bucket() in the hash table lookup code, which has
an expensive divide.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
diff --git a/fs/bcachefs/alloc_types.h b/fs/bcachefs/alloc_types.h
index 4a1cd8b..bd173c7 100644
--- a/fs/bcachefs/alloc_types.h
+++ b/fs/bcachefs/alloc_types.h
@@ -49,12 +49,15 @@ struct open_bucket {
 	 * the block in the stripe this open_bucket corresponds to:
 	 */
 	u8			ec_idx;
-	u8			type;
+	enum bch_data_type	data_type:3;
 	unsigned		valid:1;
 	unsigned		on_partial_list:1;
 	int			alloc_reserve:3;
+
 	unsigned		sectors_free;
-	struct bch_extent_ptr	ptr;
+	u8			dev;
+	u8			gen;
+	u64			bucket;
 	struct ec_stripe_new	*ec;
 };
 
@@ -74,7 +77,7 @@ struct write_point {
 	struct mutex		lock;
 	u64			last_used;
 	unsigned long		write_point;
-	enum bch_data_type	type;
+	enum bch_data_type	data_type;
 
 	/* calculated based on how many pointers we're actually going to use: */
 	unsigned		sectors_free;