Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 156367
b: refs/heads/master
c: 7c958e3
h: refs/heads/master
i:
  156365: b8a76fc
  156363: da45851
  156359: 54f3e0f
  156351: 9d7f6da
v: v3
  • Loading branch information
Martin K. Petersen authored and Jens Axboe committed Aug 1, 2009
1 parent 991c042 commit c690c07
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fef246672b009cf3f7a74e2fc9a76932ef2eeed2
refs/heads/master: 7c958e32649e0c35801762878fb0b6da8c55a515
31 changes: 24 additions & 7 deletions trunk/block/blk-settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,29 @@ void blk_queue_alignment_offset(struct request_queue *q, unsigned int offset)
}
EXPORT_SYMBOL(blk_queue_alignment_offset);

/**
* blk_limits_io_min - set minimum request size for a device
* @limits: the queue limits
* @min: smallest I/O size in bytes
*
* Description:
* Some devices have an internal block size bigger than the reported
* hardware sector size. This function can be used to signal the
* smallest I/O the device can perform without incurring a performance
* penalty.
*/
void blk_limits_io_min(struct queue_limits *limits, unsigned int min)
{
limits->io_min = min;

if (limits->io_min < limits->logical_block_size)
limits->io_min = limits->logical_block_size;

if (limits->io_min < limits->physical_block_size)
limits->io_min = limits->physical_block_size;
}
EXPORT_SYMBOL(blk_limits_io_min);

/**
* blk_queue_io_min - set minimum request size for the queue
* @q: the request queue for the device
Expand All @@ -396,13 +419,7 @@ EXPORT_SYMBOL(blk_queue_alignment_offset);
*/
void blk_queue_io_min(struct request_queue *q, unsigned int min)
{
q->limits.io_min = min;

if (q->limits.io_min < q->limits.logical_block_size)
q->limits.io_min = q->limits.logical_block_size;

if (q->limits.io_min < q->limits.physical_block_size)
q->limits.io_min = q->limits.physical_block_size;
blk_limits_io_min(&q->limits, min);
}
EXPORT_SYMBOL(blk_queue_io_min);

Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/blkdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -913,6 +913,7 @@ extern void blk_queue_logical_block_size(struct request_queue *, unsigned short)
extern void blk_queue_physical_block_size(struct request_queue *, unsigned short);
extern void blk_queue_alignment_offset(struct request_queue *q,
unsigned int alignment);
extern void blk_limits_io_min(struct queue_limits *limits, unsigned int min);
extern void blk_queue_io_min(struct request_queue *q, unsigned int min);
extern void blk_queue_io_opt(struct request_queue *q, unsigned int opt);
extern void blk_set_default_limits(struct queue_limits *lim);
Expand Down

0 comments on commit c690c07

Please sign in to comment.