[DRBD-cvs] svn commit by lars - r2552 - trunk/drbd - make this
use-bmbv thing actually work
drbd-cvs at lists.linbit.com
drbd-cvs at lists.linbit.com
Thu Oct 19 18:28:13 CEST 2006
Author: lars
Date: 2006-10-19 18:28:12 +0200 (Thu, 19 Oct 2006)
New Revision: 2552
Modified:
trunk/drbd/drbd_int.h
trunk/drbd/drbd_nl.c
trunk/drbd/drbd_req.c
Log:
make this use-bmbv thing actually work
Modified: trunk/drbd/drbd_int.h
===================================================================
--- trunk/drbd/drbd_int.h 2006-10-19 14:55:58 UTC (rev 2551)
+++ trunk/drbd/drbd_int.h 2006-10-19 16:28:12 UTC (rev 2552)
@@ -746,7 +746,6 @@
struct file *md_file;
struct drbd_md md;
struct disk_conf dc; /* The user provided config... */
- merge_bvec_fn *bmbf; /* short cut to backing devices' merge_bvec_fn */
};
struct Drbd_Conf {
Modified: trunk/drbd/drbd_nl.c
===================================================================
--- trunk/drbd/drbd_nl.c 2006-10-19 14:55:58 UTC (rev 2551)
+++ trunk/drbd/drbd_nl.c 2006-10-19 16:28:12 UTC (rev 2552)
@@ -560,12 +560,8 @@
request_queue_t * const b = mdev->bc->backing_bdev->bd_disk->queue;
//unsigned int old_max_seg_s = q->max_segment_size;
- if(b->merge_bvec_fn && mdev->bc->dc.use_bmbv) {
- mdev->bc->bmbf = b->merge_bvec_fn;
- } else {
+ if (b->merge_bvec_fn && !mdev->bc->dc.use_bmbv)
max_seg_s = PAGE_SIZE;
- mdev->bc->bmbf = NULL;
- }
q->max_sectors = max_seg_s >> 9;
q->max_phys_segments = max_seg_s >> PAGE_SHIFT;
Modified: trunk/drbd/drbd_req.c
===================================================================
--- trunk/drbd/drbd_req.c 2006-10-19 14:55:58 UTC (rev 2551)
+++ trunk/drbd/drbd_req.c 2006-10-19 16:28:12 UTC (rev 2552)
@@ -1116,11 +1116,9 @@
if (bio_size == 0) {
if (limit <= bvec->bv_len) limit = bvec->bv_len;
} else if (limit && inc_local(mdev)) {
- /* FIXME
- * I don't think taking a shortcut is valid, the backing device
- * is allowed to change its merge bvec function anytime... */
- if (mdev->bc->bmbf) {
- backing_limit = mdev->bc->bmbf(q,bio,bvec);
+ request_queue_t * const b = mdev->bc->backing_bdev->bd_disk->queue;
+ if(b->merge_bvec_fn && mdev->bc->dc.use_bmbv) {
+ backing_limit = b->merge_bvec_fn(b,bio,bvec);
limit = min(limit,backing_limit);
}
dec_local(mdev);
More information about the drbd-cvs
mailing list