function _generateIONiceCommand
{
local vdir=$1
- local ionice_class=2
- local ionice_priority=0
+ local ionice_class=
+ local ionice_priority=
test -n "$_IONICE" || return 0
test -r "$vdir/ionice/class" && read ionice_class <"$vdir"/ionice/class
test -r "$vdir/ionice/priority" && read ionice_priority <"$vdir"/ionice/priority
- IONICE_CMD=( $_IONICE -c$ionice_class -n$ionice_priority )
+ test -n "$ionice_class$ionice_priority" || return 0
+
+ if test -z "$ionice_class" -a -n "$ionice_priority"; then
+ IONICE_CMD=( $_IONICE -c2 -n"$ionice_priority" )
+ else
+ IONICE_CMD=( $_IONICE ${ionice_class:+-c$ionice_class} ${ionice_priority:+-n$ionice_priority} )
+ fi
}
function _generatePersonalityOptions