movinggc.c (712cba5d87a6c0e980ee5fad45734e189c4d7151) movinggc.c (3a83f4677539bce8eaa2bca9ee9c20e172d7ab04)
1/*
2 * Moving/copying garbage collector
3 *
4 * Copyright 2012 Google, Inc.
5 */
6
7#include "bcache.h"
8#include "btree.h"

--- 63 unchanged lines hidden (view full) ---

72
73 bch_bbio_endio(io->op.c, bio, bio->bi_error, "reading data to move");
74}
75
76static void moving_init(struct moving_io *io)
77{
78 struct bio *bio = &io->bio.bio;
79
1/*
2 * Moving/copying garbage collector
3 *
4 * Copyright 2012 Google, Inc.
5 */
6
7#include "bcache.h"
8#include "btree.h"

--- 63 unchanged lines hidden (view full) ---

72
73 bch_bbio_endio(io->op.c, bio, bio->bi_error, "reading data to move");
74}
75
76static void moving_init(struct moving_io *io)
77{
78 struct bio *bio = &io->bio.bio;
79
80 bio_init(bio);
80 bio_init(bio, bio->bi_inline_vecs,
81 DIV_ROUND_UP(KEY_SIZE(&io->w->key), PAGE_SECTORS));
81 bio_get(bio);
82 bio_set_prio(bio, IOPRIO_PRIO_VALUE(IOPRIO_CLASS_IDLE, 0));
83
84 bio->bi_iter.bi_size = KEY_SIZE(&io->w->key) << 9;
82 bio_get(bio);
83 bio_set_prio(bio, IOPRIO_PRIO_VALUE(IOPRIO_CLASS_IDLE, 0));
84
85 bio->bi_iter.bi_size = KEY_SIZE(&io->w->key) << 9;
85 bio->bi_max_vecs = DIV_ROUND_UP(KEY_SIZE(&io->w->key),
86 PAGE_SECTORS);
87 bio->bi_private = &io->cl;
86 bio->bi_private = &io->cl;
88 bio->bi_io_vec = bio->bi_inline_vecs;
89 bch_bio_map(bio, NULL);
90}
91
92static void write_moving(struct closure *cl)
93{
94 struct moving_io *io = container_of(cl, struct moving_io, cl);
95 struct data_insert_op *op = &io->op;
96

--- 157 unchanged lines hidden ---
87 bch_bio_map(bio, NULL);
88}
89
90static void write_moving(struct closure *cl)
91{
92 struct moving_io *io = container_of(cl, struct moving_io, cl);
93 struct data_insert_op *op = &io->op;
94

--- 157 unchanged lines hidden ---