2 # Copyright (C) 2008 Red Hat, Inc. All rights reserved.
4 # This copyrighted material is made available to anyone wishing to use,
5 # modify, copy, or redistribute it subject to the terms and conditions
6 # of the GNU General Public License v.2.
8 # You should have received a copy of the GNU General Public License
9 # along with this program; if not, write to the Free Software Foundation,
10 # Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
13 # tests basic functionality of read-ahead and ra regressions
16 test_description
='Test read-ahead functionality'
22 lvs
--units s
--nosuffix --noheadings -o $1 "$vg"/"$lv"
26 case $
(get_lvs_
$1) in
34 #COMM "test various read ahead settings (bz450922)"
35 lvcreate
-n "$lv" -l 100%FREE
-i5 -I256 "$vg"
36 ra
="$(get_lvs_ lv_kernel_read_ahead)"
37 test "$(( ( $ra / 5 ) * 5 ))" -eq $ra
39 lvchange
-r auto
"$vg"/"$lv" 2>&1 |
grep auto
40 check_lvs_ lv_read_ahead auto
41 check_lvs_ lv_kernel_read_ahead
5120
42 lvchange
-r 640 "$vg/$lv"
43 check_lvs_ lv_read_ahead
640
46 #COMM "read ahead is properly inherited from underlying PV"
47 blockdev
--setra 768 $dev1
48 lvcreate
-n $lv -L4m $vg $dev1
49 test $
(blockdev
--getra $G_dev_/$vg/$lv) -eq 768
52 # Check default, active/inactive values for read_ahead / kernel_read_ahead
53 lvcreate
-n $lv -l 50%FREE
$vg
55 check_lv_field_
$vg/$lv lv_read_ahead auto
56 check_lv_field_
$vg/$lv lv_kernel_read_ahead
-1
57 lvchange
-r 512 $vg/$lv
59 check_lv_field_
$vg/$lv lv_read_ahead
256.00k
60 check_lv_field_
$vg/$lv lv_kernel_read_ahead
256.00k