From: Joe Thornber <thornber@redhat.com>
To: Joe Thornber <thornber@redhat.com>
Cc: Andrew Morton <akpm@osdl.org>,
Linux Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [Patch 4/6] dm: default queue limits
Date: Fri, 20 Feb 2004 15:39:57 +0000 [thread overview]
Message-ID: <20040220153957.GU27549@reti> (raw)
In-Reply-To: <20040220153615.GR27549@reti>
Fill in missing queue limitations when table is complete instead of
enforcing the "default" limits on every dm device.
Problem noticed by Mike Christie.
[Christophe Saout]
--- diff/drivers/md/dm-table.c 2004-02-18 15:38:06.000000000 +0000
+++ source/drivers/md/dm-table.c 2004-02-18 15:40:07.000000000 +0000
@@ -629,14 +629,20 @@ static int split_args(int *argc, char **
return 0;
}
-static void set_default_limits(struct io_restrictions *rs)
+static void check_for_valid_limits(struct io_restrictions *rs)
{
- rs->max_sectors = MAX_SECTORS;
- rs->max_phys_segments = MAX_PHYS_SEGMENTS;
- rs->max_hw_segments = MAX_HW_SEGMENTS;
- rs->hardsect_size = 1 << SECTOR_SHIFT;
- rs->max_segment_size = MAX_SEGMENT_SIZE;
- rs->seg_boundary_mask = -1;
+ if (!rs->max_sectors)
+ rs->max_sectors = MAX_SECTORS;
+ if (!rs->max_phys_segments)
+ rs->max_phys_segments = MAX_PHYS_SEGMENTS;
+ if (!rs->max_hw_segments)
+ rs->max_hw_segments = MAX_HW_SEGMENTS;
+ if (!rs->hardsect_size)
+ rs->hardsect_size = 1 << SECTOR_SHIFT;
+ if (!rs->max_segment_size)
+ rs->max_segment_size = MAX_SEGMENT_SIZE;
+ if (!rs->seg_boundary_mask)
+ rs->seg_boundary_mask = -1;
}
int dm_table_add_target(struct dm_table *t, const char *type,
@@ -651,7 +657,6 @@ int dm_table_add_target(struct dm_table
tgt = t->targets + t->num_targets;
memset(tgt, 0, sizeof(*tgt));
- set_default_limits(&tgt->limits);
if (!len) {
tgt->error = "zero-length target";
@@ -736,6 +741,8 @@ int dm_table_complete(struct dm_table *t
int r = 0;
unsigned int leaf_nodes;
+ check_for_valid_limits(&t->limits);
+
/* how many indexes will the btree have ? */
leaf_nodes = dm_div_up(t->num_targets, KEYS_PER_NODE);
t->depth = 1 + int_log(leaf_nodes, CHILDREN_PER_NODE);
next prev parent reply other threads:[~2004-02-20 15:42 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-02-20 15:31 device-mapper patchset Joe Thornber
2004-02-20 15:34 ` [Patch 1/6] dm: endio method Joe Thornber
2004-02-21 9:58 ` Mike Christie
2004-02-21 10:44 ` Christophe Saout
2004-02-23 10:05 ` Joe Thornber
2004-02-23 22:08 ` Mike Christie
2004-02-23 22:29 ` Joe Thornber
2004-02-24 2:18 ` Mike Christie
2004-02-20 15:34 ` [Patch 2/6] dm: remove v1 ioctl interface Joe Thornber
2004-02-20 20:18 ` Andreas Jellinghaus
2004-02-21 6:15 ` Andrew Morton
2004-02-20 15:35 ` [Patch 3/6] dm: list_for_each_entry audit Joe Thornber
2004-02-20 15:36 ` [Patch 4/6] dm: default queue limits Joe Thornber
2004-02-20 15:39 ` Joe Thornber [this message]
2004-02-20 15:37 ` [Patch 5/6] dm: list targets cmd Joe Thornber
2004-02-21 6:17 ` Andrew Morton
2004-02-20 15:37 ` [Patch 6/6] dm: multipath target Joe Thornber
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040220153957.GU27549@reti \
--to=thornber@redhat.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox