Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 156368
b: refs/heads/master
c: 70dd5bf
h: refs/heads/master
v: v3
  • Loading branch information
Martin K. Petersen authored and Jens Axboe committed Aug 1, 2009
1 parent c690c07 commit 7f5d565
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7c958e32649e0c35801762878fb0b6da8c55a515
refs/heads/master: 70dd5bf3b99964d52862ad2810c24cc32a553535
11 changes: 11 additions & 0 deletions trunk/block/blk-settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <linux/bio.h>
#include <linux/blkdev.h>
#include <linux/bootmem.h> /* for max_pfn/max_low_pfn */
#include <linux/gcd.h>

#include "blk.h"

Expand Down Expand Up @@ -520,6 +521,16 @@ int blk_stack_limits(struct queue_limits *t, struct queue_limits *b,
return -1;
}

/* Find lcm() of optimal I/O size */
if (t->io_opt && b->io_opt)
t->io_opt = (t->io_opt * b->io_opt) / gcd(t->io_opt, b->io_opt);
else if (b->io_opt)
t->io_opt = b->io_opt;

/* Verify that optimal I/O size is a multiple of io_min */
if (t->io_min && t->io_opt % t->io_min)
return -1;

return 0;
}
EXPORT_SYMBOL(blk_stack_limits);
Expand Down

0 comments on commit 7f5d565

Please sign in to comment.