void drbd_md_io_complete(struct bio *bio, int error)
{
struct drbd_md_io *md_io;
- struct drbd_conf *mdev;
+ struct drbd_device *mdev;
md_io = (struct drbd_md_io *)bio->bi_private;
- mdev = container_of(md_io, struct drbd_conf, md_io);
+ mdev = container_of(md_io, struct drbd_device, md_io);
md_io->error = error;
static void drbd_endio_read_sec_final(struct drbd_peer_request *peer_req) __releases(local)
{
unsigned long flags = 0;
- struct drbd_conf *mdev = peer_req->w.mdev;
+ struct drbd_device *mdev = peer_req->w.mdev;
spin_lock_irqsave(&mdev->tconn->req_lock, flags);
mdev->read_cnt += peer_req->i.size >> 9;
static void drbd_endio_write_sec_final(struct drbd_peer_request *peer_req) __releases(local)
{
unsigned long flags = 0;
- struct drbd_conf *mdev = peer_req->w.mdev;
+ struct drbd_device *mdev = peer_req->w.mdev;
struct drbd_interval i;
int do_wake;
u64 block_id;
void drbd_peer_request_endio(struct bio *bio, int error)
{
struct drbd_peer_request *peer_req = bio->bi_private;
- struct drbd_conf *mdev = peer_req->w.mdev;
+ struct drbd_device *mdev = peer_req->w.mdev;
int uptodate = bio_flagged(bio, BIO_UPTODATE);
int is_write = bio_data_dir(bio) == WRITE;
{
unsigned long flags;
struct drbd_request *req = bio->bi_private;
- struct drbd_conf *mdev = req->w.mdev;
+ struct drbd_device *mdev = req->w.mdev;
struct bio_and_error m;
enum drbd_req_event what;
int uptodate = bio_flagged(bio, BIO_UPTODATE);
complete_master_bio(mdev, &m);
}
-void drbd_csum_ee(struct drbd_conf *mdev, struct crypto_hash *tfm,
+void drbd_csum_ee(struct drbd_device *mdev, struct crypto_hash *tfm,
struct drbd_peer_request *peer_req, void *digest)
{
struct hash_desc desc;
crypto_hash_final(&desc, digest);
}
-void drbd_csum_bio(struct drbd_conf *mdev, struct crypto_hash *tfm, struct bio *bio, void *digest)
+void drbd_csum_bio(struct drbd_device *mdev, struct crypto_hash *tfm, struct bio *bio, void *digest)
{
struct hash_desc desc;
struct scatterlist sg;
static int w_e_send_csum(struct drbd_work *w, int cancel)
{
struct drbd_peer_request *peer_req = container_of(w, struct drbd_peer_request, w);
- struct drbd_conf *mdev = w->mdev;
+ struct drbd_device *mdev = w->mdev;
int digest_size;
void *digest;
int err = 0;
#define GFP_TRY (__GFP_HIGHMEM | __GFP_NOWARN)
-static int read_for_csum(struct drbd_conf *mdev, sector_t sector, int size)
+static int read_for_csum(struct drbd_device *mdev, sector_t sector, int size)
{
struct drbd_peer_request *peer_req;
int w_resync_timer(struct drbd_work *w, int cancel)
{
- struct drbd_conf *mdev = w->mdev;
+ struct drbd_device *mdev = w->mdev;
switch (mdev->state.conn) {
case C_VERIFY_S:
w_make_ov_request(w, cancel);
void resync_timer_fn(unsigned long data)
{
- struct drbd_conf *mdev = (struct drbd_conf *) data;
+ struct drbd_device *mdev = (struct drbd_device *) data;
if (list_empty(&mdev->resync_work.list))
drbd_queue_work(&mdev->tconn->sender_work, &mdev->resync_work);
return fb;
}
-static int drbd_rs_controller(struct drbd_conf *mdev)
+static int drbd_rs_controller(struct drbd_device *mdev)
{
struct disk_conf *dc;
unsigned int sect_in; /* Number of sectors that came in since the last turn */
return req_sect;
}
-static int drbd_rs_number_requests(struct drbd_conf *mdev)
+static int drbd_rs_number_requests(struct drbd_device *mdev)
{
int number;
int w_make_resync_request(struct drbd_work *w, int cancel)
{
- struct drbd_conf *mdev = w->mdev;
+ struct drbd_device *mdev = w->mdev;
unsigned long bit;
sector_t sector;
const sector_t capacity = drbd_get_capacity(mdev->this_bdev);
static int w_make_ov_request(struct drbd_work *w, int cancel)
{
- struct drbd_conf *mdev = w->mdev;
+ struct drbd_device *mdev = w->mdev;
int number, i, size;
sector_t sector;
const sector_t capacity = drbd_get_capacity(mdev->this_bdev);
int w_ov_finished(struct drbd_work *w, int cancel)
{
- struct drbd_conf *mdev = w->mdev;
+ struct drbd_device *mdev = w->mdev;
kfree(w);
ov_out_of_sync_print(mdev);
drbd_resync_finished(mdev);
static int w_resync_finished(struct drbd_work *w, int cancel)
{
- struct drbd_conf *mdev = w->mdev;
+ struct drbd_device *mdev = w->mdev;
kfree(w);
drbd_resync_finished(mdev);
return 0;
}
-static void ping_peer(struct drbd_conf *mdev)
+static void ping_peer(struct drbd_device *mdev)
{
struct drbd_tconn *tconn = mdev->tconn;
test_bit(GOT_PING_ACK, &tconn->flags) || mdev->state.conn < C_CONNECTED);
}
-int drbd_resync_finished(struct drbd_conf *mdev)
+int drbd_resync_finished(struct drbd_device *mdev)
{
unsigned long db, dt, dbdt;
unsigned long n_oos;
}
/* helper */
-static void move_to_net_ee_or_free(struct drbd_conf *mdev, struct drbd_peer_request *peer_req)
+static void move_to_net_ee_or_free(struct drbd_device *mdev, struct drbd_peer_request *peer_req)
{
if (drbd_peer_req_has_active_page(peer_req)) {
/* This might happen if sendpage() has not finished */
int w_e_end_data_req(struct drbd_work *w, int cancel)
{
struct drbd_peer_request *peer_req = container_of(w, struct drbd_peer_request, w);
- struct drbd_conf *mdev = w->mdev;
+ struct drbd_device *mdev = w->mdev;
int err;
if (unlikely(cancel)) {
int w_e_end_rsdata_req(struct drbd_work *w, int cancel)
{
struct drbd_peer_request *peer_req = container_of(w, struct drbd_peer_request, w);
- struct drbd_conf *mdev = w->mdev;
+ struct drbd_device *mdev = w->mdev;
int err;
if (unlikely(cancel)) {
int w_e_end_csum_rs_req(struct drbd_work *w, int cancel)
{
struct drbd_peer_request *peer_req = container_of(w, struct drbd_peer_request, w);
- struct drbd_conf *mdev = w->mdev;
+ struct drbd_device *mdev = w->mdev;
struct digest_info *di;
int digest_size;
void *digest = NULL;
int w_e_end_ov_req(struct drbd_work *w, int cancel)
{
struct drbd_peer_request *peer_req = container_of(w, struct drbd_peer_request, w);
- struct drbd_conf *mdev = w->mdev;
+ struct drbd_device *mdev = w->mdev;
sector_t sector = peer_req->i.sector;
unsigned int size = peer_req->i.size;
int digest_size;
return err;
}
-void drbd_ov_out_of_sync_found(struct drbd_conf *mdev, sector_t sector, int size)
+void drbd_ov_out_of_sync_found(struct drbd_device *mdev, sector_t sector, int size)
{
if (mdev->ov_last_oos_start + mdev->ov_last_oos_size == sector) {
mdev->ov_last_oos_size += size>>9;
int w_e_end_ov_reply(struct drbd_work *w, int cancel)
{
struct drbd_peer_request *peer_req = container_of(w, struct drbd_peer_request, w);
- struct drbd_conf *mdev = w->mdev;
+ struct drbd_device *mdev = w->mdev;
struct digest_info *di;
void *digest;
sector_t sector = peer_req->i.sector;
int w_send_write_hint(struct drbd_work *w, int cancel)
{
- struct drbd_conf *mdev = w->mdev;
+ struct drbd_device *mdev = w->mdev;
struct drbd_socket *sock;
if (cancel)
int w_send_out_of_sync(struct drbd_work *w, int cancel)
{
struct drbd_request *req = container_of(w, struct drbd_request, w);
- struct drbd_conf *mdev = w->mdev;
+ struct drbd_device *mdev = w->mdev;
struct drbd_tconn *tconn = mdev->tconn;
int err;
int w_send_dblock(struct drbd_work *w, int cancel)
{
struct drbd_request *req = container_of(w, struct drbd_request, w);
- struct drbd_conf *mdev = w->mdev;
+ struct drbd_device *mdev = w->mdev;
struct drbd_tconn *tconn = mdev->tconn;
int err;
int w_send_read_req(struct drbd_work *w, int cancel)
{
struct drbd_request *req = container_of(w, struct drbd_request, w);
- struct drbd_conf *mdev = w->mdev;
+ struct drbd_device *mdev = w->mdev;
struct drbd_tconn *tconn = mdev->tconn;
int err;
int w_restart_disk_io(struct drbd_work *w, int cancel)
{
struct drbd_request *req = container_of(w, struct drbd_request, w);
- struct drbd_conf *mdev = w->mdev;
+ struct drbd_device *mdev = w->mdev;
if (bio_data_dir(req->master_bio) == WRITE && req->rq_state & RQ_IN_ACT_LOG)
drbd_al_begin_io(mdev, &req->i, false);
return 0;
}
-static int _drbd_may_sync_now(struct drbd_conf *mdev)
+static int _drbd_may_sync_now(struct drbd_device *mdev)
{
- struct drbd_conf *odev = mdev;
+ struct drbd_device *odev = mdev;
int resync_after;
while (1) {
*
* Called from process context only (admin command and after_state_ch).
*/
-static int _drbd_pause_after(struct drbd_conf *mdev)
+static int _drbd_pause_after(struct drbd_device *mdev)
{
- struct drbd_conf *odev;
+ struct drbd_device *odev;
int i, rv = 0;
rcu_read_lock();
*
* Called from process context only (admin command and worker).
*/
-static int _drbd_resume_next(struct drbd_conf *mdev)
+static int _drbd_resume_next(struct drbd_device *mdev)
{
- struct drbd_conf *odev;
+ struct drbd_device *odev;
int i, rv = 0;
rcu_read_lock();
return rv;
}
-void resume_next_sg(struct drbd_conf *mdev)
+void resume_next_sg(struct drbd_device *mdev)
{
write_lock_irq(&global_state_lock);
_drbd_resume_next(mdev);
write_unlock_irq(&global_state_lock);
}
-void suspend_other_sg(struct drbd_conf *mdev)
+void suspend_other_sg(struct drbd_device *mdev)
{
write_lock_irq(&global_state_lock);
_drbd_pause_after(mdev);
}
/* caller must hold global_state_lock */
-enum drbd_ret_code drbd_resync_after_valid(struct drbd_conf *mdev, int o_minor)
+enum drbd_ret_code drbd_resync_after_valid(struct drbd_device *mdev, int o_minor)
{
- struct drbd_conf *odev;
+ struct drbd_device *odev;
int resync_after;
if (o_minor == -1)
}
/* caller must hold global_state_lock */
-void drbd_resync_after_changed(struct drbd_conf *mdev)
+void drbd_resync_after_changed(struct drbd_device *mdev)
{
int changes;
} while (changes);
}
-void drbd_rs_controller_reset(struct drbd_conf *mdev)
+void drbd_rs_controller_reset(struct drbd_device *mdev)
{
struct fifo_buffer *plan;
void start_resync_timer_fn(unsigned long data)
{
- struct drbd_conf *mdev = (struct drbd_conf *) data;
+ struct drbd_device *mdev = (struct drbd_device *) data;
drbd_queue_work(&mdev->tconn->sender_work, &mdev->start_resync_work);
}
int w_start_resync(struct drbd_work *w, int cancel)
{
- struct drbd_conf *mdev = w->mdev;
+ struct drbd_device *mdev = w->mdev;
if (atomic_read(&mdev->unacked_cnt) || atomic_read(&mdev->rs_pending_cnt)) {
dev_warn(DEV, "w_start_resync later...\n");
* This function might bring you directly into one of the
* C_PAUSED_SYNC_* states.
*/
-void drbd_start_resync(struct drbd_conf *mdev, enum drbd_conns side)
+void drbd_start_resync(struct drbd_device *mdev, enum drbd_conns side)
{
union drbd_state ns;
int r;
{
struct drbd_tconn *tconn = thi->tconn;
struct drbd_work *w = NULL;
- struct drbd_conf *mdev;
+ struct drbd_device *mdev;
LIST_HEAD(work_list);
int vnr;