diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-06-03 19:11:26 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-06-03 19:11:26 -0400 |
commit | 4f1ba49efafccbc73017f824efa2505c81b247cd (patch) | |
tree | db072bbccffd1f1c6b1269ac7a752cb30af3a726 /fs | |
parent | 39b4a46f19295b4876fba6655f27d67232dc6a1f (diff) | |
parent | e3a57b3ccf5c04934ac43b5b80e32ba51b817288 (diff) |
Merge branch 'for-linus' of git://git.kernel.dk/linux-block
* 'for-linus' of git://git.kernel.dk/linux-block:
block: Use hlist_entry() for io_context.cic_list.first
cfq-iosched: Remove bogus check in queue_fail path
xen/blkback: potential null dereference in error handling
xen/blkback: don't call vbd_size() if bd_disk is NULL
block: blkdev_get() should access ->bd_disk only after success
CFQ: Fix typo and remove unnecessary semicolon
block: remove unwanted semicolons
Revert "block: Remove extra discard_alignment from hd_struct."
nbd: adjust 'max_part' according to part_shift
nbd: limit module parameters to a sane value
nbd: pass MSG_* flags to kernel_recvmsg()
block: improve the bio_add_page() and bio_add_pc_page() descriptions
Diffstat (limited to 'fs')
-rw-r--r-- | fs/block_dev.c | 4 | ||||
-rw-r--r-- | fs/partitions/check.c | 10 |
2 files changed, 5 insertions, 9 deletions
diff --git a/fs/block_dev.c b/fs/block_dev.c index 1f2b19978333..1a2421f908f0 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c | |||
@@ -1272,8 +1272,8 @@ int blkdev_get(struct block_device *bdev, fmode_t mode, void *holder) | |||
1272 | * individual writeable reference is too fragile given the | 1272 | * individual writeable reference is too fragile given the |
1273 | * way @mode is used in blkdev_get/put(). | 1273 | * way @mode is used in blkdev_get/put(). |
1274 | */ | 1274 | */ |
1275 | if ((disk->flags & GENHD_FL_BLOCK_EVENTS_ON_EXCL_WRITE) && | 1275 | if (!res && (mode & FMODE_WRITE) && !bdev->bd_write_holder && |
1276 | !res && (mode & FMODE_WRITE) && !bdev->bd_write_holder) { | 1276 | (disk->flags & GENHD_FL_BLOCK_EVENTS_ON_EXCL_WRITE)) { |
1277 | bdev->bd_write_holder = true; | 1277 | bdev->bd_write_holder = true; |
1278 | disk_block_events(disk); | 1278 | disk_block_events(disk); |
1279 | } | 1279 | } |
diff --git a/fs/partitions/check.c b/fs/partitions/check.c index f82e762eeca2..d545e97d99c3 100644 --- a/fs/partitions/check.c +++ b/fs/partitions/check.c | |||
@@ -255,13 +255,7 @@ ssize_t part_discard_alignment_show(struct device *dev, | |||
255 | struct device_attribute *attr, char *buf) | 255 | struct device_attribute *attr, char *buf) |
256 | { | 256 | { |
257 | struct hd_struct *p = dev_to_part(dev); | 257 | struct hd_struct *p = dev_to_part(dev); |
258 | struct gendisk *disk = dev_to_disk(dev); | 258 | return sprintf(buf, "%u\n", p->discard_alignment); |
259 | unsigned int alignment = 0; | ||
260 | |||
261 | if (disk->queue) | ||
262 | alignment = queue_limit_discard_alignment(&disk->queue->limits, | ||
263 | p->start_sect); | ||
264 | return sprintf(buf, "%u\n", alignment); | ||
265 | } | 259 | } |
266 | 260 | ||
267 | ssize_t part_stat_show(struct device *dev, | 261 | ssize_t part_stat_show(struct device *dev, |
@@ -455,6 +449,8 @@ struct hd_struct *add_partition(struct gendisk *disk, int partno, | |||
455 | p->start_sect = start; | 449 | p->start_sect = start; |
456 | p->alignment_offset = | 450 | p->alignment_offset = |
457 | queue_limit_alignment_offset(&disk->queue->limits, start); | 451 | queue_limit_alignment_offset(&disk->queue->limits, start); |
452 | p->discard_alignment = | ||
453 | queue_limit_discard_alignment(&disk->queue->limits, start); | ||
458 | p->nr_sects = len; | 454 | p->nr_sects = len; |
459 | p->partno = partno; | 455 | p->partno = partno; |
460 | p->policy = get_disk_ro(disk); | 456 | p->policy = get_disk_ro(disk); |