[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[dm-devel] Re: [PATCH v2] dm: add topology support

On Fri, Jun 12, 2009 at 12:17:57AM -0400, Mike Snitzer wrote:
> But the following still establishes each target device's limits during
> stage1 (dm_set_device_limits).  I don't see a way to avoid this given
> that we only know the table's target devices (and associated bdev and
> request_queue) through each target's ctr():
Also available from:
  struct list_head *dm_table_get_devices(struct dm_table *t)
(A list of struct dm_dev_internal, defined in dm.h.)

We might need to pass the offset at which the device occurs
within the table into dm_get_device() and, for now, only storing
it there first time for each device and assume userspace has taken
account of the alignment offset consistently.

> 	       	  -> blk_stack_limits(ti, bdev->q->limits)
> 		     [NOTE: changed to: ti->limits = q->limits below]
> 		     [NOTE: this copy can't be delayed, need
> 		      access to target's bdev; only available through
> 		      ctr's params]

See above.

> -	if (blk_stack_limits(&ti->limits, &q->limits, 0) < 0)
> -		DMWARN("%s: target device %s is misaligned",
> -		       dm_device_name(ti->table->md), bdevname(bdev, b));

Userspace code is responsible for avoiding these cases, but we could now
move the misalignment warnings (without failing) to dm_table_set_restrictions().

> +	 * Each target device in the table has a data area that is aligned
> +	 * (via LVM2) so the DM device's alignment_offset should be 0.

There are userspace users other than LVM2:-)
Use dm_table_get_devices() here with the offset stored earlier instead,
removing struct queue_limits from struct dm_table.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]