diff options
| author | mlelstv <mlelstv@NetBSD.org> | 2010-12-23 14:58:13 +0000 |
|---|---|---|
| committer | mlelstv <mlelstv@NetBSD.org> | 2010-12-23 14:58:13 +0000 |
| commit | 8c3ce541fba63061602b31b4c95ff0d056f3b769 (patch) | |
| tree | ecad0048e7c4b4c04cadd3050c4a4e13a0560a33 /sys/dev/dm/dm_target_linear.c | |
| parent | 4ebb5d99777fea12743bcfc8e06d466325a7f33c (diff) | |
make dm aware of physical sector sizes.
For aggregates of multiple disks we use the largest sector size from
all disks. For standard power-of-2 sizes this is the same as the least
common multiple. We still require proper alignment of the targets in
the mapping table.
ok by haad@
Diffstat (limited to 'sys/dev/dm/dm_target_linear.c')
| -rw-r--r-- | sys/dev/dm/dm_target_linear.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/sys/dev/dm/dm_target_linear.c b/sys/dev/dm/dm_target_linear.c index 01c88fdc117..a9b121f704c 100644 --- a/sys/dev/dm/dm_target_linear.c +++ b/sys/dev/dm/dm_target_linear.c @@ -1,4 +1,4 @@ -/* $NetBSD: dm_target_linear.c,v 1.11 2010/11/15 05:53:29 uebayasi Exp $ */ +/* $NetBSD: dm_target_linear.c,v 1.12 2010/12/23 14:58:13 mlelstv Exp $ */ /* * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -219,6 +219,26 @@ dm_target_linear_upcall(dm_table_entry_t * table_en, struct buf * bp) return 0; } /* + * Query physical block size of this target + * For a linear target this is just the sector size of the underlying device + */ +int +dm_target_linear_secsize(dm_table_entry_t * table_en, unsigned *secsizep) +{ + dm_target_linear_config_t *tlc; + unsigned secsize; + + secsize = 0; + + tlc = table_en->target_config; + if (tlc != NULL) + secsize = tlc->pdev->pdev_secsize; + + *secsizep = secsize; + + return 0; +} +/* * Transform char s to uint64_t offset number. */ uint64_t |
