From patchwork Fri Dec 3 19:55:31 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonthan Brassow X-Patchwork-Id: 378981 Received: from mx4-phx2.redhat.com (mx4-phx2.redhat.com [209.132.183.25]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oB3JvRBe008309 for ; Fri, 3 Dec 2010 19:57:48 GMT Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx4-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id oB3Jtc7f016312; Fri, 3 Dec 2010 14:55:38 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id oB3JtblD001186 for ; Fri, 3 Dec 2010 14:55:37 -0500 Received: from hydrogen.msp.redhat.com (hydrogen.msp.redhat.com [10.15.80.1]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id oB3JtWdE020601 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 3 Dec 2010 14:55:32 -0500 Received: from hydrogen.msp.redhat.com ([127.0.0.1]) by hydrogen.msp.redhat.com (8.14.1/8.14.1) with ESMTP id oB3JtVe5003564; Fri, 3 Dec 2010 13:55:31 -0600 Received: (from jbrassow@localhost) by hydrogen.msp.redhat.com (8.14.1/8.14.1/Submit) id oB3JtV1K003563; Fri, 3 Dec 2010 13:55:31 -0600 Date: Fri, 3 Dec 2010 13:55:31 -0600 From: Jonathan Brassow Message-Id: <201012031955.oB3JtV1K003563@hydrogen.msp.redhat.com> To: dm-devel@redhat.com X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-loop: dm-devel@redhat.com Subject: [dm-devel] [PATCH 11 of 15] md new param to_sync_page_io X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Fri, 03 Dec 2010 19:57:48 +0000 (UTC) Index: linux-2.6/drivers/md/bitmap.c =================================================================== --- linux-2.6.orig/drivers/md/bitmap.c +++ linux-2.6/drivers/md/bitmap.c @@ -213,7 +213,7 @@ static struct page *read_sb_page(mddev_t if (sync_page_io(rdev, target, roundup(size, bdev_logical_block_size(rdev->bdev)), - page, READ)) { + page, READ, 1)) { page->index = index; attach_page_buffers(page, NULL); /* so that free_buffer will * quietly no-op */ Index: linux-2.6/drivers/md/md.c =================================================================== --- linux-2.6.orig/drivers/md/md.c +++ linux-2.6/drivers/md/md.c @@ -794,7 +794,7 @@ static void bi_complete(struct bio *bio, } int sync_page_io(mdk_rdev_t *rdev, sector_t sector, int size, - struct page *page, int rw) + struct page *page, int rw, int metadata_op) { struct bio *bio = bio_alloc_mddev(GFP_NOIO, 1, rdev->mddev); struct completion event; @@ -828,7 +828,7 @@ static int read_disk_sb(mdk_rdev_t * rde return 0; - if (!sync_page_io(rdev, rdev->sb_start, size, rdev->sb_page, READ)) + if (!sync_page_io(rdev, rdev->sb_start, size, rdev->sb_page, READ, 1)) goto fail; rdev->sb_loaded = 1; return 0; Index: linux-2.6/drivers/md/md.h =================================================================== --- linux-2.6.orig/drivers/md/md.h +++ linux-2.6/drivers/md/md.h @@ -493,7 +493,7 @@ extern void md_super_write(mddev_t *mdde sector_t sector, int size, struct page *page); extern void md_super_wait(mddev_t *mddev); extern int sync_page_io(mdk_rdev_t *rdev, sector_t sector, int size, - struct page *page, int rw); + struct page *page, int rw, int metadata_op); extern void md_do_sync(mddev_t *mddev); extern void md_new_event(mddev_t *mddev); extern int md_allow_write(mddev_t *mddev); Index: linux-2.6/drivers/md/raid1.c =================================================================== --- linux-2.6.orig/drivers/md/raid1.c +++ linux-2.6/drivers/md/raid1.c @@ -1366,7 +1366,7 @@ static void sync_request_write(mddev_t * sect + rdev->data_offset, s<<9, bio->bi_io_vec[idx].bv_page, - READ)) { + READ, 0)) { success = 1; break; } @@ -1392,7 +1392,7 @@ static void sync_request_write(mddev_t * sect + rdev->data_offset, s<<9, bio->bi_io_vec[idx].bv_page, - WRITE) == 0) + WRITE, 0) == 0) md_error(mddev, rdev); } d = start; @@ -1407,7 +1407,7 @@ static void sync_request_write(mddev_t * sect + rdev->data_offset, s<<9, bio->bi_io_vec[idx].bv_page, - READ) == 0) + READ, 0) == 0) md_error(mddev, rdev); } } else { @@ -1490,7 +1490,7 @@ static void fix_read_error(conf_t *conf, sync_page_io(rdev, sect + rdev->data_offset, s<<9, - conf->tmppage, READ)) + conf->tmppage, READ, 0)) success = 1; else { d++; @@ -1515,7 +1515,7 @@ static void fix_read_error(conf_t *conf, test_bit(In_sync, &rdev->flags)) { if (sync_page_io(rdev, sect + rdev->data_offset, - s<<9, conf->tmppage, WRITE) + s<<9, conf->tmppage, WRITE, 0) == 0) /* Well, this device is dead */ md_error(mddev, rdev); @@ -1532,7 +1532,7 @@ static void fix_read_error(conf_t *conf, test_bit(In_sync, &rdev->flags)) { if (sync_page_io(rdev, sect + rdev->data_offset, - s<<9, conf->tmppage, READ) + s<<9, conf->tmppage, READ, 0) == 0) /* Well, this device is dead */ md_error(mddev, rdev); Index: linux-2.6/drivers/md/raid10.c =================================================================== --- linux-2.6.orig/drivers/md/raid10.c +++ linux-2.6/drivers/md/raid10.c @@ -1561,7 +1561,7 @@ static void fix_read_error(conf_t *conf, r10_bio->devs[sl].addr + sect + rdev->data_offset, s<<9, - conf->tmppage, READ); + conf->tmppage, READ, 0); rdev_dec_pending(rdev, mddev); rcu_read_lock(); if (success) @@ -1599,7 +1599,7 @@ static void fix_read_error(conf_t *conf, if (sync_page_io(rdev, r10_bio->devs[sl].addr + sect + rdev->data_offset, - s<<9, conf->tmppage, WRITE) + s<<9, conf->tmppage, WRITE, 0) == 0) { /* Well, this device is dead */ printk(KERN_NOTICE @@ -1637,7 +1637,7 @@ static void fix_read_error(conf_t *conf, r10_bio->devs[sl].addr + sect + rdev->data_offset, s<<9, conf->tmppage, - READ) == 0) { + READ, 0) == 0) { /* Well, this device is dead */ printk(KERN_NOTICE "md/raid10:%s: unable to read back "