aboutsummaryrefslogtreecommitdiff
path: root/fs/partitions
diff options
context:
space:
mode:
authorJens Axboe <jaxboe@fusionio.com>2011-07-01 16:17:13 +0200
committerJens Axboe <jaxboe@fusionio.com>2011-07-01 16:17:13 +0200
commit04bf7869ca0fd12009aee301cac2264a36df4d98 (patch)
tree66cb81ebf8b76560a31433c2c493dc430c914af9 /fs/partitions
parentd2f31a5fd60d168b00fc4f7617b68a1287b21e90 (diff)
parent7b28afe01ab6ffb5f152f47831b44933facd2328 (diff)
Merge branch 'for-linus' into for-3.1/core
Conflicts: block/blk-throttle.c block/cfq-iosched.c Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'fs/partitions')
-rw-r--r--fs/partitions/check.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/fs/partitions/check.c b/fs/partitions/check.c
index 0ead4354943..e3c63d1c5e1 100644
--- a/fs/partitions/check.c
+++ b/fs/partitions/check.c
@@ -255,13 +255,7 @@ static ssize_t part_discard_alignment_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct hd_struct *p = dev_to_part(dev);
- struct gendisk *disk = dev_to_disk(dev);
- unsigned int alignment = 0;
-
- if (disk->queue)
- alignment = queue_limit_discard_alignment(&disk->queue->limits,
- p->start_sect);
- return sprintf(buf, "%u\n", alignment);
+ return sprintf(buf, "%u\n", p->discard_alignment);
}
ssize_t part_stat_show(struct device *dev,
@@ -455,6 +449,8 @@ struct hd_struct *add_partition(struct gendisk *disk, int partno,
p->start_sect = start;
p->alignment_offset =
queue_limit_alignment_offset(&disk->queue->limits, start);
+ p->discard_alignment =
+ queue_limit_discard_alignment(&disk->queue->limits, start);
p->nr_sects = len;
p->partno = partno;
p->policy = get_disk_ro(disk);