diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-30 15:43:21 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-30 15:43:21 -0500 |
commit | e48b7b66a6531f02f1264c7196f7069a9ce9251a (patch) | |
tree | d45ce978262e3c32ce8fe460516bb9aae0cc2fb4 /include/linux | |
parent | 5ccf73bb4dc7cc9e1f761202a34de5714164724f (diff) | |
parent | 9bd3f98821a83041e77ee25158b80b535d02d7b4 (diff) |
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
* 'for-linus' of git://git.kernel.dk/linux-2.6-block:
block: blk_rq_err_sectors cleanup
block: Honor the gfp_mask for alloc_page() in blkdev_issue_discard()
block: Fix incorrect alignment offset reporting and update documentation
cfq-iosched: don't regard requests with long distance as close
aoe: switch to the new bio_flush_dcache_pages() interface
drivers/block/mg_disk.c: use resource_size()
drivers/block/DAC960.c: use DAC960_V2_Controller
block: Fix topology stacking for data and discard alignment
drbd: remove unused #include <linux/version.h>
drbd: remove duplicated #include
drbd: Fix test of unsigned in _drbd_fault_random()
drbd: Constify struct file_operations
cfq-iosched: Remove prio_change logic for workload selection
cfq-iosched: Get rid of nr_groups
cfq-iosched: Remove the check for same cfq group from allow_merge
drbd: fix test of unsigned in _drbd_fault_random()
block: remove Documentation/block/as-iosched.txt
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/blkdev.h | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 784a919aa0d0..9b98173a8184 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -845,7 +845,6 @@ static inline struct request_queue *bdev_get_queue(struct block_device *bdev) | |||
845 | * blk_rq_err_bytes() : bytes left till the next error boundary | 845 | * blk_rq_err_bytes() : bytes left till the next error boundary |
846 | * blk_rq_sectors() : sectors left in the entire request | 846 | * blk_rq_sectors() : sectors left in the entire request |
847 | * blk_rq_cur_sectors() : sectors left in the current segment | 847 | * blk_rq_cur_sectors() : sectors left in the current segment |
848 | * blk_rq_err_sectors() : sectors left till the next error boundary | ||
849 | */ | 848 | */ |
850 | static inline sector_t blk_rq_pos(const struct request *rq) | 849 | static inline sector_t blk_rq_pos(const struct request *rq) |
851 | { | 850 | { |
@@ -874,11 +873,6 @@ static inline unsigned int blk_rq_cur_sectors(const struct request *rq) | |||
874 | return blk_rq_cur_bytes(rq) >> 9; | 873 | return blk_rq_cur_bytes(rq) >> 9; |
875 | } | 874 | } |
876 | 875 | ||
877 | static inline unsigned int blk_rq_err_sectors(const struct request *rq) | ||
878 | { | ||
879 | return blk_rq_err_bytes(rq) >> 9; | ||
880 | } | ||
881 | |||
882 | /* | 876 | /* |
883 | * Request issue related functions. | 877 | * Request issue related functions. |
884 | */ | 878 | */ |
@@ -1116,11 +1110,18 @@ static inline int queue_alignment_offset(struct request_queue *q) | |||
1116 | return q->limits.alignment_offset; | 1110 | return q->limits.alignment_offset; |
1117 | } | 1111 | } |
1118 | 1112 | ||
1113 | static inline int queue_limit_alignment_offset(struct queue_limits *lim, sector_t offset) | ||
1114 | { | ||
1115 | unsigned int granularity = max(lim->physical_block_size, lim->io_min); | ||
1116 | |||
1117 | offset &= granularity - 1; | ||
1118 | return (granularity + lim->alignment_offset - offset) & (granularity - 1); | ||
1119 | } | ||
1120 | |||
1119 | static inline int queue_sector_alignment_offset(struct request_queue *q, | 1121 | static inline int queue_sector_alignment_offset(struct request_queue *q, |
1120 | sector_t sector) | 1122 | sector_t sector) |
1121 | { | 1123 | { |
1122 | return ((sector << 9) - q->limits.alignment_offset) | 1124 | return queue_limit_alignment_offset(&q->limits, sector << 9); |
1123 | & (q->limits.io_min - 1); | ||
1124 | } | 1125 | } |
1125 | 1126 | ||
1126 | static inline int bdev_alignment_offset(struct block_device *bdev) | 1127 | static inline int bdev_alignment_offset(struct block_device *bdev) |