···105105};106106107107108108-void *drbd_md_get_buffer(struct drbd_conf *mdev)108108+void *drbd_md_get_buffer(struct drbd_device *mdev)109109{110110 int r;111111···116116 return r ? NULL : page_address(mdev->md_io_page);117117}118118119119-void drbd_md_put_buffer(struct drbd_conf *mdev)119119+void drbd_md_put_buffer(struct drbd_device *mdev)120120{121121 if (atomic_dec_and_test(&mdev->md_io_in_use))122122 wake_up(&mdev->misc_wait);123123}124124125125-void wait_until_done_or_force_detached(struct drbd_conf *mdev, struct drbd_backing_dev *bdev,125125+void wait_until_done_or_force_detached(struct drbd_device *mdev, struct drbd_backing_dev *bdev,126126 unsigned int *done)127127{128128 long dt;···142142 }143143}144144145145-static int _drbd_md_sync_page_io(struct drbd_conf *mdev,145145+static int _drbd_md_sync_page_io(struct drbd_device *mdev,146146 struct drbd_backing_dev *bdev,147147 struct page *page, sector_t sector,148148 int rw, int size)···192192 return err;193193}194194195195-int drbd_md_sync_page_io(struct drbd_conf *mdev, struct drbd_backing_dev *bdev,195195+int drbd_md_sync_page_io(struct drbd_device *mdev, struct drbd_backing_dev *bdev,196196 sector_t sector, int rw)197197{198198 int err;···222222 return err;223223}224224225225-static struct bm_extent *find_active_resync_extent(struct drbd_conf *mdev, unsigned int enr)225225+static struct bm_extent *find_active_resync_extent(struct drbd_device *mdev, unsigned int enr)226226{227227 struct lc_element *tmp;228228 tmp = lc_find(mdev->resync, enr/AL_EXT_PER_BM_SECT);···234234 return NULL;235235}236236237237-static struct lc_element *_al_get(struct drbd_conf *mdev, unsigned int enr, bool nonblock)237237+static struct lc_element *_al_get(struct drbd_device *mdev, unsigned int enr, bool nonblock)238238{239239 struct lc_element *al_ext;240240 struct bm_extent *bm_ext;···257257 return al_ext;258258}259259260260-bool drbd_al_begin_io_fastpath(struct drbd_conf *mdev, struct drbd_interval *i)260260+bool drbd_al_begin_io_fastpath(struct drbd_device *mdev, struct drbd_interval *i)261261{262262 /* for bios crossing activity log extent boundaries,263263 * we may need to activate two extents in one go */···275275}276276277277static278278-bool drbd_al_begin_io_prepare(struct drbd_conf *mdev, struct drbd_interval *i)278278+bool drbd_al_begin_io_prepare(struct drbd_device *mdev, struct drbd_interval *i)279279{280280 /* for bios crossing activity log extent boundaries,281281 * we may need to activate two extents in one go */···297297 return need_transaction;298298}299299300300-static int al_write_transaction(struct drbd_conf *mdev, bool delegate);300300+static int al_write_transaction(struct drbd_device *mdev, bool delegate);301301302302/* When called through generic_make_request(), we must delegate303303 * activity log I/O to the worker thread: a further request···311311/*312312 * @delegate: delegate activity log I/O to the worker thread313313 */314314-void drbd_al_begin_io_commit(struct drbd_conf *mdev, bool delegate)314314+void drbd_al_begin_io_commit(struct drbd_device *mdev, bool delegate)315315{316316 bool locked = false;317317···352352/*353353 * @delegate: delegate activity log I/O to the worker thread354354 */355355-void drbd_al_begin_io(struct drbd_conf *mdev, struct drbd_interval *i, bool delegate)355355+void drbd_al_begin_io(struct drbd_device *mdev, struct drbd_interval *i, bool delegate)356356{357357 BUG_ON(delegate && current == mdev->tconn->worker.task);358358···360360 drbd_al_begin_io_commit(mdev, delegate);361361}362362363363-int drbd_al_begin_io_nonblock(struct drbd_conf *mdev, struct drbd_interval *i)363363+int drbd_al_begin_io_nonblock(struct drbd_device *mdev, struct drbd_interval *i)364364{365365 struct lru_cache *al = mdev->act_log;366366 /* for bios crossing activity log extent boundaries,···409409 return 0;410410}411411412412-void drbd_al_complete_io(struct drbd_conf *mdev, struct drbd_interval *i)412412+void drbd_al_complete_io(struct drbd_device *mdev, struct drbd_interval *i)413413{414414 /* for bios crossing activity log extent boundaries,415415 * we may need to activate two extents in one go */···461461 (BM_EXT_SHIFT - BM_BLOCK_SHIFT));462462}463463464464-static sector_t al_tr_number_to_on_disk_sector(struct drbd_conf *mdev)464464+static sector_t al_tr_number_to_on_disk_sector(struct drbd_device *mdev)465465{466466 const unsigned int stripes = mdev->ldev->md.al_stripes;467467 const unsigned int stripe_size_4kB = mdev->ldev->md.al_stripe_size_4k;···480480}481481482482static int483483-_al_write_transaction(struct drbd_conf *mdev)483483+_al_write_transaction(struct drbd_device *mdev)484484{485485 struct al_transaction_on_disk *buffer;486486 struct lc_element *e;···594594static int w_al_write_transaction(struct drbd_work *w, int unused)595595{596596 struct update_al_work *aw = container_of(w, struct update_al_work, w);597597- struct drbd_conf *mdev = w->mdev;597597+ struct drbd_device *mdev = w->mdev;598598 int err;599599600600 err = _al_write_transaction(mdev);···607607/* Calls from worker context (see w_restart_disk_io()) need to write the608608 transaction directly. Others came through generic_make_request(),609609 those need to delegate it to the worker. */610610-static int al_write_transaction(struct drbd_conf *mdev, bool delegate)610610+static int al_write_transaction(struct drbd_device *mdev, bool delegate)611611{612612 if (delegate) {613613 struct update_al_work al_work;···621621 return _al_write_transaction(mdev);622622}623623624624-static int _try_lc_del(struct drbd_conf *mdev, struct lc_element *al_ext)624624+static int _try_lc_del(struct drbd_device *mdev, struct lc_element *al_ext)625625{626626 int rv;627627···643643 *644644 * You need to lock mdev->act_log with lc_try_lock() / lc_unlock()645645 */646646-void drbd_al_shrink(struct drbd_conf *mdev)646646+void drbd_al_shrink(struct drbd_device *mdev)647647{648648 struct lc_element *al_ext;649649 int i;···660660 wake_up(&mdev->al_wait);661661}662662663663-int drbd_initialize_al(struct drbd_conf *mdev, void *buffer)663663+int drbd_initialize_al(struct drbd_device *mdev, void *buffer)664664{665665 struct al_transaction_on_disk *al = buffer;666666 struct drbd_md *md = &mdev->ldev->md;···684684static int w_update_odbm(struct drbd_work *w, int unused)685685{686686 struct update_odbm_work *udw = container_of(w, struct update_odbm_work, w);687687- struct drbd_conf *mdev = w->mdev;687687+ struct drbd_device *mdev = w->mdev;688688 struct sib_info sib = { .sib_reason = SIB_SYNC_PROGRESS, };689689690690 if (!get_ldev(mdev)) {···721721 *722722 * TODO will be obsoleted once we have a caching lru of the on disk bitmap723723 */724724-static void drbd_try_clear_on_disk_bm(struct drbd_conf *mdev, sector_t sector,724724+static void drbd_try_clear_on_disk_bm(struct drbd_device *mdev, sector_t sector,725725 int count, int success)726726{727727 struct lc_element *e;···809809 }810810}811811812812-void drbd_advance_rs_marks(struct drbd_conf *mdev, unsigned long still_to_go)812812+void drbd_advance_rs_marks(struct drbd_device *mdev, unsigned long still_to_go)813813{814814 unsigned long now = jiffies;815815 unsigned long last = mdev->rs_mark_time[mdev->rs_last_mark];···832832 * called by worker on C_SYNC_TARGET and receiver on SyncSource.833833 *834834 */835835-void __drbd_set_in_sync(struct drbd_conf *mdev, sector_t sector, int size,835835+void __drbd_set_in_sync(struct drbd_device *mdev, sector_t sector, int size,836836 const char *file, const unsigned int line)837837{838838 /* Is called from worker and receiver context _only_ */···904904 * called by tl_clear and drbd_send_dblock (==drbd_make_request).905905 * so this can be _any_ process.906906 */907907-int __drbd_set_out_of_sync(struct drbd_conf *mdev, sector_t sector, int size,907907+int __drbd_set_out_of_sync(struct drbd_device *mdev, sector_t sector, int size,908908 const char *file, const unsigned int line)909909{910910 unsigned long sbnr, ebnr, flags;···956956}957957958958static959959-struct bm_extent *_bme_get(struct drbd_conf *mdev, unsigned int enr)959959+struct bm_extent *_bme_get(struct drbd_device *mdev, unsigned int enr)960960{961961 struct lc_element *e;962962 struct bm_extent *bm_ext;···996996 return bm_ext;997997}998998999999-static int _is_in_al(struct drbd_conf *mdev, unsigned int enr)999999+static int _is_in_al(struct drbd_device *mdev, unsigned int enr)10001000{10011001 int rv;10021002···10141014 *10151015 * This functions sleeps on al_wait. Returns 0 on success, -EINTR if interrupted.10161016 */10171017-int drbd_rs_begin_io(struct drbd_conf *mdev, sector_t sector)10171017+int drbd_rs_begin_io(struct drbd_device *mdev, sector_t sector)10181018{10191019 unsigned int enr = BM_SECT_TO_EXT(sector);10201020 struct bm_extent *bm_ext;···10671067 * tries to set it to BME_LOCKED. Returns 0 upon success, and -EAGAIN10681068 * if there is still application IO going on in this area.10691069 */10701070-int drbd_try_rs_begin_io(struct drbd_conf *mdev, sector_t sector)10701070+int drbd_try_rs_begin_io(struct drbd_device *mdev, sector_t sector)10711071{10721072 unsigned int enr = BM_SECT_TO_EXT(sector);10731073 const unsigned int al_enr = enr*AL_EXT_PER_BM_SECT;···11661166 return -EAGAIN;11671167}1168116811691169-void drbd_rs_complete_io(struct drbd_conf *mdev, sector_t sector)11691169+void drbd_rs_complete_io(struct drbd_device *mdev, sector_t sector)11701170{11711171 unsigned int enr = BM_SECT_TO_EXT(sector);11721172 struct lc_element *e;···12041204 * drbd_rs_cancel_all() - Removes all extents from the resync LRU (even BME_LOCKED)12051205 * @mdev: DRBD device.12061206 */12071207-void drbd_rs_cancel_all(struct drbd_conf *mdev)12071207+void drbd_rs_cancel_all(struct drbd_device *mdev)12081208{12091209 spin_lock_irq(&mdev->al_lock);12101210···12251225 * Returns 0 upon success, -EAGAIN if at least one reference count was12261226 * not zero.12271227 */12281228-int drbd_rs_del_all(struct drbd_conf *mdev)12281228+int drbd_rs_del_all(struct drbd_device *mdev)12291229{12301230 struct lc_element *e;12311231 struct bm_extent *bm_ext;···12761276 * @sector: The sector number.12771277 * @size: Size of failed IO operation, in byte.12781278 */12791279-void drbd_rs_failed_io(struct drbd_conf *mdev, sector_t sector, int size)12791279+void drbd_rs_failed_io(struct drbd_device *mdev, sector_t sector, int size)12801280{12811281 /* Is called from worker and receiver context _only_ */12821282 unsigned long sbnr, ebnr, lbnr;
+43-43
drivers/block/drbd/drbd_bitmap.c
···113113};114114115115#define bm_print_lock_info(m) __bm_print_lock_info(m, __func__)116116-static void __bm_print_lock_info(struct drbd_conf *mdev, const char *func)116116+static void __bm_print_lock_info(struct drbd_device *mdev, const char *func)117117{118118 struct drbd_bitmap *b = mdev->bitmap;119119 if (!__ratelimit(&drbd_ratelimit_state))···124124 drbd_task_to_thread_name(mdev->tconn, b->bm_task));125125}126126127127-void drbd_bm_lock(struct drbd_conf *mdev, char *why, enum bm_flag flags)127127+void drbd_bm_lock(struct drbd_device *mdev, char *why, enum bm_flag flags)128128{129129 struct drbd_bitmap *b = mdev->bitmap;130130 int trylock_failed;···151151 b->bm_task = current;152152}153153154154-void drbd_bm_unlock(struct drbd_conf *mdev)154154+void drbd_bm_unlock(struct drbd_device *mdev)155155{156156 struct drbd_bitmap *b = mdev->bitmap;157157 if (!b) {···211211/* As is very unlikely that the same page is under IO from more than one212212 * context, we can get away with a bit per page and one wait queue per bitmap.213213 */214214-static void bm_page_lock_io(struct drbd_conf *mdev, int page_nr)214214+static void bm_page_lock_io(struct drbd_device *mdev, int page_nr)215215{216216 struct drbd_bitmap *b = mdev->bitmap;217217 void *addr = &page_private(b->bm_pages[page_nr]);218218 wait_event(b->bm_io_wait, !test_and_set_bit(BM_PAGE_IO_LOCK, addr));219219}220220221221-static void bm_page_unlock_io(struct drbd_conf *mdev, int page_nr)221221+static void bm_page_unlock_io(struct drbd_device *mdev, int page_nr)222222{223223 struct drbd_bitmap *b = mdev->bitmap;224224 void *addr = &page_private(b->bm_pages[page_nr]);···249249 * hints, then call drbd_bm_write_hinted(), which will only write out changed250250 * pages which are flagged with this mark.251251 */252252-void drbd_bm_mark_for_writeout(struct drbd_conf *mdev, int page_nr)252252+void drbd_bm_mark_for_writeout(struct drbd_device *mdev, int page_nr)253253{254254 struct page *page;255255 if (page_nr >= mdev->bitmap->bm_number_of_pages) {···340340341341/*342342 * actually most functions herein should take a struct drbd_bitmap*, not a343343- * struct drbd_conf*, but for the debug macros I like to have the mdev around343343+ * struct drbd_device*, but for the debug macros I like to have the mdev around344344 * to be able to report device specific.345345 */346346···438438 * called on driver init only. TODO call when a device is created.439439 * allocates the drbd_bitmap, and stores it in mdev->bitmap.440440 */441441-int drbd_bm_init(struct drbd_conf *mdev)441441+int drbd_bm_init(struct drbd_device *mdev)442442{443443 struct drbd_bitmap *b = mdev->bitmap;444444 WARN_ON(b != NULL);···454454 return 0;455455}456456457457-sector_t drbd_bm_capacity(struct drbd_conf *mdev)457457+sector_t drbd_bm_capacity(struct drbd_device *mdev)458458{459459 if (!expect(mdev->bitmap))460460 return 0;···463463464464/* called on driver unload. TODO: call when a device is destroyed.465465 */466466-void drbd_bm_cleanup(struct drbd_conf *mdev)466466+void drbd_bm_cleanup(struct drbd_device *mdev)467467{468468 if (!expect(mdev->bitmap))469469 return;···631631 * In case this is actually a resize, we copy the old bitmap into the new one.632632 * Otherwise, the bitmap is initialized to all bits set.633633 */634634-int drbd_bm_resize(struct drbd_conf *mdev, sector_t capacity, int set_new_bits)634634+int drbd_bm_resize(struct drbd_device *mdev, sector_t capacity, int set_new_bits)635635{636636 struct drbd_bitmap *b = mdev->bitmap;637637 unsigned long bits, words, owords, obits;···757757 *758758 * maybe bm_set should be atomic_t ?759759 */760760-unsigned long _drbd_bm_total_weight(struct drbd_conf *mdev)760760+unsigned long _drbd_bm_total_weight(struct drbd_device *mdev)761761{762762 struct drbd_bitmap *b = mdev->bitmap;763763 unsigned long s;···775775 return s;776776}777777778778-unsigned long drbd_bm_total_weight(struct drbd_conf *mdev)778778+unsigned long drbd_bm_total_weight(struct drbd_device *mdev)779779{780780 unsigned long s;781781 /* if I don't have a disk, I don't know about out-of-sync status */···786786 return s;787787}788788789789-size_t drbd_bm_words(struct drbd_conf *mdev)789789+size_t drbd_bm_words(struct drbd_device *mdev)790790{791791 struct drbd_bitmap *b = mdev->bitmap;792792 if (!expect(b))···797797 return b->bm_words;798798}799799800800-unsigned long drbd_bm_bits(struct drbd_conf *mdev)800800+unsigned long drbd_bm_bits(struct drbd_device *mdev)801801{802802 struct drbd_bitmap *b = mdev->bitmap;803803 if (!expect(b))···811811 * bitmap must be locked by drbd_bm_lock.812812 * currently only used from receive_bitmap.813813 */814814-void drbd_bm_merge_lel(struct drbd_conf *mdev, size_t offset, size_t number,814814+void drbd_bm_merge_lel(struct drbd_device *mdev, size_t offset, size_t number,815815 unsigned long *buffer)816816{817817 struct drbd_bitmap *b = mdev->bitmap;···860860/* copy number words from the bitmap starting at offset into the buffer.861861 * buffer[i] will be little endian unsigned long.862862 */863863-void drbd_bm_get_lel(struct drbd_conf *mdev, size_t offset, size_t number,863863+void drbd_bm_get_lel(struct drbd_device *mdev, size_t offset, size_t number,864864 unsigned long *buffer)865865{866866 struct drbd_bitmap *b = mdev->bitmap;···897897}898898899899/* set all bits in the bitmap */900900-void drbd_bm_set_all(struct drbd_conf *mdev)900900+void drbd_bm_set_all(struct drbd_device *mdev)901901{902902 struct drbd_bitmap *b = mdev->bitmap;903903 if (!expect(b))···913913}914914915915/* clear all bits in the bitmap */916916-void drbd_bm_clear_all(struct drbd_conf *mdev)916916+void drbd_bm_clear_all(struct drbd_device *mdev)917917{918918 struct drbd_bitmap *b = mdev->bitmap;919919 if (!expect(b))···928928}929929930930struct bm_aio_ctx {931931- struct drbd_conf *mdev;931931+ struct drbd_device *mdev;932932 atomic_t in_flight;933933 unsigned int done;934934 unsigned flags;···951951static void bm_async_io_complete(struct bio *bio, int error)952952{953953 struct bm_aio_ctx *ctx = bio->bi_private;954954- struct drbd_conf *mdev = ctx->mdev;954954+ struct drbd_device *mdev = ctx->mdev;955955 struct drbd_bitmap *b = mdev->bitmap;956956 unsigned int idx = bm_page_to_idx(bio->bi_io_vec[0].bv_page);957957 int uptodate = bio_flagged(bio, BIO_UPTODATE);···10001000static void bm_page_io_async(struct bm_aio_ctx *ctx, int page_nr, int rw) __must_hold(local)10011001{10021002 struct bio *bio = bio_alloc_drbd(GFP_NOIO);10031003- struct drbd_conf *mdev = ctx->mdev;10031003+ struct drbd_device *mdev = ctx->mdev;10041004 struct drbd_bitmap *b = mdev->bitmap;10051005 struct page *page;10061006 unsigned int len;···10491049/*10501050 * bm_rw: read/write the whole bitmap from/to its on disk location.10511051 */10521052-static int bm_rw(struct drbd_conf *mdev, int rw, unsigned flags, unsigned lazy_writeout_upper_idx) __must_hold(local)10521052+static int bm_rw(struct drbd_device *mdev, int rw, unsigned flags, unsigned lazy_writeout_upper_idx) __must_hold(local)10531053{10541054 struct bm_aio_ctx *ctx;10551055 struct drbd_bitmap *b = mdev->bitmap;···11731173 * drbd_bm_read() - Read the whole bitmap from its on disk location.11741174 * @mdev: DRBD device.11751175 */11761176-int drbd_bm_read(struct drbd_conf *mdev) __must_hold(local)11761176+int drbd_bm_read(struct drbd_device *mdev) __must_hold(local)11771177{11781178 return bm_rw(mdev, READ, 0, 0);11791179}···11841184 *11851185 * Will only write pages that have changed since last IO.11861186 */11871187-int drbd_bm_write(struct drbd_conf *mdev) __must_hold(local)11871187+int drbd_bm_write(struct drbd_device *mdev) __must_hold(local)11881188{11891189 return bm_rw(mdev, WRITE, 0, 0);11901190}···11951195 *11961196 * Will write all pages.11971197 */11981198-int drbd_bm_write_all(struct drbd_conf *mdev) __must_hold(local)11981198+int drbd_bm_write_all(struct drbd_device *mdev) __must_hold(local)11991199{12001200 return bm_rw(mdev, WRITE, BM_WRITE_ALL_PAGES, 0);12011201}···12111211 * verify is aborted due to a failed peer disk, while local IO continues, or12121212 * pending resync acks are still being processed.12131213 */12141214-int drbd_bm_write_copy_pages(struct drbd_conf *mdev) __must_hold(local)12141214+int drbd_bm_write_copy_pages(struct drbd_device *mdev) __must_hold(local)12151215{12161216 return bm_rw(mdev, WRITE, BM_AIO_COPY_PAGES, 0);12171217}···12201220 * drbd_bm_write_hinted() - Write bitmap pages with "hint" marks, if they have changed.12211221 * @mdev: DRBD device.12221222 */12231223-int drbd_bm_write_hinted(struct drbd_conf *mdev) __must_hold(local)12231223+int drbd_bm_write_hinted(struct drbd_device *mdev) __must_hold(local)12241224{12251225 return bm_rw(mdev, WRITE, BM_AIO_WRITE_HINTED | BM_AIO_COPY_PAGES, 0);12261226}···12371237 * In case this becomes an issue on systems with larger PAGE_SIZE,12381238 * we may want to change this again to write 4k aligned 4k pieces.12391239 */12401240-int drbd_bm_write_page(struct drbd_conf *mdev, unsigned int idx) __must_hold(local)12401240+int drbd_bm_write_page(struct drbd_device *mdev, unsigned int idx) __must_hold(local)12411241{12421242 struct bm_aio_ctx *ctx;12431243 int err;···12881288 *12891289 * this returns a bit number, NOT a sector!12901290 */12911291-static unsigned long __bm_find_next(struct drbd_conf *mdev, unsigned long bm_fo,12911291+static unsigned long __bm_find_next(struct drbd_device *mdev, unsigned long bm_fo,12921292 const int find_zero_bit)12931293{12941294 struct drbd_bitmap *b = mdev->bitmap;···13281328 return bm_fo;13291329}1330133013311331-static unsigned long bm_find_next(struct drbd_conf *mdev,13311331+static unsigned long bm_find_next(struct drbd_device *mdev,13321332 unsigned long bm_fo, const int find_zero_bit)13331333{13341334 struct drbd_bitmap *b = mdev->bitmap;···13491349 return i;13501350}1351135113521352-unsigned long drbd_bm_find_next(struct drbd_conf *mdev, unsigned long bm_fo)13521352+unsigned long drbd_bm_find_next(struct drbd_device *mdev, unsigned long bm_fo)13531353{13541354 return bm_find_next(mdev, bm_fo, 0);13551355}1356135613571357#if 013581358/* not yet needed for anything. */13591359-unsigned long drbd_bm_find_next_zero(struct drbd_conf *mdev, unsigned long bm_fo)13591359+unsigned long drbd_bm_find_next_zero(struct drbd_device *mdev, unsigned long bm_fo)13601360{13611361 return bm_find_next(mdev, bm_fo, 1);13621362}···1364136413651365/* does not spin_lock_irqsave.13661366 * you must take drbd_bm_lock() first */13671367-unsigned long _drbd_bm_find_next(struct drbd_conf *mdev, unsigned long bm_fo)13671367+unsigned long _drbd_bm_find_next(struct drbd_device *mdev, unsigned long bm_fo)13681368{13691369 /* WARN_ON(!(BM_DONT_SET & mdev->b->bm_flags)); */13701370 return __bm_find_next(mdev, bm_fo, 0);13711371}1372137213731373-unsigned long _drbd_bm_find_next_zero(struct drbd_conf *mdev, unsigned long bm_fo)13731373+unsigned long _drbd_bm_find_next_zero(struct drbd_device *mdev, unsigned long bm_fo)13741374{13751375 /* WARN_ON(!(BM_DONT_SET & mdev->b->bm_flags)); */13761376 return __bm_find_next(mdev, bm_fo, 1);···13821382 * wants bitnr, not sector.13831383 * expected to be called for only a few bits (e - s about BITS_PER_LONG).13841384 * Must hold bitmap lock already. */13851385-static int __bm_change_bits_to(struct drbd_conf *mdev, const unsigned long s,13851385+static int __bm_change_bits_to(struct drbd_device *mdev, const unsigned long s,13861386 unsigned long e, int val)13871387{13881388 struct drbd_bitmap *b = mdev->bitmap;···14311431 * for val != 0, we change 0 -> 1, return code positive14321432 * for val == 0, we change 1 -> 0, return code negative14331433 * wants bitnr, not sector */14341434-static int bm_change_bits_to(struct drbd_conf *mdev, const unsigned long s,14341434+static int bm_change_bits_to(struct drbd_device *mdev, const unsigned long s,14351435 const unsigned long e, int val)14361436{14371437 unsigned long flags;···14541454}1455145514561456/* returns number of bits changed 0 -> 1 */14571457-int drbd_bm_set_bits(struct drbd_conf *mdev, const unsigned long s, const unsigned long e)14571457+int drbd_bm_set_bits(struct drbd_device *mdev, const unsigned long s, const unsigned long e)14581458{14591459 return bm_change_bits_to(mdev, s, e, 1);14601460}1461146114621462/* returns number of bits changed 1 -> 0 */14631463-int drbd_bm_clear_bits(struct drbd_conf *mdev, const unsigned long s, const unsigned long e)14631463+int drbd_bm_clear_bits(struct drbd_device *mdev, const unsigned long s, const unsigned long e)14641464{14651465 return -bm_change_bits_to(mdev, s, e, 0);14661466}···14941494 * You must first drbd_bm_lock().14951495 * Can be called to set the whole bitmap in one go.14961496 * Sets bits from s to e _inclusive_. */14971497-void _drbd_bm_set_bits(struct drbd_conf *mdev, const unsigned long s, const unsigned long e)14971497+void _drbd_bm_set_bits(struct drbd_device *mdev, const unsigned long s, const unsigned long e)14981498{14991499 /* First set_bit from the first bit (s)15001500 * up to the next long boundary (sl),···15741574 * 0 ... bit not set15751575 * -1 ... first out of bounds access, stop testing for bits!15761576 */15771577-int drbd_bm_test_bit(struct drbd_conf *mdev, const unsigned long bitnr)15771577+int drbd_bm_test_bit(struct drbd_device *mdev, const unsigned long bitnr)15781578{15791579 unsigned long flags;15801580 struct drbd_bitmap *b = mdev->bitmap;···16051605}1606160616071607/* returns number of bits set in the range [s, e] */16081608-int drbd_bm_count_bits(struct drbd_conf *mdev, const unsigned long s, const unsigned long e)16081608+int drbd_bm_count_bits(struct drbd_device *mdev, const unsigned long s, const unsigned long e)16091609{16101610 unsigned long flags;16111611 struct drbd_bitmap *b = mdev->bitmap;···16601660 * reference count of some bitmap extent element from some lru instead...16611661 *16621662 */16631663-int drbd_bm_e_weight(struct drbd_conf *mdev, unsigned long enr)16631663+int drbd_bm_e_weight(struct drbd_device *mdev, unsigned long enr)16641664{16651665 struct drbd_bitmap *b = mdev->bitmap;16661666 int count, s, e;
+173-173
drivers/block/drbd/drbd_int.h
···6666extern unsigned int minor_count;6767extern bool disable_sendpage;6868extern bool allow_oos;6969-void tl_abort_disk_io(struct drbd_conf *mdev);6969+void tl_abort_disk_io(struct drbd_device *mdev);70707171#ifdef CONFIG_DRBD_FAULT_INJECTION7272extern int enable_faults;···97979898#define UUID_NEW_BM_OFFSET ((u64)0x0001000000000000ULL)9999100100-struct drbd_conf;100100+struct drbd_device;101101struct drbd_tconn;102102103103···147147};148148149149extern unsigned int150150-_drbd_insert_fault(struct drbd_conf *mdev, unsigned int type);150150+_drbd_insert_fault(struct drbd_device *mdev, unsigned int type);151151152152static inline int153153-drbd_insert_fault(struct drbd_conf *mdev, unsigned int type) {153153+drbd_insert_fault(struct drbd_device *mdev, unsigned int type) {154154#ifdef CONFIG_DRBD_FAULT_INJECTION155155 return fault_rate &&156156 (enable_faults & (1<<type)) &&···189189 unsigned bytes[2];190190};191191192192-extern void INFO_bm_xfer_stats(struct drbd_conf *mdev,192192+extern void INFO_bm_xfer_stats(struct drbd_device *mdev,193193 const char *direction, struct bm_xfer_ctx *c);194194195195static inline void bm_xfer_ctx_bit_to_word_offset(struct bm_xfer_ctx *c)···246246 struct list_head list;247247 int (*cb)(struct drbd_work *, int cancel);248248 union {249249- struct drbd_conf *mdev;249249+ struct drbd_device *mdev;250250 struct drbd_tconn *tconn;251251 };252252};253253254254#include "drbd_interval.h"255255256256-extern int drbd_wait_misc(struct drbd_conf *, struct drbd_interval *);256256+extern int drbd_wait_misc(struct drbd_device *, struct drbd_interval *);257257258258struct drbd_request {259259 struct drbd_work w;···409409 READ_BALANCE_RR,410410};411411412412-struct drbd_bitmap; /* opaque for drbd_conf */412412+struct drbd_bitmap; /* opaque for drbd_device */413413414414/* definition of bits in bm_flags to be used in drbd_bm_lock415415 * and drbd_bitmap_io and friends. */···496496 struct drbd_work w;497497 char *why;498498 enum bm_flag flags;499499- int (*io_fn)(struct drbd_conf *mdev);500500- void (*done)(struct drbd_conf *mdev, int rv);499499+ int (*io_fn)(struct drbd_device *mdev);500500+ void (*done)(struct drbd_device *mdev, int rv);501501};502502503503enum write_ordering_e {···617617 struct list_head writes;618618};619619620620-struct drbd_conf {620620+struct drbd_device {621621 struct drbd_tconn *tconn;622622 int vnr; /* volume number within the connection */623623 struct kref kref;···763763 struct submit_worker submit;764764};765765766766-static inline struct drbd_conf *minor_to_mdev(unsigned int minor)766766+static inline struct drbd_device *minor_to_mdev(unsigned int minor)767767{768768- return (struct drbd_conf *)idr_find(&minors, minor);768768+ return (struct drbd_device *)idr_find(&minors, minor);769769}770770771771-static inline unsigned int mdev_to_minor(struct drbd_conf *mdev)771771+static inline unsigned int mdev_to_minor(struct drbd_device *mdev)772772{773773 return mdev->minor;774774}775775776776-static inline struct drbd_conf *vnr_to_mdev(struct drbd_tconn *tconn, int vnr)776776+static inline struct drbd_device *vnr_to_mdev(struct drbd_tconn *tconn, int vnr)777777{778778- return (struct drbd_conf *)idr_find(&tconn->volumes, vnr);778778+ return (struct drbd_device *)idr_find(&tconn->volumes, vnr);779779}780780781781/*···789789 DDSF_NO_RESYNC = 2, /* Do not run a resync for the new space */790790};791791792792-extern void drbd_init_set_defaults(struct drbd_conf *mdev);792792+extern void drbd_init_set_defaults(struct drbd_device *mdev);793793extern int drbd_thread_start(struct drbd_thread *thi);794794extern void _drbd_thread_stop(struct drbd_thread *thi, int restart, int wait);795795extern char *drbd_task_to_thread_name(struct drbd_tconn *tconn, struct task_struct *task);···811811812812extern int __drbd_send_protocol(struct drbd_tconn *tconn, enum drbd_packet cmd);813813extern int drbd_send_protocol(struct drbd_tconn *tconn);814814-extern int drbd_send_uuids(struct drbd_conf *mdev);815815-extern int drbd_send_uuids_skip_initial_sync(struct drbd_conf *mdev);816816-extern void drbd_gen_and_send_sync_uuid(struct drbd_conf *mdev);817817-extern int drbd_send_sizes(struct drbd_conf *mdev, int trigger_reply, enum dds_flags flags);818818-extern int drbd_send_state(struct drbd_conf *mdev, union drbd_state s);819819-extern int drbd_send_current_state(struct drbd_conf *mdev);820820-extern int drbd_send_sync_param(struct drbd_conf *mdev);814814+extern int drbd_send_uuids(struct drbd_device *mdev);815815+extern int drbd_send_uuids_skip_initial_sync(struct drbd_device *mdev);816816+extern void drbd_gen_and_send_sync_uuid(struct drbd_device *mdev);817817+extern int drbd_send_sizes(struct drbd_device *mdev, int trigger_reply, enum dds_flags flags);818818+extern int drbd_send_state(struct drbd_device *mdev, union drbd_state s);819819+extern int drbd_send_current_state(struct drbd_device *mdev);820820+extern int drbd_send_sync_param(struct drbd_device *mdev);821821extern void drbd_send_b_ack(struct drbd_tconn *tconn, u32 barrier_nr,822822 u32 set_size);823823-extern int drbd_send_ack(struct drbd_conf *, enum drbd_packet,823823+extern int drbd_send_ack(struct drbd_device *, enum drbd_packet,824824 struct drbd_peer_request *);825825-extern void drbd_send_ack_rp(struct drbd_conf *mdev, enum drbd_packet cmd,825825+extern void drbd_send_ack_rp(struct drbd_device *mdev, enum drbd_packet cmd,826826 struct p_block_req *rp);827827-extern void drbd_send_ack_dp(struct drbd_conf *mdev, enum drbd_packet cmd,827827+extern void drbd_send_ack_dp(struct drbd_device *mdev, enum drbd_packet cmd,828828 struct p_data *dp, int data_size);829829-extern int drbd_send_ack_ex(struct drbd_conf *mdev, enum drbd_packet cmd,829829+extern int drbd_send_ack_ex(struct drbd_device *mdev, enum drbd_packet cmd,830830 sector_t sector, int blksize, u64 block_id);831831-extern int drbd_send_out_of_sync(struct drbd_conf *, struct drbd_request *);832832-extern int drbd_send_block(struct drbd_conf *, enum drbd_packet,831831+extern int drbd_send_out_of_sync(struct drbd_device *, struct drbd_request *);832832+extern int drbd_send_block(struct drbd_device *, enum drbd_packet,833833 struct drbd_peer_request *);834834-extern int drbd_send_dblock(struct drbd_conf *mdev, struct drbd_request *req);835835-extern int drbd_send_drequest(struct drbd_conf *mdev, int cmd,834834+extern int drbd_send_dblock(struct drbd_device *mdev, struct drbd_request *req);835835+extern int drbd_send_drequest(struct drbd_device *mdev, int cmd,836836 sector_t sector, int size, u64 block_id);837837-extern int drbd_send_drequest_csum(struct drbd_conf *mdev, sector_t sector,837837+extern int drbd_send_drequest_csum(struct drbd_device *mdev, sector_t sector,838838 int size, void *digest, int digest_size,839839 enum drbd_packet cmd);840840-extern int drbd_send_ov_request(struct drbd_conf *mdev,sector_t sector,int size);840840+extern int drbd_send_ov_request(struct drbd_device *mdev, sector_t sector, int size);841841842842-extern int drbd_send_bitmap(struct drbd_conf *mdev);843843-extern void drbd_send_sr_reply(struct drbd_conf *mdev, enum drbd_state_rv retcode);842842+extern int drbd_send_bitmap(struct drbd_device *mdev);843843+extern void drbd_send_sr_reply(struct drbd_device *mdev, enum drbd_state_rv retcode);844844extern void conn_send_sr_reply(struct drbd_tconn *tconn, enum drbd_state_rv retcode);845845extern void drbd_free_bc(struct drbd_backing_dev *ldev);846846-extern void drbd_mdev_cleanup(struct drbd_conf *mdev);847847-void drbd_print_uuids(struct drbd_conf *mdev, const char *text);846846+extern void drbd_mdev_cleanup(struct drbd_device *mdev);847847+void drbd_print_uuids(struct drbd_device *mdev, const char *text);848848849849extern void conn_md_sync(struct drbd_tconn *tconn);850850-extern void drbd_md_write(struct drbd_conf *mdev, void *buffer);851851-extern void drbd_md_sync(struct drbd_conf *mdev);852852-extern int drbd_md_read(struct drbd_conf *mdev, struct drbd_backing_dev *bdev);853853-extern void drbd_uuid_set(struct drbd_conf *mdev, int idx, u64 val) __must_hold(local);854854-extern void _drbd_uuid_set(struct drbd_conf *mdev, int idx, u64 val) __must_hold(local);855855-extern void drbd_uuid_new_current(struct drbd_conf *mdev) __must_hold(local);856856-extern void drbd_uuid_set_bm(struct drbd_conf *mdev, u64 val) __must_hold(local);857857-extern void drbd_uuid_move_history(struct drbd_conf *mdev) __must_hold(local);858858-extern void __drbd_uuid_set(struct drbd_conf *mdev, int idx, u64 val) __must_hold(local);859859-extern void drbd_md_set_flag(struct drbd_conf *mdev, int flags) __must_hold(local);860860-extern void drbd_md_clear_flag(struct drbd_conf *mdev, int flags)__must_hold(local);850850+extern void drbd_md_write(struct drbd_device *mdev, void *buffer);851851+extern void drbd_md_sync(struct drbd_device *mdev);852852+extern int drbd_md_read(struct drbd_device *mdev, struct drbd_backing_dev *bdev);853853+extern void drbd_uuid_set(struct drbd_device *mdev, int idx, u64 val) __must_hold(local);854854+extern void _drbd_uuid_set(struct drbd_device *mdev, int idx, u64 val) __must_hold(local);855855+extern void drbd_uuid_new_current(struct drbd_device *mdev) __must_hold(local);856856+extern void drbd_uuid_set_bm(struct drbd_device *mdev, u64 val) __must_hold(local);857857+extern void drbd_uuid_move_history(struct drbd_device *mdev) __must_hold(local);858858+extern void __drbd_uuid_set(struct drbd_device *mdev, int idx, u64 val) __must_hold(local);859859+extern void drbd_md_set_flag(struct drbd_device *mdev, int flags) __must_hold(local);860860+extern void drbd_md_clear_flag(struct drbd_device *mdev, int flags)__must_hold(local);861861extern int drbd_md_test_flag(struct drbd_backing_dev *, int);862862#ifndef DRBD_DEBUG_MD_SYNC863863-extern void drbd_md_mark_dirty(struct drbd_conf *mdev);863863+extern void drbd_md_mark_dirty(struct drbd_device *mdev);864864#else865865#define drbd_md_mark_dirty(m) drbd_md_mark_dirty_(m, __LINE__ , __func__ )866866-extern void drbd_md_mark_dirty_(struct drbd_conf *mdev,866866+extern void drbd_md_mark_dirty_(struct drbd_device *mdev,867867 unsigned int line, const char *func);868868#endif869869-extern void drbd_queue_bitmap_io(struct drbd_conf *mdev,870870- int (*io_fn)(struct drbd_conf *),871871- void (*done)(struct drbd_conf *, int),869869+extern void drbd_queue_bitmap_io(struct drbd_device *mdev,870870+ int (*io_fn)(struct drbd_device *),871871+ void (*done)(struct drbd_device *, int),872872 char *why, enum bm_flag flags);873873-extern int drbd_bitmap_io(struct drbd_conf *mdev,874874- int (*io_fn)(struct drbd_conf *),873873+extern int drbd_bitmap_io(struct drbd_device *mdev,874874+ int (*io_fn)(struct drbd_device *),875875 char *why, enum bm_flag flags);876876-extern int drbd_bitmap_io_from_worker(struct drbd_conf *mdev,877877- int (*io_fn)(struct drbd_conf *),876876+extern int drbd_bitmap_io_from_worker(struct drbd_device *mdev,877877+ int (*io_fn)(struct drbd_device *),878878 char *why, enum bm_flag flags);879879-extern int drbd_bmio_set_n_write(struct drbd_conf *mdev);880880-extern int drbd_bmio_clear_n_write(struct drbd_conf *mdev);881881-extern void drbd_ldev_destroy(struct drbd_conf *mdev);879879+extern int drbd_bmio_set_n_write(struct drbd_device *mdev);880880+extern int drbd_bmio_clear_n_write(struct drbd_device *mdev);881881+extern void drbd_ldev_destroy(struct drbd_device *mdev);882882883883/* Meta data layout884884 *···10641064#define DRBD_MAX_SIZE_H80_PACKET (1U << 15) /* Header 80 only allows packets up to 32KiB data */10651065#define DRBD_MAX_BIO_SIZE_P95 (1U << 17) /* Protocol 95 to 99 allows bios up to 128KiB */1066106610671067-extern int drbd_bm_init(struct drbd_conf *mdev);10681068-extern int drbd_bm_resize(struct drbd_conf *mdev, sector_t sectors, int set_new_bits);10691069-extern void drbd_bm_cleanup(struct drbd_conf *mdev);10701070-extern void drbd_bm_set_all(struct drbd_conf *mdev);10711071-extern void drbd_bm_clear_all(struct drbd_conf *mdev);10671067+extern int drbd_bm_init(struct drbd_device *mdev);10681068+extern int drbd_bm_resize(struct drbd_device *mdev, sector_t sectors, int set_new_bits);10691069+extern void drbd_bm_cleanup(struct drbd_device *mdev);10701070+extern void drbd_bm_set_all(struct drbd_device *mdev);10711071+extern void drbd_bm_clear_all(struct drbd_device *mdev);10721072/* set/clear/test only a few bits at a time */10731073extern int drbd_bm_set_bits(10741074- struct drbd_conf *mdev, unsigned long s, unsigned long e);10741074+ struct drbd_device *mdev, unsigned long s, unsigned long e);10751075extern int drbd_bm_clear_bits(10761076- struct drbd_conf *mdev, unsigned long s, unsigned long e);10761076+ struct drbd_device *mdev, unsigned long s, unsigned long e);10771077extern int drbd_bm_count_bits(10781078- struct drbd_conf *mdev, const unsigned long s, const unsigned long e);10781078+ struct drbd_device *mdev, const unsigned long s, const unsigned long e);10791079/* bm_set_bits variant for use while holding drbd_bm_lock,10801080 * may process the whole bitmap in one go */10811081-extern void _drbd_bm_set_bits(struct drbd_conf *mdev,10811081+extern void _drbd_bm_set_bits(struct drbd_device *mdev,10821082 const unsigned long s, const unsigned long e);10831083-extern int drbd_bm_test_bit(struct drbd_conf *mdev, unsigned long bitnr);10841084-extern int drbd_bm_e_weight(struct drbd_conf *mdev, unsigned long enr);10851085-extern int drbd_bm_write_page(struct drbd_conf *mdev, unsigned int idx) __must_hold(local);10861086-extern int drbd_bm_read(struct drbd_conf *mdev) __must_hold(local);10871087-extern void drbd_bm_mark_for_writeout(struct drbd_conf *mdev, int page_nr);10881088-extern int drbd_bm_write(struct drbd_conf *mdev) __must_hold(local);10891089-extern int drbd_bm_write_hinted(struct drbd_conf *mdev) __must_hold(local);10901090-extern int drbd_bm_write_all(struct drbd_conf *mdev) __must_hold(local);10911091-extern int drbd_bm_write_copy_pages(struct drbd_conf *mdev) __must_hold(local);10921092-extern size_t drbd_bm_words(struct drbd_conf *mdev);10931093-extern unsigned long drbd_bm_bits(struct drbd_conf *mdev);10941094-extern sector_t drbd_bm_capacity(struct drbd_conf *mdev);10831083+extern int drbd_bm_test_bit(struct drbd_device *mdev, unsigned long bitnr);10841084+extern int drbd_bm_e_weight(struct drbd_device *mdev, unsigned long enr);10851085+extern int drbd_bm_write_page(struct drbd_device *mdev, unsigned int idx) __must_hold(local);10861086+extern int drbd_bm_read(struct drbd_device *mdev) __must_hold(local);10871087+extern void drbd_bm_mark_for_writeout(struct drbd_device *mdev, int page_nr);10881088+extern int drbd_bm_write(struct drbd_device *mdev) __must_hold(local);10891089+extern int drbd_bm_write_hinted(struct drbd_device *mdev) __must_hold(local);10901090+extern int drbd_bm_write_all(struct drbd_device *mdev) __must_hold(local);10911091+extern int drbd_bm_write_copy_pages(struct drbd_device *mdev) __must_hold(local);10921092+extern size_t drbd_bm_words(struct drbd_device *mdev);10931093+extern unsigned long drbd_bm_bits(struct drbd_device *mdev);10941094+extern sector_t drbd_bm_capacity(struct drbd_device *mdev);1095109510961096#define DRBD_END_OF_BITMAP (~(unsigned long)0)10971097-extern unsigned long drbd_bm_find_next(struct drbd_conf *mdev, unsigned long bm_fo);10971097+extern unsigned long drbd_bm_find_next(struct drbd_device *mdev, unsigned long bm_fo);10981098/* bm_find_next variants for use while you hold drbd_bm_lock() */10991099-extern unsigned long _drbd_bm_find_next(struct drbd_conf *mdev, unsigned long bm_fo);11001100-extern unsigned long _drbd_bm_find_next_zero(struct drbd_conf *mdev, unsigned long bm_fo);11011101-extern unsigned long _drbd_bm_total_weight(struct drbd_conf *mdev);11021102-extern unsigned long drbd_bm_total_weight(struct drbd_conf *mdev);11031103-extern int drbd_bm_rs_done(struct drbd_conf *mdev);10991099+extern unsigned long _drbd_bm_find_next(struct drbd_device *mdev, unsigned long bm_fo);11001100+extern unsigned long _drbd_bm_find_next_zero(struct drbd_device *mdev, unsigned long bm_fo);11011101+extern unsigned long _drbd_bm_total_weight(struct drbd_device *mdev);11021102+extern unsigned long drbd_bm_total_weight(struct drbd_device *mdev);11031103+extern int drbd_bm_rs_done(struct drbd_device *mdev);11041104/* for receive_bitmap */11051105-extern void drbd_bm_merge_lel(struct drbd_conf *mdev, size_t offset,11051105+extern void drbd_bm_merge_lel(struct drbd_device *mdev, size_t offset,11061106 size_t number, unsigned long *buffer);11071107/* for _drbd_send_bitmap */11081108-extern void drbd_bm_get_lel(struct drbd_conf *mdev, size_t offset,11081108+extern void drbd_bm_get_lel(struct drbd_device *mdev, size_t offset,11091109 size_t number, unsigned long *buffer);1110111011111111-extern void drbd_bm_lock(struct drbd_conf *mdev, char *why, enum bm_flag flags);11121112-extern void drbd_bm_unlock(struct drbd_conf *mdev);11111111+extern void drbd_bm_lock(struct drbd_device *mdev, char *why, enum bm_flag flags);11121112+extern void drbd_bm_unlock(struct drbd_device *mdev);11131113/* drbd_main.c */1114111411151115extern struct kmem_cache *drbd_request_cache;···1169116911701170/* drbd_req */11711171extern void do_submit(struct work_struct *ws);11721172-extern void __drbd_make_request(struct drbd_conf *, struct bio *, unsigned long);11721172+extern void __drbd_make_request(struct drbd_device *, struct bio *, unsigned long);11731173extern void drbd_make_request(struct request_queue *q, struct bio *bio);11741174-extern int drbd_read_remote(struct drbd_conf *mdev, struct drbd_request *req);11741174+extern int drbd_read_remote(struct drbd_device *mdev, struct drbd_request *req);11751175extern int drbd_merge_bvec(struct request_queue *q, struct bvec_merge_data *bvm, struct bio_vec *bvec);11761176extern int is_valid_ar_handle(struct drbd_request *, sector_t);117711771178117811791179/* drbd_nl.c */11801180extern int drbd_msg_put_info(const char *info);11811181-extern void drbd_suspend_io(struct drbd_conf *mdev);11821182-extern void drbd_resume_io(struct drbd_conf *mdev);11811181+extern void drbd_suspend_io(struct drbd_device *mdev);11821182+extern void drbd_resume_io(struct drbd_device *mdev);11831183extern char *ppsize(char *buf, unsigned long long size);11841184-extern sector_t drbd_new_dev_size(struct drbd_conf *, struct drbd_backing_dev *, sector_t, int);11841184+extern sector_t drbd_new_dev_size(struct drbd_device *, struct drbd_backing_dev *, sector_t, int);11851185enum determine_dev_size {11861186 DS_ERROR_SHRINK = -3,11871187 DS_ERROR_SPACE_MD = -2,···11921192 DS_GREW_FROM_ZERO = 3,11931193};11941194extern enum determine_dev_size11951195-drbd_determine_dev_size(struct drbd_conf *, enum dds_flags, struct resize_parms *) __must_hold(local);11961196-extern void resync_after_online_grow(struct drbd_conf *);11971197-extern void drbd_reconsider_max_bio_size(struct drbd_conf *mdev);11981198-extern enum drbd_state_rv drbd_set_role(struct drbd_conf *mdev,11951195+drbd_determine_dev_size(struct drbd_device *, enum dds_flags, struct resize_parms *) __must_hold(local);11961196+extern void resync_after_online_grow(struct drbd_device *);11971197+extern void drbd_reconsider_max_bio_size(struct drbd_device *mdev);11981198+extern enum drbd_state_rv drbd_set_role(struct drbd_device *mdev,11991199 enum drbd_role new_role,12001200 int force);12011201extern bool conn_try_outdate_peer(struct drbd_tconn *tconn);12021202extern void conn_try_outdate_peer_async(struct drbd_tconn *tconn);12031203-extern int drbd_khelper(struct drbd_conf *mdev, char *cmd);12031203+extern int drbd_khelper(struct drbd_device *mdev, char *cmd);1204120412051205/* drbd_worker.c */12061206extern int drbd_worker(struct drbd_thread *thi);12071207-enum drbd_ret_code drbd_resync_after_valid(struct drbd_conf *mdev, int o_minor);12081208-void drbd_resync_after_changed(struct drbd_conf *mdev);12091209-extern void drbd_start_resync(struct drbd_conf *mdev, enum drbd_conns side);12101210-extern void resume_next_sg(struct drbd_conf *mdev);12111211-extern void suspend_other_sg(struct drbd_conf *mdev);12121212-extern int drbd_resync_finished(struct drbd_conf *mdev);12071207+enum drbd_ret_code drbd_resync_after_valid(struct drbd_device *mdev, int o_minor);12081208+void drbd_resync_after_changed(struct drbd_device *mdev);12091209+extern void drbd_start_resync(struct drbd_device *mdev, enum drbd_conns side);12101210+extern void resume_next_sg(struct drbd_device *mdev);12111211+extern void suspend_other_sg(struct drbd_device *mdev);12121212+extern int drbd_resync_finished(struct drbd_device *mdev);12131213/* maybe rather drbd_main.c ? */12141214-extern void *drbd_md_get_buffer(struct drbd_conf *mdev);12151215-extern void drbd_md_put_buffer(struct drbd_conf *mdev);12161216-extern int drbd_md_sync_page_io(struct drbd_conf *mdev,12141214+extern void *drbd_md_get_buffer(struct drbd_device *mdev);12151215+extern void drbd_md_put_buffer(struct drbd_device *mdev);12161216+extern int drbd_md_sync_page_io(struct drbd_device *mdev,12171217 struct drbd_backing_dev *bdev, sector_t sector, int rw);12181218-extern void drbd_ov_out_of_sync_found(struct drbd_conf *, sector_t, int);12191219-extern void wait_until_done_or_force_detached(struct drbd_conf *mdev,12181218+extern void drbd_ov_out_of_sync_found(struct drbd_device *, sector_t, int);12191219+extern void wait_until_done_or_force_detached(struct drbd_device *mdev,12201220 struct drbd_backing_dev *bdev, unsigned int *done);12211221-extern void drbd_rs_controller_reset(struct drbd_conf *mdev);12211221+extern void drbd_rs_controller_reset(struct drbd_device *mdev);1222122212231223-static inline void ov_out_of_sync_print(struct drbd_conf *mdev)12231223+static inline void ov_out_of_sync_print(struct drbd_device *mdev)12241224{12251225 if (mdev->ov_last_oos_size) {12261226 dev_err(DEV, "Out of sync: start=%llu, size=%lu (sectors)\n",···12311231}123212321233123312341234-extern void drbd_csum_bio(struct drbd_conf *, struct crypto_hash *, struct bio *, void *);12351235-extern void drbd_csum_ee(struct drbd_conf *, struct crypto_hash *,12341234+extern void drbd_csum_bio(struct drbd_device *, struct crypto_hash *, struct bio *, void *);12351235+extern void drbd_csum_ee(struct drbd_device *, struct crypto_hash *,12361236 struct drbd_peer_request *, void *);12371237/* worker callbacks */12381238extern int w_e_end_data_req(struct drbd_work *, int);···12561256extern void start_resync_timer_fn(unsigned long data);1257125712581258/* drbd_receiver.c */12591259-extern int drbd_rs_should_slow_down(struct drbd_conf *mdev, sector_t sector);12601260-extern int drbd_submit_peer_request(struct drbd_conf *,12591259+extern int drbd_rs_should_slow_down(struct drbd_device *mdev, sector_t sector);12601260+extern int drbd_submit_peer_request(struct drbd_device *,12611261 struct drbd_peer_request *, const unsigned,12621262 const int);12631263-extern int drbd_free_peer_reqs(struct drbd_conf *, struct list_head *);12641264-extern struct drbd_peer_request *drbd_alloc_peer_req(struct drbd_conf *, u64,12631263+extern int drbd_free_peer_reqs(struct drbd_device *, struct list_head *);12641264+extern struct drbd_peer_request *drbd_alloc_peer_req(struct drbd_device *, u64,12651265 sector_t, unsigned int,12661266 gfp_t) __must_hold(local);12671267-extern void __drbd_free_peer_req(struct drbd_conf *, struct drbd_peer_request *,12671267+extern void __drbd_free_peer_req(struct drbd_device *, struct drbd_peer_request *,12681268 int);12691269#define drbd_free_peer_req(m,e) __drbd_free_peer_req(m, e, 0)12701270#define drbd_free_net_peer_req(m,e) __drbd_free_peer_req(m, e, 1)12711271-extern struct page *drbd_alloc_pages(struct drbd_conf *, unsigned int, bool);12721272-extern void drbd_set_recv_tcq(struct drbd_conf *mdev, int tcq_enabled);12731273-extern void _drbd_clear_done_ee(struct drbd_conf *mdev, struct list_head *to_be_freed);12711271+extern struct page *drbd_alloc_pages(struct drbd_device *, unsigned int, bool);12721272+extern void drbd_set_recv_tcq(struct drbd_device *mdev, int tcq_enabled);12731273+extern void _drbd_clear_done_ee(struct drbd_device *mdev, struct list_head *to_be_freed);12741274extern void conn_flush_workqueue(struct drbd_tconn *tconn);12751275-extern int drbd_connected(struct drbd_conf *mdev);12761276-static inline void drbd_flush_workqueue(struct drbd_conf *mdev)12751275+extern int drbd_connected(struct drbd_device *mdev);12761276+static inline void drbd_flush_workqueue(struct drbd_device *mdev)12771277{12781278 conn_flush_workqueue(mdev->tconn);12791279}···13361336extern const char *drbd_role_str(enum drbd_role s);1337133713381338/* drbd_actlog.c */13391339-extern int drbd_al_begin_io_nonblock(struct drbd_conf *mdev, struct drbd_interval *i);13401340-extern void drbd_al_begin_io_commit(struct drbd_conf *mdev, bool delegate);13411341-extern bool drbd_al_begin_io_fastpath(struct drbd_conf *mdev, struct drbd_interval *i);13421342-extern void drbd_al_begin_io(struct drbd_conf *mdev, struct drbd_interval *i, bool delegate);13431343-extern void drbd_al_complete_io(struct drbd_conf *mdev, struct drbd_interval *i);13441344-extern void drbd_rs_complete_io(struct drbd_conf *mdev, sector_t sector);13451345-extern int drbd_rs_begin_io(struct drbd_conf *mdev, sector_t sector);13461346-extern int drbd_try_rs_begin_io(struct drbd_conf *mdev, sector_t sector);13471347-extern void drbd_rs_cancel_all(struct drbd_conf *mdev);13481348-extern int drbd_rs_del_all(struct drbd_conf *mdev);13491349-extern void drbd_rs_failed_io(struct drbd_conf *mdev,13391339+extern int drbd_al_begin_io_nonblock(struct drbd_device *mdev, struct drbd_interval *i);13401340+extern void drbd_al_begin_io_commit(struct drbd_device *mdev, bool delegate);13411341+extern bool drbd_al_begin_io_fastpath(struct drbd_device *mdev, struct drbd_interval *i);13421342+extern void drbd_al_begin_io(struct drbd_device *mdev, struct drbd_interval *i, bool delegate);13431343+extern void drbd_al_complete_io(struct drbd_device *mdev, struct drbd_interval *i);13441344+extern void drbd_rs_complete_io(struct drbd_device *mdev, sector_t sector);13451345+extern int drbd_rs_begin_io(struct drbd_device *mdev, sector_t sector);13461346+extern int drbd_try_rs_begin_io(struct drbd_device *mdev, sector_t sector);13471347+extern void drbd_rs_cancel_all(struct drbd_device *mdev);13481348+extern int drbd_rs_del_all(struct drbd_device *mdev);13491349+extern void drbd_rs_failed_io(struct drbd_device *mdev,13501350 sector_t sector, int size);13511351-extern void drbd_advance_rs_marks(struct drbd_conf *mdev, unsigned long still_to_go);13521352-extern void __drbd_set_in_sync(struct drbd_conf *mdev, sector_t sector,13511351+extern void drbd_advance_rs_marks(struct drbd_device *mdev, unsigned long still_to_go);13521352+extern void __drbd_set_in_sync(struct drbd_device *mdev, sector_t sector,13531353 int size, const char *file, const unsigned int line);13541354#define drbd_set_in_sync(mdev, sector, size) \13551355 __drbd_set_in_sync(mdev, sector, size, __FILE__, __LINE__)13561356-extern int __drbd_set_out_of_sync(struct drbd_conf *mdev, sector_t sector,13561356+extern int __drbd_set_out_of_sync(struct drbd_device *mdev, sector_t sector,13571357 int size, const char *file, const unsigned int line);13581358#define drbd_set_out_of_sync(mdev, sector, size) \13591359 __drbd_set_out_of_sync(mdev, sector, size, __FILE__, __LINE__)13601360-extern void drbd_al_shrink(struct drbd_conf *mdev);13611361-extern int drbd_initialize_al(struct drbd_conf *, void *);13601360+extern void drbd_al_shrink(struct drbd_device *mdev);13611361+extern int drbd_initialize_al(struct drbd_device *, void *);1362136213631363/* drbd_nl.c */13641364/* state info broadcast */···13751375 };13761376 };13771377};13781378-void drbd_bcast_event(struct drbd_conf *mdev, const struct sib_info *sib);13781378+void drbd_bcast_event(struct drbd_device *mdev, const struct sib_info *sib);1379137913801380/*13811381 * inline helper functions···14041404}1405140514061406static inline enum drbd_state_rv14071407-_drbd_set_state(struct drbd_conf *mdev, union drbd_state ns,14071407+_drbd_set_state(struct drbd_device *mdev, union drbd_state ns,14081408 enum chg_state_flags flags, struct completion *done)14091409{14101410 enum drbd_state_rv rv;···14161416 return rv;14171417}1418141814191419-static inline union drbd_state drbd_read_state(struct drbd_conf *mdev)14191419+static inline union drbd_state drbd_read_state(struct drbd_device *mdev)14201420{14211421 union drbd_state rv;14221422···14361436};1437143714381438#define __drbd_chk_io_error(m,f) __drbd_chk_io_error_(m,f, __func__)14391439-static inline void __drbd_chk_io_error_(struct drbd_conf *mdev,14391439+static inline void __drbd_chk_io_error_(struct drbd_device *mdev,14401440 enum drbd_force_detach_flags df,14411441 const char *where)14421442{···15001500 * See also drbd_main.c:after_state_ch() if (os.disk > D_FAILED && ns.disk == D_FAILED)15011501 */15021502#define drbd_chk_io_error(m,e,f) drbd_chk_io_error_(m,e,f, __func__)15031503-static inline void drbd_chk_io_error_(struct drbd_conf *mdev,15031503+static inline void drbd_chk_io_error_(struct drbd_device *mdev,15041504 int error, enum drbd_force_detach_flags forcedetach, const char *where)15051505{15061506 if (error) {···16431643}1644164416451645extern void *conn_prepare_command(struct drbd_tconn *, struct drbd_socket *);16461646-extern void *drbd_prepare_command(struct drbd_conf *, struct drbd_socket *);16461646+extern void *drbd_prepare_command(struct drbd_device *, struct drbd_socket *);16471647extern int conn_send_command(struct drbd_tconn *, struct drbd_socket *,16481648 enum drbd_packet, unsigned int, void *,16491649 unsigned int);16501650-extern int drbd_send_command(struct drbd_conf *, struct drbd_socket *,16501650+extern int drbd_send_command(struct drbd_device *, struct drbd_socket *,16511651 enum drbd_packet, unsigned int, void *,16521652 unsigned int);1653165316541654extern int drbd_send_ping(struct drbd_tconn *tconn);16551655extern int drbd_send_ping_ack(struct drbd_tconn *tconn);16561656-extern int drbd_send_state_req(struct drbd_conf *, union drbd_state, union drbd_state);16561656+extern int drbd_send_state_req(struct drbd_device *, union drbd_state, union drbd_state);16571657extern int conn_send_state_req(struct drbd_tconn *, union drbd_state, union drbd_state);1658165816591659static inline void drbd_thread_stop(struct drbd_thread *thi)···16931693 * _req_mod(req, CONNECTION_LOST_WHILE_PENDING)16941694 * [from tl_clear_barrier]16951695 */16961696-static inline void inc_ap_pending(struct drbd_conf *mdev)16961696+static inline void inc_ap_pending(struct drbd_device *mdev)16971697{16981698 atomic_inc(&mdev->ap_pending_cnt);16991699}···17051705 atomic_read(&mdev->which))1706170617071707#define dec_ap_pending(mdev) _dec_ap_pending(mdev, __FUNCTION__, __LINE__)17081708-static inline void _dec_ap_pending(struct drbd_conf *mdev, const char *func, int line)17081708+static inline void _dec_ap_pending(struct drbd_device *mdev, const char *func, int line)17091709{17101710 if (atomic_dec_and_test(&mdev->ap_pending_cnt))17111711 wake_up(&mdev->misc_wait);···17181718 * C_SYNC_SOURCE sends P_RS_DATA_REPLY (and expects P_WRITE_ACK with ID_SYNCER)17191719 * (or P_NEG_ACK with ID_SYNCER)17201720 */17211721-static inline void inc_rs_pending(struct drbd_conf *mdev)17211721+static inline void inc_rs_pending(struct drbd_device *mdev)17221722{17231723 atomic_inc(&mdev->rs_pending_cnt);17241724}1725172517261726#define dec_rs_pending(mdev) _dec_rs_pending(mdev, __FUNCTION__, __LINE__)17271727-static inline void _dec_rs_pending(struct drbd_conf *mdev, const char *func, int line)17271727+static inline void _dec_rs_pending(struct drbd_device *mdev, const char *func, int line)17281728{17291729 atomic_dec(&mdev->rs_pending_cnt);17301730 ERR_IF_CNT_IS_NEGATIVE(rs_pending_cnt, func, line);···17391739 * receive_DataRequest (receive_RSDataRequest) we need to send back P_DATA17401740 * receive_Barrier_* we need to send a P_BARRIER_ACK17411741 */17421742-static inline void inc_unacked(struct drbd_conf *mdev)17421742+static inline void inc_unacked(struct drbd_device *mdev)17431743{17441744 atomic_inc(&mdev->unacked_cnt);17451745}1746174617471747#define dec_unacked(mdev) _dec_unacked(mdev, __FUNCTION__, __LINE__)17481748-static inline void _dec_unacked(struct drbd_conf *mdev, const char *func, int line)17481748+static inline void _dec_unacked(struct drbd_device *mdev, const char *func, int line)17491749{17501750 atomic_dec(&mdev->unacked_cnt);17511751 ERR_IF_CNT_IS_NEGATIVE(unacked_cnt, func, line);17521752}1753175317541754#define sub_unacked(mdev, n) _sub_unacked(mdev, n, __FUNCTION__, __LINE__)17551755-static inline void _sub_unacked(struct drbd_conf *mdev, int n, const char *func, int line)17551755+static inline void _sub_unacked(struct drbd_device *mdev, int n, const char *func, int line)17561756{17571757 atomic_sub(n, &mdev->unacked_cnt);17581758 ERR_IF_CNT_IS_NEGATIVE(unacked_cnt, func, line);···17671767#define get_ldev(M) __cond_lock(local, _get_ldev_if_state(M,D_INCONSISTENT))17681768#define get_ldev_if_state(M,MINS) __cond_lock(local, _get_ldev_if_state(M,MINS))1769176917701770-static inline void put_ldev(struct drbd_conf *mdev)17701770+static inline void put_ldev(struct drbd_device *mdev)17711771{17721772 int i = atomic_dec_return(&mdev->local_cnt);17731773···17901790}1791179117921792#ifndef __CHECKER__17931793-static inline int _get_ldev_if_state(struct drbd_conf *mdev, enum drbd_disk_state mins)17931793+static inline int _get_ldev_if_state(struct drbd_device *mdev, enum drbd_disk_state mins)17941794{17951795 int io_allowed;17961796···18051805 return io_allowed;18061806}18071807#else18081808-extern int _get_ldev_if_state(struct drbd_conf *mdev, enum drbd_disk_state mins);18081808+extern int _get_ldev_if_state(struct drbd_device *mdev, enum drbd_disk_state mins);18091809#endif1810181018111811/* you must have an "get_ldev" reference */18121812-static inline void drbd_get_syncer_progress(struct drbd_conf *mdev,18121812+static inline void drbd_get_syncer_progress(struct drbd_device *mdev,18131813 unsigned long *bits_left, unsigned int *per_mil_done)18141814{18151815 /* this is to break it at compile time when we change that, in case we···18591859/* this throttles on-the-fly application requests18601860 * according to max_buffers settings;18611861 * maybe re-implement using semaphores? */18621862-static inline int drbd_get_max_buffers(struct drbd_conf *mdev)18621862+static inline int drbd_get_max_buffers(struct drbd_device *mdev)18631863{18641864 struct net_conf *nc;18651865 int mxb;···18721872 return mxb;18731873}1874187418751875-static inline int drbd_state_is_stable(struct drbd_conf *mdev)18751875+static inline int drbd_state_is_stable(struct drbd_device *mdev)18761876{18771877 union drbd_dev_state s = mdev->state;18781878···19421942 return 1;19431943}1944194419451945-static inline int drbd_suspended(struct drbd_conf *mdev)19451945+static inline int drbd_suspended(struct drbd_device *mdev)19461946{19471947 struct drbd_tconn *tconn = mdev->tconn;1948194819491949 return tconn->susp || tconn->susp_fen || tconn->susp_nod;19501950}1951195119521952-static inline bool may_inc_ap_bio(struct drbd_conf *mdev)19521952+static inline bool may_inc_ap_bio(struct drbd_device *mdev)19531953{19541954 int mxb = drbd_get_max_buffers(mdev);19551955···19751975 return true;19761976}1977197719781978-static inline bool inc_ap_bio_cond(struct drbd_conf *mdev)19781978+static inline bool inc_ap_bio_cond(struct drbd_device *mdev)19791979{19801980 bool rv = false;19811981···19881988 return rv;19891989}1990199019911991-static inline void inc_ap_bio(struct drbd_conf *mdev)19911991+static inline void inc_ap_bio(struct drbd_device *mdev)19921992{19931993 /* we wait here19941994 * as long as the device is suspended···20012001 wait_event(mdev->misc_wait, inc_ap_bio_cond(mdev));20022002}2003200320042004-static inline void dec_ap_bio(struct drbd_conf *mdev)20042004+static inline void dec_ap_bio(struct drbd_device *mdev)20052005{20062006 int mxb = drbd_get_max_buffers(mdev);20072007 int ap_bio = atomic_dec_return(&mdev->ap_bio_cnt);···20202020 wake_up(&mdev->misc_wait);20212021}2022202220232023-static inline bool verify_can_do_stop_sector(struct drbd_conf *mdev)20232023+static inline bool verify_can_do_stop_sector(struct drbd_device *mdev)20242024{20252025 return mdev->tconn->agreed_pro_version >= 97 &&20262026 mdev->tconn->agreed_pro_version != 100;20272027}2028202820292029-static inline int drbd_set_ed_uuid(struct drbd_conf *mdev, u64 val)20292029+static inline int drbd_set_ed_uuid(struct drbd_device *mdev, u64 val)20302030{20312031 int changed = mdev->ed_uuid != val;20322032 mdev->ed_uuid = val;20332033 return changed;20342034}2035203520362036-static inline int drbd_queue_order_type(struct drbd_conf *mdev)20362036+static inline int drbd_queue_order_type(struct drbd_device *mdev)20372037{20382038 /* sorry, we currently have no working implementation20392039 * of distributed TCQ stuff */···20432043 return QUEUE_ORDERED_NONE;20442044}2045204520462046-static inline void drbd_md_flush(struct drbd_conf *mdev)20462046+static inline void drbd_md_flush(struct drbd_device *mdev)20472047{20482048 int r;20492049
+79-79
drivers/block/drbd/drbd_main.c
···165165/* When checking with sparse, and this is an inline function, sparse will166166 give tons of false positives. When this is a real functions sparse works.167167 */168168-int _get_ldev_if_state(struct drbd_conf *mdev, enum drbd_disk_state mins)168168+int _get_ldev_if_state(struct drbd_device *mdev, enum drbd_disk_state mins)169169{170170 int io_allowed;171171···306306 * tl_abort_disk_io() - Abort disk I/O for all requests for a certain mdev in the TL307307 * @mdev: DRBD device.308308 */309309-void tl_abort_disk_io(struct drbd_conf *mdev)309309+void tl_abort_disk_io(struct drbd_device *mdev)310310{311311 struct drbd_tconn *tconn = mdev->tconn;312312 struct drbd_request *req, *r;···495495496496int conn_lowest_minor(struct drbd_tconn *tconn)497497{498498- struct drbd_conf *mdev;498498+ struct drbd_device *mdev;499499 int vnr = 0, m;500500501501 rcu_read_lock();···631631 return p;632632}633633634634-void *drbd_prepare_command(struct drbd_conf *mdev, struct drbd_socket *sock)634634+void *drbd_prepare_command(struct drbd_device *mdev, struct drbd_socket *sock)635635{636636 return conn_prepare_command(mdev->tconn, sock);637637}···680680 return err;681681}682682683683-int drbd_send_command(struct drbd_conf *mdev, struct drbd_socket *sock,683683+int drbd_send_command(struct drbd_device *mdev, struct drbd_socket *sock,684684 enum drbd_packet cmd, unsigned int header_size,685685 void *data, unsigned int size)686686{···712712 return conn_send_command(tconn, sock, P_PING_ACK, 0, NULL, 0);713713}714714715715-int drbd_send_sync_param(struct drbd_conf *mdev)715715+int drbd_send_sync_param(struct drbd_device *mdev)716716{717717 struct drbd_socket *sock;718718 struct p_rs_param_95 *p;···822822 return err;823823}824824825825-static int _drbd_send_uuids(struct drbd_conf *mdev, u64 uuid_flags)825825+static int _drbd_send_uuids(struct drbd_device *mdev, u64 uuid_flags)826826{827827 struct drbd_socket *sock;828828 struct p_uuids *p;···855855 return drbd_send_command(mdev, sock, P_UUIDS, sizeof(*p), NULL, 0);856856}857857858858-int drbd_send_uuids(struct drbd_conf *mdev)858858+int drbd_send_uuids(struct drbd_device *mdev)859859{860860 return _drbd_send_uuids(mdev, 0);861861}862862863863-int drbd_send_uuids_skip_initial_sync(struct drbd_conf *mdev)863863+int drbd_send_uuids_skip_initial_sync(struct drbd_device *mdev)864864{865865 return _drbd_send_uuids(mdev, 8);866866}867867868868-void drbd_print_uuids(struct drbd_conf *mdev, const char *text)868868+void drbd_print_uuids(struct drbd_device *mdev, const char *text)869869{870870 if (get_ldev_if_state(mdev, D_NEGOTIATING)) {871871 u64 *uuid = mdev->ldev->md.uuid;···883883 }884884}885885886886-void drbd_gen_and_send_sync_uuid(struct drbd_conf *mdev)886886+void drbd_gen_and_send_sync_uuid(struct drbd_device *mdev)887887{888888 struct drbd_socket *sock;889889 struct p_rs_uuid *p;···908908 }909909}910910911911-int drbd_send_sizes(struct drbd_conf *mdev, int trigger_reply, enum dds_flags flags)911911+int drbd_send_sizes(struct drbd_device *mdev, int trigger_reply, enum dds_flags flags)912912{913913 struct drbd_socket *sock;914914 struct p_sizes *p;···956956 * drbd_send_current_state() - Sends the drbd state to the peer957957 * @mdev: DRBD device.958958 */959959-int drbd_send_current_state(struct drbd_conf *mdev)959959+int drbd_send_current_state(struct drbd_device *mdev)960960{961961 struct drbd_socket *sock;962962 struct p_state *p;···979979 * between queuing and processing of the after_state_ch work, we still980980 * want to send each intermediary state in the order it occurred.981981 */982982-int drbd_send_state(struct drbd_conf *mdev, union drbd_state state)982982+int drbd_send_state(struct drbd_device *mdev, union drbd_state state)983983{984984 struct drbd_socket *sock;985985 struct p_state *p;···992992 return drbd_send_command(mdev, sock, P_STATE, sizeof(*p), NULL, 0);993993}994994995995-int drbd_send_state_req(struct drbd_conf *mdev, union drbd_state mask, union drbd_state val)995995+int drbd_send_state_req(struct drbd_device *mdev, union drbd_state mask, union drbd_state val)996996{997997 struct drbd_socket *sock;998998 struct p_req_state *p;···10221022 return conn_send_command(tconn, sock, cmd, sizeof(*p), NULL, 0);10231023}1024102410251025-void drbd_send_sr_reply(struct drbd_conf *mdev, enum drbd_state_rv retcode)10251025+void drbd_send_sr_reply(struct drbd_device *mdev, enum drbd_state_rv retcode)10261026{10271027 struct drbd_socket *sock;10281028 struct p_req_state_reply *p;···10661066 p->encoding = (p->encoding & (~0x7 << 4)) | (n << 4);10671067}1068106810691069-static int fill_bitmap_rle_bits(struct drbd_conf *mdev,10691069+static int fill_bitmap_rle_bits(struct drbd_device *mdev,10701070 struct p_compressed_bm *p,10711071 unsigned int size,10721072 struct bm_xfer_ctx *c)···11701170 * code upon failure.11711171 */11721172static int11731173-send_bitmap_rle_or_plain(struct drbd_conf *mdev, struct bm_xfer_ctx *c)11731173+send_bitmap_rle_or_plain(struct drbd_device *mdev, struct bm_xfer_ctx *c)11741174{11751175 struct drbd_socket *sock = &mdev->tconn->data;11761176 unsigned int header_size = drbd_header_size(mdev->tconn);···12261226}1227122712281228/* See the comment at receive_bitmap() */12291229-static int _drbd_send_bitmap(struct drbd_conf *mdev)12291229+static int _drbd_send_bitmap(struct drbd_device *mdev)12301230{12311231 struct bm_xfer_ctx c;12321232 int err;···12631263 return err == 0;12641264}1265126512661266-int drbd_send_bitmap(struct drbd_conf *mdev)12661266+int drbd_send_bitmap(struct drbd_device *mdev)12671267{12681268 struct drbd_socket *sock = &mdev->tconn->data;12691269 int err = -1;···13001300 * @blksize: size in byte, needs to be in big endian byte order13011301 * @block_id: Id, big endian byte order13021302 */13031303-static int _drbd_send_ack(struct drbd_conf *mdev, enum drbd_packet cmd,13031303+static int _drbd_send_ack(struct drbd_device *mdev, enum drbd_packet cmd,13041304 u64 sector, u32 blksize, u64 block_id)13051305{13061306 struct drbd_socket *sock;···13231323/* dp->sector and dp->block_id already/still in network byte order,13241324 * data_size is payload size according to dp->head,13251325 * and may need to be corrected for digest size. */13261326-void drbd_send_ack_dp(struct drbd_conf *mdev, enum drbd_packet cmd,13261326+void drbd_send_ack_dp(struct drbd_device *mdev, enum drbd_packet cmd,13271327 struct p_data *dp, int data_size)13281328{13291329 if (mdev->tconn->peer_integrity_tfm)···13321332 dp->block_id);13331333}1334133413351335-void drbd_send_ack_rp(struct drbd_conf *mdev, enum drbd_packet cmd,13351335+void drbd_send_ack_rp(struct drbd_device *mdev, enum drbd_packet cmd,13361336 struct p_block_req *rp)13371337{13381338 _drbd_send_ack(mdev, cmd, rp->sector, rp->blksize, rp->block_id);···13441344 * @cmd: packet command code13451345 * @peer_req: peer request13461346 */13471347-int drbd_send_ack(struct drbd_conf *mdev, enum drbd_packet cmd,13471347+int drbd_send_ack(struct drbd_device *mdev, enum drbd_packet cmd,13481348 struct drbd_peer_request *peer_req)13491349{13501350 return _drbd_send_ack(mdev, cmd,···1355135513561356/* This function misuses the block_id field to signal if the blocks13571357 * are is sync or not. */13581358-int drbd_send_ack_ex(struct drbd_conf *mdev, enum drbd_packet cmd,13581358+int drbd_send_ack_ex(struct drbd_device *mdev, enum drbd_packet cmd,13591359 sector_t sector, int blksize, u64 block_id)13601360{13611361 return _drbd_send_ack(mdev, cmd,···13641364 cpu_to_be64(block_id));13651365}1366136613671367-int drbd_send_drequest(struct drbd_conf *mdev, int cmd,13671367+int drbd_send_drequest(struct drbd_device *mdev, int cmd,13681368 sector_t sector, int size, u64 block_id)13691369{13701370 struct drbd_socket *sock;···13801380 return drbd_send_command(mdev, sock, cmd, sizeof(*p), NULL, 0);13811381}1382138213831383-int drbd_send_drequest_csum(struct drbd_conf *mdev, sector_t sector, int size,13831383+int drbd_send_drequest_csum(struct drbd_device *mdev, sector_t sector, int size,13841384 void *digest, int digest_size, enum drbd_packet cmd)13851385{13861386 struct drbd_socket *sock;···13991399 digest, digest_size);14001400}1401140114021402-int drbd_send_ov_request(struct drbd_conf *mdev, sector_t sector, int size)14021402+int drbd_send_ov_request(struct drbd_device *mdev, sector_t sector, int size)14031403{14041404 struct drbd_socket *sock;14051405 struct p_block_req *p;···14691469 * As a workaround, we disable sendpage on pages14701470 * with page_count == 0 or PageSlab.14711471 */14721472-static int _drbd_no_send_page(struct drbd_conf *mdev, struct page *page,14721472+static int _drbd_no_send_page(struct drbd_device *mdev, struct page *page,14731473 int offset, size_t size, unsigned msg_flags)14741474{14751475 struct socket *socket;···14851485 return err;14861486}1487148714881488-static int _drbd_send_page(struct drbd_conf *mdev, struct page *page,14881488+static int _drbd_send_page(struct drbd_device *mdev, struct page *page,14891489 int offset, size_t size, unsigned msg_flags)14901490{14911491 struct socket *socket = mdev->tconn->data.socket;···15341534 return err;15351535}1536153615371537-static int _drbd_send_bio(struct drbd_conf *mdev, struct bio *bio)15371537+static int _drbd_send_bio(struct drbd_device *mdev, struct bio *bio)15381538{15391539 struct bio_vec bvec;15401540 struct bvec_iter iter;···15531553 return 0;15541554}1555155515561556-static int _drbd_send_zc_bio(struct drbd_conf *mdev, struct bio *bio)15561556+static int _drbd_send_zc_bio(struct drbd_device *mdev, struct bio *bio)15571557{15581558 struct bio_vec bvec;15591559 struct bvec_iter iter;···15711571 return 0;15721572}1573157315741574-static int _drbd_send_zc_ee(struct drbd_conf *mdev,15741574+static int _drbd_send_zc_ee(struct drbd_device *mdev,15751575 struct drbd_peer_request *peer_req)15761576{15771577 struct page *page = peer_req->pages;···15911591 return 0;15921592}1593159315941594-static u32 bio_flags_to_wire(struct drbd_conf *mdev, unsigned long bi_rw)15941594+static u32 bio_flags_to_wire(struct drbd_device *mdev, unsigned long bi_rw)15951595{15961596 if (mdev->tconn->agreed_pro_version >= 95)15971597 return (bi_rw & REQ_SYNC ? DP_RW_SYNC : 0) |···16051605/* Used to send write requests16061606 * R_PRIMARY -> Peer (P_DATA)16071607 */16081608-int drbd_send_dblock(struct drbd_conf *mdev, struct drbd_request *req)16081608+int drbd_send_dblock(struct drbd_device *mdev, struct drbd_request *req)16091609{16101610 struct drbd_socket *sock;16111611 struct p_data *p;···16771677 * Peer -> (diskless) R_PRIMARY (P_DATA_REPLY)16781678 * C_SYNC_SOURCE -> C_SYNC_TARGET (P_RS_DATA_REPLY)16791679 */16801680-int drbd_send_block(struct drbd_conf *mdev, enum drbd_packet cmd,16801680+int drbd_send_block(struct drbd_device *mdev, enum drbd_packet cmd,16811681 struct drbd_peer_request *peer_req)16821682{16831683 struct drbd_socket *sock;···17061706 return err;17071707}1708170817091709-int drbd_send_out_of_sync(struct drbd_conf *mdev, struct drbd_request *req)17091709+int drbd_send_out_of_sync(struct drbd_device *mdev, struct drbd_request *req)17101710{17111711 struct drbd_socket *sock;17121712 struct p_block_desc *p;···1827182718281828static int drbd_open(struct block_device *bdev, fmode_t mode)18291829{18301830- struct drbd_conf *mdev = bdev->bd_disk->private_data;18301830+ struct drbd_device *mdev = bdev->bd_disk->private_data;18311831 unsigned long flags;18321832 int rv = 0;18331833···1853185318541854static void drbd_release(struct gendisk *gd, fmode_t mode)18551855{18561856- struct drbd_conf *mdev = gd->private_data;18561856+ struct drbd_device *mdev = gd->private_data;18571857 mutex_lock(&drbd_main_mutex);18581858 mdev->open_cnt--;18591859 mutex_unlock(&drbd_main_mutex);18601860}1861186118621862-static void drbd_set_defaults(struct drbd_conf *mdev)18621862+static void drbd_set_defaults(struct drbd_device *mdev)18631863{18641864 /* Beware! The actual layout differs18651865 * between big endian and little endian */···18721872 } };18731873}1874187418751875-void drbd_init_set_defaults(struct drbd_conf *mdev)18751875+void drbd_init_set_defaults(struct drbd_device *mdev)18761876{18771877 /* the memset(,0,) did most of this.18781878 * note: only assignments, no allocation in here */···19471947 mdev->local_max_bio_size = DRBD_MAX_BIO_SIZE_SAFE;19481948}1949194919501950-void drbd_mdev_cleanup(struct drbd_conf *mdev)19501950+void drbd_mdev_cleanup(struct drbd_device *mdev)19511951{19521952 int i;19531953 if (mdev->tconn->receiver.t_state != NONE)···21302130 .notifier_call = drbd_notify_sys,21312131};2132213221332133-static void drbd_release_all_peer_reqs(struct drbd_conf *mdev)21332133+static void drbd_release_all_peer_reqs(struct drbd_device *mdev)21342134{21352135 int rr;21362136···21582158/* caution. no locking. */21592159void drbd_minor_destroy(struct kref *kref)21602160{21612161- struct drbd_conf *mdev = container_of(kref, struct drbd_conf, kref);21612161+ struct drbd_device *mdev = container_of(kref, struct drbd_device, kref);21622162 struct drbd_tconn *tconn = mdev->tconn;2163216321642164 del_timer_sync(&mdev->request_timer);···22172217 spin_unlock_irq(&retry->lock);2218221822192219 list_for_each_entry_safe(req, tmp, &writes, tl_requests) {22202220- struct drbd_conf *mdev = req->w.mdev;22202220+ struct drbd_device *mdev = req->w.mdev;22212221 struct bio *bio = req->master_bio;22222222 unsigned long start_time = req->start_time;22232223 bool expected;···22772277static void drbd_cleanup(void)22782278{22792279 unsigned int i;22802280- struct drbd_conf *mdev;22802280+ struct drbd_device *mdev;22812281 struct drbd_tconn *tconn, *tmp;2282228222832283 unregister_reboot_notifier(&drbd_notifier);···23312331 */23322332static int drbd_congested(void *congested_data, int bdi_bits)23332333{23342334- struct drbd_conf *mdev = congested_data;23342334+ struct drbd_device *mdev = congested_data;23352335 struct request_queue *q;23362336 char reason = '-';23372337 int r = 0;···25912591 kfree(tconn);25922592}2593259325942594-static int init_submitter(struct drbd_conf *mdev)25942594+static int init_submitter(struct drbd_device *mdev)25952595{25962596 /* opencoded create_singlethread_workqueue(),25972597 * to be able to say "drbd%d", ..., minor */···2608260826092609enum drbd_ret_code conn_new_minor(struct drbd_tconn *tconn, unsigned int minor, int vnr)26102610{26112611- struct drbd_conf *mdev;26112611+ struct drbd_device *mdev;26122612 struct gendisk *disk;26132613 struct request_queue *q;26142614 int vnr_got = vnr;···26202620 return ERR_MINOR_EXISTS;2621262126222622 /* GFP_KERNEL, we are outside of all write-out paths */26232623- mdev = kzalloc(sizeof(struct drbd_conf), GFP_KERNEL);26232623+ mdev = kzalloc(sizeof(struct drbd_device), GFP_KERNEL);26242624 if (!mdev)26252625 return ERR_NOMEM;26262626···2843284328442844void conn_md_sync(struct drbd_tconn *tconn)28452845{28462846- struct drbd_conf *mdev;28462846+ struct drbd_device *mdev;28472847 int vnr;2848284828492849 rcu_read_lock();···28822882288328832884288428852885-void drbd_md_write(struct drbd_conf *mdev, void *b)28852885+void drbd_md_write(struct drbd_device *mdev, void *b)28862886{28872887 struct meta_data_on_disk *buffer = b;28882888 sector_t sector;···29222922 * drbd_md_sync() - Writes the meta data super block if the MD_DIRTY flag bit is set29232923 * @mdev: DRBD device.29242924 */29252925-void drbd_md_sync(struct drbd_conf *mdev)29252925+void drbd_md_sync(struct drbd_device *mdev)29262926{29272927 struct meta_data_on_disk *buffer;29282928···29552955 put_ldev(mdev);29562956}2957295729582958-static int check_activity_log_stripe_size(struct drbd_conf *mdev,29582958+static int check_activity_log_stripe_size(struct drbd_device *mdev,29592959 struct meta_data_on_disk *on_disk,29602960 struct drbd_md *in_core)29612961{···30003000 return -EINVAL;30013001}3002300230033003-static int check_offsets_and_sizes(struct drbd_conf *mdev, struct drbd_backing_dev *bdev)30033003+static int check_offsets_and_sizes(struct drbd_device *mdev, struct drbd_backing_dev *bdev)30043004{30053005 sector_t capacity = drbd_get_capacity(bdev->md_bdev);30063006 struct drbd_md *in_core = &bdev->md;···30913091 * Called exactly once during drbd_adm_attach(), while still being D_DISKLESS,30923092 * even before @bdev is assigned to @mdev->ldev.30933093 */30943094-int drbd_md_read(struct drbd_conf *mdev, struct drbd_backing_dev *bdev)30943094+int drbd_md_read(struct drbd_device *mdev, struct drbd_backing_dev *bdev)30953095{30963096 struct meta_data_on_disk *buffer;30973097 u32 magic, flags;···31963196 * timer that ensures that within five seconds you have to call drbd_md_sync().31973197 */31983198#ifdef DEBUG31993199-void drbd_md_mark_dirty_(struct drbd_conf *mdev, unsigned int line, const char *func)31993199+void drbd_md_mark_dirty_(struct drbd_device *mdev, unsigned int line, const char *func)32003200{32013201 if (!test_and_set_bit(MD_DIRTY, &mdev->flags)) {32023202 mod_timer(&mdev->md_sync_timer, jiffies + HZ);···32053205 }32063206}32073207#else32083208-void drbd_md_mark_dirty(struct drbd_conf *mdev)32083208+void drbd_md_mark_dirty(struct drbd_device *mdev)32093209{32103210 if (!test_and_set_bit(MD_DIRTY, &mdev->flags))32113211 mod_timer(&mdev->md_sync_timer, jiffies + 5*HZ);32123212}32133213#endif3214321432153215-void drbd_uuid_move_history(struct drbd_conf *mdev) __must_hold(local)32153215+void drbd_uuid_move_history(struct drbd_device *mdev) __must_hold(local)32163216{32173217 int i;32183218···32203220 mdev->ldev->md.uuid[i+1] = mdev->ldev->md.uuid[i];32213221}3222322232233223-void __drbd_uuid_set(struct drbd_conf *mdev, int idx, u64 val) __must_hold(local)32233223+void __drbd_uuid_set(struct drbd_device *mdev, int idx, u64 val) __must_hold(local)32243224{32253225 if (idx == UI_CURRENT) {32263226 if (mdev->state.role == R_PRIMARY)···32353235 drbd_md_mark_dirty(mdev);32363236}3237323732383238-void _drbd_uuid_set(struct drbd_conf *mdev, int idx, u64 val) __must_hold(local)32383238+void _drbd_uuid_set(struct drbd_device *mdev, int idx, u64 val) __must_hold(local)32393239{32403240 unsigned long flags;32413241 spin_lock_irqsave(&mdev->ldev->md.uuid_lock, flags);···32433243 spin_unlock_irqrestore(&mdev->ldev->md.uuid_lock, flags);32443244}3245324532463246-void drbd_uuid_set(struct drbd_conf *mdev, int idx, u64 val) __must_hold(local)32463246+void drbd_uuid_set(struct drbd_device *mdev, int idx, u64 val) __must_hold(local)32473247{32483248 unsigned long flags;32493249 spin_lock_irqsave(&mdev->ldev->md.uuid_lock, flags);···32623262 * Creates a new current UUID, and rotates the old current UUID into32633263 * the bitmap slot. Causes an incremental resync upon next connect.32643264 */32653265-void drbd_uuid_new_current(struct drbd_conf *mdev) __must_hold(local)32653265+void drbd_uuid_new_current(struct drbd_device *mdev) __must_hold(local)32663266{32673267 u64 val;32683268 unsigned long long bm_uuid;···32843284 drbd_md_sync(mdev);32853285}3286328632873287-void drbd_uuid_set_bm(struct drbd_conf *mdev, u64 val) __must_hold(local)32873287+void drbd_uuid_set_bm(struct drbd_device *mdev, u64 val) __must_hold(local)32883288{32893289 unsigned long flags;32903290 if (mdev->ldev->md.uuid[UI_BITMAP] == 0 && val == 0)···33133313 *33143314 * Sets all bits in the bitmap and writes the whole bitmap to stable storage.33153315 */33163316-int drbd_bmio_set_n_write(struct drbd_conf *mdev)33163316+int drbd_bmio_set_n_write(struct drbd_device *mdev)33173317{33183318 int rv = -EIO;33193319···33413341 *33423342 * Clears all bits in the bitmap and writes the whole bitmap to stable storage.33433343 */33443344-int drbd_bmio_clear_n_write(struct drbd_conf *mdev)33443344+int drbd_bmio_clear_n_write(struct drbd_device *mdev)33453345{33463346 int rv = -EIO;33473347···33583358static int w_bitmap_io(struct drbd_work *w, int unused)33593359{33603360 struct bm_io_work *work = container_of(w, struct bm_io_work, w);33613361- struct drbd_conf *mdev = w->mdev;33613361+ struct drbd_device *mdev = w->mdev;33623362 int rv = -EIO;3363336333643364 D_ASSERT(atomic_read(&mdev->ap_bio_cnt) == 0);···33833383 return 0;33843384}3385338533863386-void drbd_ldev_destroy(struct drbd_conf *mdev)33863386+void drbd_ldev_destroy(struct drbd_device *mdev)33873387{33883388 lc_destroy(mdev->resync);33893389 mdev->resync = NULL;···3398339833993399static int w_go_diskless(struct drbd_work *w, int unused)34003400{34013401- struct drbd_conf *mdev = w->mdev;34013401+ struct drbd_device *mdev = w->mdev;3402340234033403 D_ASSERT(mdev->state.disk == D_FAILED);34043404 /* we cannot assert local_cnt == 0 here, as get_ldev_if_state will···34493449 * called from worker context. It MUST NOT be used while a previous such34503450 * work is still pending!34513451 */34523452-void drbd_queue_bitmap_io(struct drbd_conf *mdev,34533453- int (*io_fn)(struct drbd_conf *),34543454- void (*done)(struct drbd_conf *, int),34523452+void drbd_queue_bitmap_io(struct drbd_device *mdev,34533453+ int (*io_fn)(struct drbd_device *),34543454+ void (*done)(struct drbd_device *, int),34553455 char *why, enum bm_flag flags)34563456{34573457 D_ASSERT(current == mdev->tconn->worker.task);···34863486 * freezes application IO while that the actual IO operations runs. This34873487 * functions MAY NOT be called from worker context.34883488 */34893489-int drbd_bitmap_io(struct drbd_conf *mdev, int (*io_fn)(struct drbd_conf *),34893489+int drbd_bitmap_io(struct drbd_device *mdev, int (*io_fn)(struct drbd_device *),34903490 char *why, enum bm_flag flags)34913491{34923492 int rv;···35063506 return rv;35073507}3508350835093509-void drbd_md_set_flag(struct drbd_conf *mdev, int flag) __must_hold(local)35093509+void drbd_md_set_flag(struct drbd_device *mdev, int flag) __must_hold(local)35103510{35113511 if ((mdev->ldev->md.flags & flag) != flag) {35123512 drbd_md_mark_dirty(mdev);···35143514 }35153515}3516351635173517-void drbd_md_clear_flag(struct drbd_conf *mdev, int flag) __must_hold(local)35173517+void drbd_md_clear_flag(struct drbd_device *mdev, int flag) __must_hold(local)35183518{35193519 if ((mdev->ldev->md.flags & flag) != 0) {35203520 drbd_md_mark_dirty(mdev);···3528352835293529static void md_sync_timer_fn(unsigned long data)35303530{35313531- struct drbd_conf *mdev = (struct drbd_conf *) data;35313531+ struct drbd_device *mdev = (struct drbd_device *) data;3532353235333533 /* must not double-queue! */35343534 if (list_empty(&mdev->md_sync_work.list))···3537353735383538static int w_md_sync(struct drbd_work *w, int unused)35393539{35403540- struct drbd_conf *mdev = w->mdev;35403540+ struct drbd_device *mdev = w->mdev;3541354135423542 dev_warn(DEV, "md_sync_timer expired! Worker calls drbd_md_sync().\n");35433543#ifdef DEBUG···36243624 * @i: the struct drbd_interval embedded in struct drbd_request or36253625 * struct drbd_peer_request36263626 */36273627-int drbd_wait_misc(struct drbd_conf *mdev, struct drbd_interval *i)36273627+int drbd_wait_misc(struct drbd_device *mdev, struct drbd_interval *i)36283628{36293629 struct net_conf *nc;36303630 DEFINE_WAIT(wait);···37023702}3703370337043704unsigned int37053705-_drbd_insert_fault(struct drbd_conf *mdev, unsigned int type)37053705+_drbd_insert_fault(struct drbd_device *mdev, unsigned int type)37063706{37073707 static struct fault_random_state rrs = {0, 0};37083708
+34-34
drivers/block/drbd/drbd_nl.c
···103103 /* pointer into reply buffer */104104 struct drbd_genlmsghdr *reply_dh;105105 /* resolved from attributes, if possible */106106- struct drbd_conf *mdev;106106+ struct drbd_device *mdev;107107 struct drbd_tconn *tconn;108108} adm_ctx;109109···313313 snprintf(envp[3], 20, "DRBD_PEER_AF=%s", afs);314314}315315316316-int drbd_khelper(struct drbd_conf *mdev, char *cmd)316316+int drbd_khelper(struct drbd_device *mdev, char *cmd)317317{318318 char *envp[] = { "HOME=/",319319 "TERM=linux",···400400static enum drbd_fencing_p highest_fencing_policy(struct drbd_tconn *tconn)401401{402402 enum drbd_fencing_p fp = FP_NOT_AVAIL;403403- struct drbd_conf *mdev;403403+ struct drbd_device *mdev;404404 int vnr;405405406406 rcu_read_lock();···534534}535535536536enum drbd_state_rv537537-drbd_set_role(struct drbd_conf *mdev, enum drbd_role new_role, int force)537537+drbd_set_role(struct drbd_device *mdev, enum drbd_role new_role, int force)538538{539539 const int max_tries = 4;540540 enum drbd_state_rv rv = SS_UNKNOWN_ERROR;···729729 * Activity log size used to be fixed 32kB,730730 * but is about to become configurable.731731 */732732-static void drbd_md_set_sector_offsets(struct drbd_conf *mdev,732732+static void drbd_md_set_sector_offsets(struct drbd_device *mdev,733733 struct drbd_backing_dev *bdev)734734{735735 sector_t md_size_sect = 0;···807807 * and can be long lived.808808 * This changes an mdev->flag, is triggered by drbd internals,809809 * and should be short-lived. */810810-void drbd_suspend_io(struct drbd_conf *mdev)810810+void drbd_suspend_io(struct drbd_device *mdev)811811{812812 set_bit(SUSPEND_IO, &mdev->flags);813813 if (drbd_suspended(mdev))···815815 wait_event(mdev->misc_wait, !atomic_read(&mdev->ap_bio_cnt));816816}817817818818-void drbd_resume_io(struct drbd_conf *mdev)818818+void drbd_resume_io(struct drbd_device *mdev)819819{820820 clear_bit(SUSPEND_IO, &mdev->flags);821821 wake_up(&mdev->misc_wait);···829829 * You should call drbd_md_sync() after calling this function.830830 */831831enum determine_dev_size832832-drbd_determine_dev_size(struct drbd_conf *mdev, enum dds_flags flags, struct resize_parms *rs) __must_hold(local)832832+drbd_determine_dev_size(struct drbd_device *mdev, enum dds_flags flags, struct resize_parms *rs) __must_hold(local)833833{834834 sector_t prev_first_sect, prev_size; /* previous meta location */835835 sector_t la_size_sect, u_size;···979979}980980981981sector_t982982-drbd_new_dev_size(struct drbd_conf *mdev, struct drbd_backing_dev *bdev,982982+drbd_new_dev_size(struct drbd_device *mdev, struct drbd_backing_dev *bdev,983983 sector_t u_size, int assume_peer_has_space)984984{985985 sector_t p_size = mdev->p_size; /* partner's disk size. */···10331033 * failed, and 0 on success. You should call drbd_md_sync() after you called10341034 * this function.10351035 */10361036-static int drbd_check_al_size(struct drbd_conf *mdev, struct disk_conf *dc)10361036+static int drbd_check_al_size(struct drbd_device *mdev, struct disk_conf *dc)10371037{10381038 struct lru_cache *n, *t;10391039 struct lc_element *e;···10781078 return 0;10791079}1080108010811081-static void drbd_setup_queue_param(struct drbd_conf *mdev, unsigned int max_bio_size)10811081+static void drbd_setup_queue_param(struct drbd_device *mdev, unsigned int max_bio_size)10821082{10831083 struct request_queue * const q = mdev->rq_queue;10841084 unsigned int max_hw_sectors = max_bio_size >> 9;···11151115 }11161116}1117111711181118-void drbd_reconsider_max_bio_size(struct drbd_conf *mdev)11181118+void drbd_reconsider_max_bio_size(struct drbd_device *mdev)11191119{11201120 unsigned int now, new, local, peer;11211121···11801180}1181118111821182/* Make sure IO is suspended before calling this function(). */11831183-static void drbd_suspend_al(struct drbd_conf *mdev)11831183+static void drbd_suspend_al(struct drbd_device *mdev)11841184{11851185 int s = 0;11861186···12381238int drbd_adm_disk_opts(struct sk_buff *skb, struct genl_info *info)12391239{12401240 enum drbd_ret_code retcode;12411241- struct drbd_conf *mdev;12411241+ struct drbd_device *mdev;12421242 struct disk_conf *new_disk_conf, *old_disk_conf;12431243 struct fifo_buffer *old_plan = NULL, *new_plan = NULL;12441244 int err, fifo_size;···1366136613671367int drbd_adm_attach(struct sk_buff *skb, struct genl_info *info)13681368{13691369- struct drbd_conf *mdev;13691369+ struct drbd_device *mdev;13701370 int err;13711371 enum drbd_ret_code retcode;13721372 enum determine_dev_size dd;···18001800 return 0;18011801}1802180218031803-static int adm_detach(struct drbd_conf *mdev, int force)18031803+static int adm_detach(struct drbd_device *mdev, int force)18041804{18051805 enum drbd_state_rv retcode;18061806 int ret;···1862186218631863static bool conn_resync_running(struct drbd_tconn *tconn)18641864{18651865- struct drbd_conf *mdev;18651865+ struct drbd_device *mdev;18661866 bool rv = false;18671867 int vnr;18681868···1883188318841884static bool conn_ov_running(struct drbd_tconn *tconn)18851885{18861886- struct drbd_conf *mdev;18861886+ struct drbd_device *mdev;18871887 bool rv = false;18881888 int vnr;18891889···19031903static enum drbd_ret_code19041904_check_net_options(struct drbd_tconn *tconn, struct net_conf *old_conf, struct net_conf *new_conf)19051905{19061906- struct drbd_conf *mdev;19061906+ struct drbd_device *mdev;19071907 int i;1908190819091909 if (old_conf && tconn->cstate == C_WF_REPORT_PARAMS && tconn->agreed_pro_version < 100) {···19471947check_net_options(struct drbd_tconn *tconn, struct net_conf *new_conf)19481948{19491949 static enum drbd_ret_code rv;19501950- struct drbd_conf *mdev;19501950+ struct drbd_device *mdev;19511951 int i;1952195219531953 rcu_read_lock();···2139213921402140int drbd_adm_connect(struct sk_buff *skb, struct genl_info *info)21412141{21422142- struct drbd_conf *mdev;21422142+ struct drbd_device *mdev;21432143 struct net_conf *old_conf, *new_conf = NULL;21442144 struct crypto crypto = { };21452145 struct drbd_tconn *tconn;···23492349 return 0;23502350}2351235123522352-void resync_after_online_grow(struct drbd_conf *mdev)23522352+void resync_after_online_grow(struct drbd_device *mdev)23532353{23542354 int iass; /* I am sync source */23552355···23692369{23702370 struct disk_conf *old_disk_conf, *new_disk_conf = NULL;23712371 struct resize_parms rs;23722372- struct drbd_conf *mdev;23722372+ struct drbd_device *mdev;23732373 enum drbd_ret_code retcode;23742374 enum determine_dev_size dd;23752375 bool change_al_layout = false;···2535253525362536int drbd_adm_invalidate(struct sk_buff *skb, struct genl_info *info)25372537{25382538- struct drbd_conf *mdev;25382538+ struct drbd_device *mdev;25392539 int retcode; /* enum drbd_ret_code rsp. enum drbd_state_rv */2540254025412541 retcode = drbd_adm_prepare(skb, info, DRBD_ADM_NEED_MINOR);···25902590 return 0;25912591}2592259225932593-static int drbd_bmio_set_susp_al(struct drbd_conf *mdev)25932593+static int drbd_bmio_set_susp_al(struct drbd_device *mdev)25942594{25952595 int rv;25962596···26022602int drbd_adm_invalidate_peer(struct sk_buff *skb, struct genl_info *info)26032603{26042604 int retcode; /* drbd_ret_code, drbd_state_rv */26052605- struct drbd_conf *mdev;26052605+ struct drbd_device *mdev;2606260626072607 retcode = drbd_adm_prepare(skb, info, DRBD_ADM_NEED_MINOR);26082608 if (!adm_ctx.reply_skb)···2692269226932693int drbd_adm_resume_io(struct sk_buff *skb, struct genl_info *info)26942694{26952695- struct drbd_conf *mdev;26952695+ struct drbd_device *mdev;26962696 int retcode; /* enum drbd_ret_code rsp. enum drbd_state_rv */2697269726982698 retcode = drbd_adm_prepare(skb, info, DRBD_ADM_NEED_MINOR);···27532753 return -EMSGSIZE;27542754}2755275527562756-static int nla_put_status_info(struct sk_buff *skb, struct drbd_conf *mdev,27562756+static int nla_put_status_info(struct sk_buff *skb, struct drbd_device *mdev,27572757 const struct sib_info *sib)27582758{27592759 struct state_info *si = NULL; /* for sizeof(si->member); */···2897289728982898static int get_one_status(struct sk_buff *skb, struct netlink_callback *cb)28992899{29002900- struct drbd_conf *mdev;29002900+ struct drbd_device *mdev;29012901 struct drbd_genlmsghdr *dh;29022902 struct drbd_tconn *pos = (struct drbd_tconn*)cb->args[0];29032903 struct drbd_tconn *tconn = NULL;···3097309730983098int drbd_adm_start_ov(struct sk_buff *skb, struct genl_info *info)30993099{31003100- struct drbd_conf *mdev;31003100+ struct drbd_device *mdev;31013101 enum drbd_ret_code retcode;31023102 struct start_ov_parms parms;31033103···3138313831393139int drbd_adm_new_c_uuid(struct sk_buff *skb, struct genl_info *info)31403140{31413141- struct drbd_conf *mdev;31413141+ struct drbd_device *mdev;31423142 enum drbd_ret_code retcode;31433143 int skip_initial_sync = 0;31443144 int err;···33023302 return 0;33033303}3304330433053305-static enum drbd_ret_code adm_delete_minor(struct drbd_conf *mdev)33053305+static enum drbd_ret_code adm_delete_minor(struct drbd_device *mdev)33063306{33073307 if (mdev->state.disk == D_DISKLESS &&33083308 /* no need to be mdev->state.conn == C_STANDALONE &&···33413341int drbd_adm_down(struct sk_buff *skb, struct genl_info *info)33423342{33433343 int retcode; /* enum drbd_ret_code rsp. enum drbd_state_rv */33443344- struct drbd_conf *mdev;33443344+ struct drbd_device *mdev;33453345 unsigned i;3346334633473347 retcode = drbd_adm_prepare(skb, info, 0);···34413441 return 0;34423442}3443344334443444-void drbd_bcast_event(struct drbd_conf *mdev, const struct sib_info *sib)34443444+void drbd_bcast_event(struct drbd_device *mdev, const struct sib_info *sib)34453445{34463446 static atomic_t drbd_genl_seq = ATOMIC_INIT(2); /* two. */34473447 struct sk_buff *msg;