]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - libbcachefs/io.h
Update bcachefs sources to 367a8fad45 bcachefs: Reset journal flush delay to default...
[bcachefs-tools-debian] / libbcachefs / io.h
index bc0a0bd6f849438a82474c7e3ce2b331f6950be7..fb5114518666cf39b91a5917b4a6b1f314f1f419 100644 (file)
@@ -48,27 +48,22 @@ static inline u64 *op_journal_seq(struct bch_write_op *op)
                ? op->journal_seq_p : &op->journal_seq;
 }
 
-static inline void op_journal_seq_set(struct bch_write_op *op, u64 *journal_seq)
-{
-       op->journal_seq_p = journal_seq;
-       op->flags |= BCH_WRITE_JOURNAL_SEQ_PTR;
-}
-
 static inline struct workqueue_struct *index_update_wq(struct bch_write_op *op)
 {
-       return op->alloc_reserve == RESERVE_MOVINGGC
+       return op->alloc_reserve == RESERVE_movinggc
                ? op->c->copygc_wq
                : op->c->btree_update_wq;
 }
 
 int bch2_sum_sector_overwrites(struct btree_trans *, struct btree_iter *,
-                              struct bkey_i *, bool *, bool *, s64 *, s64 *);
-int bch2_extent_update(struct btree_trans *, struct btree_iter *,
-                      struct bkey_i *, struct disk_reservation *,
-                      u64 *, u64, s64 *, bool);
+                              struct bkey_i *, bool *, s64 *, s64 *);
+int bch2_extent_update(struct btree_trans *, subvol_inum,
+                      struct btree_iter *, struct bkey_i *,
+                      struct disk_reservation *, u64 *, u64, s64 *, bool);
+
 int bch2_fpunch_at(struct btree_trans *, struct btree_iter *,
-                  struct bpos, u64 *, s64 *);
-int bch2_fpunch(struct bch_fs *c, u64, u64, u64, u64 *, s64 *);
+                  subvol_inum, u64, s64 *);
+int bch2_fpunch(struct bch_fs *c, subvol_inum, u64, u64, s64 *);
 
 int bch2_write_index_default(struct bch_write_op *);
 
@@ -84,12 +79,13 @@ static inline void bch2_write_op_init(struct bch_write_op *op, struct bch_fs *c,
        op->compression_type    = bch2_compression_opt_to_type[opts.compression];
        op->nr_replicas         = 0;
        op->nr_replicas_required = c->opts.data_replicas_required;
-       op->alloc_reserve       = RESERVE_NONE;
+       op->alloc_reserve       = RESERVE_none;
        op->incompressible      = 0;
        op->open_buckets.nr     = 0;
        op->devs_have.nr        = 0;
        op->target              = 0;
        op->opts                = opts;
+       op->subvol              = 0;
        op->pos                 = POS_MAX;
        op->version             = ZERO_VERSION;
        op->write_point         = (struct write_point_specifier) { 0 };
@@ -157,10 +153,10 @@ static inline void bch2_read_extent(struct btree_trans *trans,
 }
 
 void __bch2_read(struct bch_fs *, struct bch_read_bio *, struct bvec_iter,
-                u64, struct bch_io_failures *, unsigned flags);
+                subvol_inum, struct bch_io_failures *, unsigned flags);
 
 static inline void bch2_read(struct bch_fs *c, struct bch_read_bio *rbio,
-                            u64 inode)
+                            subvol_inum inum)
 {
        struct bch_io_failures failed = { .nr = 0 };
 
@@ -168,8 +164,9 @@ static inline void bch2_read(struct bch_fs *c, struct bch_read_bio *rbio,
 
        rbio->c = c;
        rbio->start_time = local_clock();
+       rbio->subvol = inum.subvol;
 
-       __bch2_read(c, rbio, rbio->bio.bi_iter, inode, &failed,
+       __bch2_read(c, rbio, rbio->bio.bi_iter, inum, &failed,
                    BCH_READ_RETRY_IF_STALE|
                    BCH_READ_MAY_PROMOTE|
                    BCH_READ_USER_MAPPED);