Commit 54761697 authored by Andreas Gruenbacher's avatar Andreas Gruenbacher Committed by Philipp Reisner

drbd: Rename struct drbd_conf -> struct drbd_device

sed -i -e 's:\<drbd_conf\>:drbd_device:g'
Signed-off-by: default avatarAndreas Gruenbacher <agruen@linbit.com>
Signed-off-by: default avatarPhilipp Reisner <philipp.reisner@linbit.com>
parent a3603a6e
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -66,7 +66,7 @@ static void seq_printf_with_thousands_grouping(struct seq_file *seq, long v)
* [=====>..............] 33.5% (23456/123456)
* finish: 2:20:20 speed: 6,345 (6,456) K/sec
*/
static void drbd_syncer_progress(struct drbd_conf *mdev, struct seq_file *seq)
static void drbd_syncer_progress(struct drbd_device *mdev, struct seq_file *seq)
{
unsigned long db, dt, dbdt, rt, rs_left;
unsigned int res;
......@@ -202,7 +202,7 @@ static int drbd_seq_show(struct seq_file *seq, void *v)
{
int i, prev_i = -1;
const char *sn;
struct drbd_conf *mdev;
struct drbd_device *mdev;
struct net_conf *nc;
char wp;
......
This diff is collapsed.
......@@ -31,10 +31,10 @@
#include "drbd_req.h"
static bool drbd_may_do_local_read(struct drbd_conf *mdev, sector_t sector, int size);
static bool drbd_may_do_local_read(struct drbd_device *mdev, sector_t sector, int size);
/* Update disk stats at start of I/O request */
static void _drbd_start_io_acct(struct drbd_conf *mdev, struct drbd_request *req)
static void _drbd_start_io_acct(struct drbd_device *mdev, struct drbd_request *req)
{
const int rw = bio_data_dir(req->master_bio);
int cpu;
......@@ -49,7 +49,7 @@ static void _drbd_start_io_acct(struct drbd_conf *mdev, struct drbd_request *req
}
/* Update disk stats when completing request upwards */
static void _drbd_end_io_acct(struct drbd_conf *mdev, struct drbd_request *req)
static void _drbd_end_io_acct(struct drbd_device *mdev, struct drbd_request *req)
{
int rw = bio_data_dir(req->master_bio);
unsigned long duration = jiffies - req->start_time;
......@@ -61,7 +61,7 @@ static void _drbd_end_io_acct(struct drbd_conf *mdev, struct drbd_request *req)
part_stat_unlock();
}
static struct drbd_request *drbd_req_new(struct drbd_conf *mdev,
static struct drbd_request *drbd_req_new(struct drbd_device *mdev,
struct bio *bio_src)
{
struct drbd_request *req;
......@@ -95,7 +95,7 @@ static struct drbd_request *drbd_req_new(struct drbd_conf *mdev,
void drbd_req_destroy(struct kref *kref)
{
struct drbd_request *req = container_of(kref, struct drbd_request, kref);
struct drbd_conf *mdev = req->w.mdev;
struct drbd_device *mdev = req->w.mdev;
const unsigned s = req->rq_state;
if ((req->master_bio && !(s & RQ_POSTPONED)) ||
......@@ -179,7 +179,7 @@ void start_new_tl_epoch(struct drbd_tconn *tconn)
wake_all_senders(tconn);
}
void complete_master_bio(struct drbd_conf *mdev,
void complete_master_bio(struct drbd_device *mdev,
struct bio_and_error *m)
{
bio_endio(m->bio, m->error);
......@@ -190,7 +190,7 @@ void complete_master_bio(struct drbd_conf *mdev,
static void drbd_remove_request_interval(struct rb_root *root,
struct drbd_request *req)
{
struct drbd_conf *mdev = req->w.mdev;
struct drbd_device *mdev = req->w.mdev;
struct drbd_interval *i = &req->i;
drbd_remove_interval(root, i);
......@@ -210,7 +210,7 @@ static
void drbd_req_complete(struct drbd_request *req, struct bio_and_error *m)
{
const unsigned s = req->rq_state;
struct drbd_conf *mdev = req->w.mdev;
struct drbd_device *mdev = req->w.mdev;
int rw;
int error, ok;
......@@ -305,7 +305,7 @@ void drbd_req_complete(struct drbd_request *req, struct bio_and_error *m)
static int drbd_req_put_completion_ref(struct drbd_request *req, struct bio_and_error *m, int put)
{
struct drbd_conf *mdev = req->w.mdev;
struct drbd_device *mdev = req->w.mdev;
D_ASSERT(m || (req->rq_state & RQ_POSTPONED));
if (!atomic_sub_and_test(put, &req->completion_ref))
......@@ -328,7 +328,7 @@ static int drbd_req_put_completion_ref(struct drbd_request *req, struct bio_and_
static void mod_rq_state(struct drbd_request *req, struct bio_and_error *m,
int clear, int set)
{
struct drbd_conf *mdev = req->w.mdev;
struct drbd_device *mdev = req->w.mdev;
unsigned s = req->rq_state;
int c_put = 0;
int k_put = 0;
......@@ -424,7 +424,7 @@ static void mod_rq_state(struct drbd_request *req, struct bio_and_error *m,
kref_sub(&req->kref, k_put, drbd_req_destroy);
}
static void drbd_report_io_error(struct drbd_conf *mdev, struct drbd_request *req)
static void drbd_report_io_error(struct drbd_device *mdev, struct drbd_request *req)
{
char b[BDEVNAME_SIZE];
......@@ -453,7 +453,7 @@ static void drbd_report_io_error(struct drbd_conf *mdev, struct drbd_request *re
int __req_mod(struct drbd_request *req, enum drbd_req_event what,
struct bio_and_error *m)
{
struct drbd_conf *mdev = req->w.mdev;
struct drbd_device *mdev = req->w.mdev;
struct net_conf *nc;
int p, rv = 0;
......@@ -771,7 +771,7 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what,
* since size may be bigger than BM_BLOCK_SIZE,
* we may need to check several bits.
*/
static bool drbd_may_do_local_read(struct drbd_conf *mdev, sector_t sector, int size)
static bool drbd_may_do_local_read(struct drbd_device *mdev, sector_t sector, int size)
{
unsigned long sbnr, ebnr;
sector_t esector, nr_sectors;
......@@ -791,7 +791,7 @@ static bool drbd_may_do_local_read(struct drbd_conf *mdev, sector_t sector, int
return drbd_bm_count_bits(mdev, sbnr, ebnr) == 0;
}
static bool remote_due_to_read_balancing(struct drbd_conf *mdev, sector_t sector,
static bool remote_due_to_read_balancing(struct drbd_device *mdev, sector_t sector,
enum drbd_read_balancing rbm)
{
struct backing_dev_info *bdi;
......@@ -834,7 +834,7 @@ static bool remote_due_to_read_balancing(struct drbd_conf *mdev, sector_t sector
static void complete_conflicting_writes(struct drbd_request *req)
{
DEFINE_WAIT(wait);
struct drbd_conf *mdev = req->w.mdev;
struct drbd_device *mdev = req->w.mdev;
struct drbd_interval *i;
sector_t sector = req->i.sector;
int size = req->i.size;
......@@ -858,7 +858,7 @@ static void complete_conflicting_writes(struct drbd_request *req)
}
/* called within req_lock and rcu_read_lock() */
static void maybe_pull_ahead(struct drbd_conf *mdev)
static void maybe_pull_ahead(struct drbd_device *mdev)
{
struct drbd_tconn *tconn = mdev->tconn;
struct net_conf *nc;
......@@ -914,7 +914,7 @@ static void maybe_pull_ahead(struct drbd_conf *mdev)
*/
static bool do_remote_read(struct drbd_request *req)
{
struct drbd_conf *mdev = req->w.mdev;
struct drbd_device *mdev = req->w.mdev;
enum drbd_read_balancing rbm;
if (req->private_bio) {
......@@ -959,7 +959,7 @@ static bool do_remote_read(struct drbd_request *req)
* which does NOT include those that we are L_AHEAD for. */
static int drbd_process_write_request(struct drbd_request *req)
{
struct drbd_conf *mdev = req->w.mdev;
struct drbd_device *mdev = req->w.mdev;
int remote, send_oos;
remote = drbd_should_do_remote(mdev->state);
......@@ -996,7 +996,7 @@ static int drbd_process_write_request(struct drbd_request *req)
static void
drbd_submit_req_private_bio(struct drbd_request *req)
{
struct drbd_conf *mdev = req->w.mdev;
struct drbd_device *mdev = req->w.mdev;
struct bio *bio = req->private_bio;
const int rw = bio_rw(bio);
......@@ -1020,7 +1020,7 @@ drbd_submit_req_private_bio(struct drbd_request *req)
bio_endio(bio, -EIO);
}
static void drbd_queue_write(struct drbd_conf *mdev, struct drbd_request *req)
static void drbd_queue_write(struct drbd_device *mdev, struct drbd_request *req)
{
spin_lock(&mdev->submit.lock);
list_add_tail(&req->tl_requests, &mdev->submit.writes);
......@@ -1034,7 +1034,7 @@ static void drbd_queue_write(struct drbd_conf *mdev, struct drbd_request *req)
* Returns ERR_PTR(-ENOMEM) if we cannot allocate a drbd_request.
*/
static struct drbd_request *
drbd_request_prepare(struct drbd_conf *mdev, struct bio *bio, unsigned long start_time)
drbd_request_prepare(struct drbd_device *mdev, struct bio *bio, unsigned long start_time)
{
const int rw = bio_data_dir(bio);
struct drbd_request *req;
......@@ -1071,7 +1071,7 @@ drbd_request_prepare(struct drbd_conf *mdev, struct bio *bio, unsigned long star
return req;
}
static void drbd_send_and_submit(struct drbd_conf *mdev, struct drbd_request *req)
static void drbd_send_and_submit(struct drbd_device *mdev, struct drbd_request *req)
{
const int rw = bio_rw(req->master_bio);
struct bio_and_error m = { NULL, };
......@@ -1160,7 +1160,7 @@ static void drbd_send_and_submit(struct drbd_conf *mdev, struct drbd_request *re
complete_master_bio(mdev, &m);
}
void __drbd_make_request(struct drbd_conf *mdev, struct bio *bio, unsigned long start_time)
void __drbd_make_request(struct drbd_device *mdev, struct bio *bio, unsigned long start_time)
{
struct drbd_request *req = drbd_request_prepare(mdev, bio, start_time);
if (IS_ERR_OR_NULL(req))
......@@ -1168,7 +1168,7 @@ void __drbd_make_request(struct drbd_conf *mdev, struct bio *bio, unsigned long
drbd_send_and_submit(mdev, req);
}
static void submit_fast_path(struct drbd_conf *mdev, struct list_head *incoming)
static void submit_fast_path(struct drbd_device *mdev, struct list_head *incoming)
{
struct drbd_request *req, *tmp;
list_for_each_entry_safe(req, tmp, incoming, tl_requests) {
......@@ -1188,7 +1188,7 @@ static void submit_fast_path(struct drbd_conf *mdev, struct list_head *incoming)
}
}
static bool prepare_al_transaction_nonblock(struct drbd_conf *mdev,
static bool prepare_al_transaction_nonblock(struct drbd_device *mdev,
struct list_head *incoming,
struct list_head *pending)
{
......@@ -1215,7 +1215,7 @@ static bool prepare_al_transaction_nonblock(struct drbd_conf *mdev,
void do_submit(struct work_struct *ws)
{
struct drbd_conf *mdev = container_of(ws, struct drbd_conf, submit.worker);
struct drbd_device *mdev = container_of(ws, struct drbd_device, submit.worker);
LIST_HEAD(incoming);
LIST_HEAD(pending);
struct drbd_request *req, *tmp;
......@@ -1272,7 +1272,7 @@ void do_submit(struct work_struct *ws)
void drbd_make_request(struct request_queue *q, struct bio *bio)
{
struct drbd_conf *mdev = (struct drbd_conf *) q->queuedata;
struct drbd_device *mdev = (struct drbd_device *) q->queuedata;
unsigned long start_time;
start_time = jiffies;
......@@ -1300,7 +1300,7 @@ void drbd_make_request(struct request_queue *q, struct bio *bio)
*/
int drbd_merge_bvec(struct request_queue *q, struct bvec_merge_data *bvm, struct bio_vec *bvec)
{
struct drbd_conf *mdev = (struct drbd_conf *) q->queuedata;
struct drbd_device *mdev = (struct drbd_device *) q->queuedata;
unsigned int bio_size = bvm->bi_size;
int limit = DRBD_MAX_BIO_SIZE;
int backing_limit;
......@@ -1334,7 +1334,7 @@ static struct drbd_request *find_oldest_request(struct drbd_tconn *tconn)
void request_timer_fn(unsigned long data)
{
struct drbd_conf *mdev = (struct drbd_conf *) data;
struct drbd_device *mdev = (struct drbd_device *) data;
struct drbd_tconn *tconn = mdev->tconn;
struct drbd_request *req; /* oldest request */
struct net_conf *nc;
......
......@@ -281,7 +281,7 @@ extern void _req_may_be_done(struct drbd_request *req,
struct bio_and_error *m);
extern int __req_mod(struct drbd_request *req, enum drbd_req_event what,
struct bio_and_error *m);
extern void complete_master_bio(struct drbd_conf *mdev,
extern void complete_master_bio(struct drbd_device *mdev,
struct bio_and_error *m);
extern void request_timer_fn(unsigned long data);
extern void tl_restart(struct drbd_tconn *tconn, enum drbd_req_event what);
......@@ -294,7 +294,7 @@ extern void drbd_restart_request(struct drbd_request *req);
* outside the spinlock, e.g. when walking some list on cleanup. */
static inline int _req_mod(struct drbd_request *req, enum drbd_req_event what)
{
struct drbd_conf *mdev = req->w.mdev;
struct drbd_device *mdev = req->w.mdev;
struct bio_and_error m;
int rv;
......@@ -314,7 +314,7 @@ static inline int req_mod(struct drbd_request *req,
enum drbd_req_event what)
{
unsigned long flags;
struct drbd_conf *mdev = req->w.mdev;
struct drbd_device *mdev = req->w.mdev;
struct bio_and_error m;
int rv;
......
This diff is collapsed.
#ifndef DRBD_STATE_H
#define DRBD_STATE_H
struct drbd_conf;
struct drbd_device;
struct drbd_tconn;
/**
......@@ -107,20 +107,20 @@ union drbd_dev_state {
unsigned int i;
};
extern enum drbd_state_rv drbd_change_state(struct drbd_conf *mdev,
extern enum drbd_state_rv drbd_change_state(struct drbd_device *mdev,
enum chg_state_flags f,
union drbd_state mask,
union drbd_state val);
extern void drbd_force_state(struct drbd_conf *, union drbd_state,
extern void drbd_force_state(struct drbd_device *, union drbd_state,
union drbd_state);
extern enum drbd_state_rv _drbd_request_state(struct drbd_conf *,
extern enum drbd_state_rv _drbd_request_state(struct drbd_device *,
union drbd_state,
union drbd_state,
enum chg_state_flags);
extern enum drbd_state_rv __drbd_set_state(struct drbd_conf *, union drbd_state,
extern enum drbd_state_rv __drbd_set_state(struct drbd_device *, union drbd_state,
enum chg_state_flags,
struct completion *done);
extern void print_st_err(struct drbd_conf *, union drbd_state,
extern void print_st_err(struct drbd_device *, union drbd_state,
union drbd_state, int);
enum drbd_state_rv
......@@ -131,7 +131,7 @@ enum drbd_state_rv
conn_request_state(struct drbd_tconn *tconn, union drbd_state mask, union drbd_state val,
enum chg_state_flags flags);
extern void drbd_resume_al(struct drbd_conf *mdev);
extern void drbd_resume_al(struct drbd_device *mdev);
extern bool conn_all_vols_unconf(struct drbd_tconn *tconn);
/**
......@@ -144,7 +144,7 @@ extern bool conn_all_vols_unconf(struct drbd_tconn *tconn);
* quite verbose in case the state change is not possible, and all those
* state changes are globally serialized.
*/
static inline int drbd_request_state(struct drbd_conf *mdev,
static inline int drbd_request_state(struct drbd_device *mdev,
union drbd_state mask,
union drbd_state val)
{
......
This diff is collapsed.
......@@ -9,7 +9,7 @@
extern char *drbd_sec_holder;
/* sets the number of 512 byte sectors of our virtual device */
static inline void drbd_set_my_capacity(struct drbd_conf *mdev,
static inline void drbd_set_my_capacity(struct drbd_device *mdev,
sector_t size)
{
/* set_capacity(mdev->this_bdev->bd_disk, size); */
......@@ -27,7 +27,7 @@ extern void drbd_request_endio(struct bio *bio, int error);
/*
* used to submit our private bio
*/
static inline void drbd_generic_make_request(struct drbd_conf *mdev,
static inline void drbd_generic_make_request(struct drbd_device *mdev,
int fault_type, struct bio *bio)
{
__release(local);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment