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:
parent
9f2d46513c
commit
aced269ac3
@ -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.
|
||||
|
@ -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.");
|
||||
|
Loading…
Reference in New Issue
Block a user