#!/system/bin/sh

source /system/etc/initcontrol

if [ "$BLOCK" = "1" ]; then

	LOOP=`ls -d /sys/block/loop*`;
	RAM=`ls -d /sys/block/ram*`;
	MMC=`ls -d /sys/block/mmc*`;

	for i in $LOOP $RAM $MMC
		do
			if [ -e $i/queue/rotational ];
			then
				echo "0" > $i/queue/rotational;
			fi;

			if [ -e $i/queue/iostats ];
			then
				echo "0" > $i/queue/iostats;
			fi;

			if [ -e $i/queue/iosched/group_isolation ];
			then
				echo "0" > $i/queue/iosched/group_isolation;
			fi;

			if [ -e $i/queue/iosched/slice_idle ];
			then
				echo "0" > $i/queue/iosched/slice_idle;
			fi;

			if [ -e $i/queue/iosched/back_seek_penalty ];
			then
				echo "1" > $i/queue/iosched/back_seek_penalty;
			fi;

			if [ -e $i/queue/iosched/quantu ];
			then
				echo "16" > $i/queue/iosched/quantum;
			fi;

			if [ -e $i/queue/read_ahead_kb ];
			then
				echo "256" > $i/queue/read_ahead_kb;
			fi;

			if [ -e $i/queue/nr_requests ];
			then
				echo "2048" > $i/queue/nr_requests;
			fi;

			if [ -e $i/queue/iosched/back_seek_max ];
			then
				echo "1000000000" > $i/queue/iosched/back_seek_max;
			fi;
		done		if [ -e $i/queue/iosched/slice_async_rq ];
		then
			echo "2" > $i/queue/iosched/slice_async_rq;
		fi;

		if [ -e $i/queue/iosched/quantu ];
		then
			echo "16" > $i/queue/iosched/quantum;
		fi;

		if [ -e $i/queue/read_ahead_kb ];
		then
			echo "256" > $i/queue/read_ahead_kb;
		fi;

		if [ -e $i/queue/nr_requests ];
		then
			echo "2048" > $i/queue/nr_requests;
		fi;

		if [ -e $i/queue/iosched/back_seek_max ];
		then
			echo "1000000000" > $i/queue/iosched/back_seek_max;
		fi;
	done

fi