1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

Fix lvcreate -M1 readahead.

This commit is contained in:
Alasdair Kergon 2008-01-18 21:56:39 +00:00
parent 9f2d46513c
commit aced269ac3
3 changed files with 14 additions and 11 deletions

View File

@ -1 +1 @@
2.02.30-cvs (2008-01-17)
2.02.31-cvs (2008-01-17)

View File

@ -1,3 +1,7 @@
Version 2.02.31 -
===================================
Avoid error message when using default setting of lvcreate -M1. (2.02.30)
Version 2.02.30 - 17th January 2008
===================================
Set default readahead to twice maximium stripe size.

View File

@ -463,16 +463,14 @@ static int _lvcreate_params(struct lvcreate_params *lp, struct cmd_context *cmd,
/*
* Read ahead.
*/
if (arg_count(cmd, readahead_ARG)) {
lp->read_ahead = arg_uint_value(cmd, readahead_ARG, 0);
pagesize = lvm_getpagesize() >> SECTOR_SHIFT;
if (lp->read_ahead != DM_READ_AHEAD_AUTO &&
lp->read_ahead != DM_READ_AHEAD_NONE &&
lp->read_ahead % pagesize) {
lp->read_ahead = (lp->read_ahead / pagesize) * pagesize;
log_verbose("Rounding down readahead to %u sectors, a multiple "
"of page size %u.", lp->read_ahead, pagesize);
}
lp->read_ahead = arg_uint_value(cmd, readahead_ARG, DM_READ_AHEAD_NONE);
pagesize = lvm_getpagesize() >> SECTOR_SHIFT;
if (lp->read_ahead != DM_READ_AHEAD_AUTO &&
lp->read_ahead != DM_READ_AHEAD_NONE &&
lp->read_ahead % pagesize) {
lp->read_ahead = (lp->read_ahead / pagesize) * pagesize;
log_verbose("Rounding down readahead to %u sectors, a multiple "
"of page size %u.", lp->read_ahead, pagesize);
}
/*
@ -547,6 +545,7 @@ static int _lvcreate(struct cmd_context *cmd, struct volume_group *vg,
}
if (lp->read_ahead != DM_READ_AHEAD_AUTO &&
lp->read_ahead != DM_READ_AHEAD_NONE &&
(vg->fid->fmt->features & FMT_RESTRICTED_READAHEAD) &&
(lp->read_ahead < 2 || lp->read_ahead > 120)) {
log_error("Metadata only supports readahead values between 2 and 120.");