From: agk@sourceware.org <agk@sourceware.org>
To: lvm-devel@redhat.com
Subject: LVM2 lib/activate/dev_manager.c tools/lvchange ...
Date: 5 Dec 2007 19:24:35 -0000 [thread overview]
Message-ID: <20071205192435.9424.qmail@sourceware.org> (raw)
CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: agk at sourceware.org 2007-12-05 19:24:32
Modified files:
lib/activate : dev_manager.c
tools : lvchange.c lvcreate.c
Log message:
round readahead to multiple of page size in tools
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.130&r2=1.131
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvchange.c.diff?cvsroot=lvm2&r1=1.83&r2=1.84
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvcreate.c.diff?cvsroot=lvm2&r1=1.161&r2=1.162
--- LVM2/lib/activate/dev_manager.c 2007/12/03 18:00:38 1.130
+++ LVM2/lib/activate/dev_manager.c 2007/12/05 19:24:31 1.131
@@ -952,10 +952,10 @@
max_stripe_size = seg->stripe_size;
}
- if (read_ahead == DM_READ_AHEAD_AUTO)
+ if (read_ahead == DM_READ_AHEAD_AUTO) {
read_ahead = max_stripe_size;
- else
read_ahead_flags = DM_READ_AHEAD_MINIMUM_FLAG;
+ }
dm_tree_node_set_read_ahead(dnode, read_ahead, read_ahead_flags);
--- LVM2/tools/lvchange.c 2007/11/12 20:51:54 1.83
+++ LVM2/tools/lvchange.c 2007/12/05 19:24:32 1.84
@@ -372,6 +372,7 @@
struct logical_volume *lv)
{
unsigned read_ahead = 0;
+ unsigned pagesize = (unsigned) lvm_getpagesize() >> SECTOR_SHIFT;
read_ahead = arg_uint_value(cmd, readahead_ARG, 0);
@@ -382,6 +383,13 @@
return 0;
}
+ if (read_ahead != DM_READ_AHEAD_AUTO &&
+ read_ahead != DM_READ_AHEAD_NONE && read_ahead % pagesize) {
+ read_ahead = (read_ahead / pagesize) * pagesize;
+ log_verbose("Rounding down readahead to %u sectors, a multiple "
+ "of page size %u.", read_ahead, pagesize);
+ }
+
if (lv->read_ahead == read_ahead) {
log_error("Read ahead is already %u for \"%s\"",
read_ahead, lv->name);
--- LVM2/tools/lvcreate.c 2007/11/22 14:54:35 1.161
+++ LVM2/tools/lvcreate.c 2007/12/05 19:24:32 1.162
@@ -333,6 +333,7 @@
int argc, char **argv)
{
int contiguous;
+ unsigned pagesize;
memset(lp, 0, sizeof(*lp));
@@ -462,8 +463,17 @@
/*
* Read ahead.
*/
- if (arg_count(cmd, readahead_ARG))
+ 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);
+ }
+ }
/*
* Permissions.
next reply other threads:[~2007-12-05 19:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-05 19:24 agk [this message]
-- strict thread matches above, loose matches on Subject: below --
2008-06-18 11:32 LVM2 lib/activate/dev_manager.c tools/lvchange zkabelac
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20071205192435.9424.qmail@sourceware.org \
--to=agk@sourceware.org \
--cc=lvm-devel@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.