From patchwork Fri Jun 26 04:55:16 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Snitzer X-Patchwork-Id: 32506 Received: from hormel.redhat.com (hormel1.redhat.com [209.132.177.33]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n5Q4ter4005031 for ; Fri, 26 Jun 2009 04:55:40 GMT Received: from listman.util.phx.redhat.com (listman.util.phx.redhat.com [10.8.4.110]) by hormel.redhat.com (Postfix) with ESMTP id 65FA561896F; Fri, 26 Jun 2009 00:55:39 -0400 (EDT) Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by listman.util.phx.redhat.com (8.13.1/8.13.1) with ESMTP id n5Q4tb1U018127 for ; Fri, 26 Jun 2009 00:55:38 -0400 Received: from mx1.redhat.com (mx1.redhat.com [172.16.48.31]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n5Q4tbhU030165 for ; Fri, 26 Jun 2009 00:55:37 -0400 Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.27]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n5Q4tN86017038 for ; Fri, 26 Jun 2009 00:55:23 -0400 Received: by qw-out-2122.google.com with SMTP id 5so929047qwi.39 for ; Thu, 25 Jun 2009 21:55:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer:in-reply-to:references; bh=EON1Q89EejHSbYtJzKze+e5xzhlnqNHDITSA8MF00Xk=; b=ijMci3JQsmzuFeh3WHFzi19C786hAELPXum0YNZpx1VN74Fy7nAef/ECNvdb7SfoeT WYDj+71PMTmU1PJPPPAVEMt8pCA3Ds1RxSNxs9bIuRIFOHi6crCdiYyv7gLS/hbvmvA5 OMPk1Q4A5Lf0RUBzfOOSn0Lpcxhz2A94mbTs4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=TpRR5sjAq1E5n+VKAyXLo6UzNiGCtBRjE38BywNEWZeBSXTQO1F0TacS0OKeevtfJd Ij8kwScRUvuG507qHjdqV3t4Zh0ScPF10DENf4yQs5RD4ogo5EuVhYkwWak6awW3GD2b 4TI8+jFPoTQPM5BmUujXN+++lrI2KucuNWeKU= Received: by 10.224.11.79 with SMTP id s15mr2738934qas.372.1245992122783; Thu, 25 Jun 2009 21:55:22 -0700 (PDT) Received: from localhost (pool-141-157-169-195.bstnma.east.verizon.net [141.157.169.195]) by mx.google.com with ESMTPS id 2sm4672809qwi.23.2009.06.25.21.55.21 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 25 Jun 2009 21:55:21 -0700 (PDT) From: Mike Snitzer To: dm-devel@redhat.com Date: Fri, 26 Jun 2009 00:55:16 -0400 Message-Id: <1245992116-28947-2-git-send-email-snitzer@gmail.com> In-Reply-To: <1245992116-28947-1-git-send-email-snitzer@gmail.com> References: <1245992116-28947-1-git-send-email-snitzer@gmail.com> X-RedHat-Spam-Score: 0 X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 X-Scanned-By: MIMEDefang 2.63 on 172.16.48.31 X-loop: dm-devel@redhat.com Cc: martin.petersen@oracle.com Subject: [dm-devel] [RFC][PATCH 2/2] properly expose dm-stripe target's I/O hints X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.5 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com Add .io_hints to 'struct target_type' to allow the I/O hints portion of the 'struct queue_limits' to be set in dm-stripe target. --- drivers/md/dm-stripe.c | 11 +++++++++++ drivers/md/dm-table.c | 4 ++++ include/linux/device-mapper.h | 4 ++++ 3 files changed, 19 insertions(+) -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel Index: linux-2.6/drivers/md/dm-stripe.c =================================================================== --- linux-2.6.orig/drivers/md/dm-stripe.c 2009-06-26 00:39:22.000000000 -0400 +++ linux-2.6/drivers/md/dm-stripe.c 2009-06-26 00:44:42.000000000 -0400 @@ -328,6 +328,16 @@ return ret; } +static void stripe_io_hints(struct dm_target *ti, + struct queue_limits *limits) +{ + struct stripe_c *sc = ti->private; + unsigned chunk_size = (sc->chunk_mask + 1) << 9; + + blk_limits_io_min(chunk_size); + limits->io_opt = chunk_size * sc->stripes; +} + static struct target_type stripe_target = { .name = "striped", .version = {1, 2, 0}, @@ -338,6 +348,7 @@ .end_io = stripe_end_io, .status = stripe_status, .iterate_devices = stripe_iterate_devices, + .io_hints = stripe_io_hints, }; int __init dm_stripe_init(void) Index: linux-2.6/drivers/md/dm-table.c =================================================================== --- linux-2.6.orig/drivers/md/dm-table.c 2009-06-26 00:39:22.000000000 -0400 +++ linux-2.6/drivers/md/dm-table.c 2009-06-26 00:44:42.000000000 -0400 @@ -1001,6 +1001,10 @@ ti->type->iterate_devices(ti, dm_set_device_limits, &ti_limits); + /* Set I/O hints portion of queue limits */ + if (ti->type->io_hints) + ti->type->io_hints(ti, &ti_limits); + /* * Check each device area is consistent with the target's * overall queue limits. Index: linux-2.6/include/linux/device-mapper.h =================================================================== --- linux-2.6.orig/include/linux/device-mapper.h 2009-06-26 00:39:22.000000000 -0400 +++ linux-2.6/include/linux/device-mapper.h 2009-06-26 00:44:42.000000000 -0400 @@ -91,6 +91,9 @@ iterate_devices_callout_fn fn, void *data); +typedef void (*dm_io_hints_fn) (struct dm_target *ti, + struct queue_limits *limits); + /* * Returns: * 0: The target can handle the next I/O immediately. @@ -151,6 +154,7 @@ dm_merge_fn merge; dm_busy_fn busy; dm_iterate_devices_fn iterate_devices; + dm_io_hints_fn io_hints; /* For internal device-mapper use. */ struct list_head list;