Merge commit 'refs/top-bases/linux-debug-zerocopy' into linux-debug-zerocopy
This commit is contained in:
commit
0e215424e6
|
@ -143,3 +143,15 @@ unload_modules() {
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unused_loop_device() {
|
||||||
|
for DEVICE in `ls -1 /dev/loop*`; do
|
||||||
|
losetup $DEVICE &>/dev/null
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo $DEVICE
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
die "Error: Unable to find unused loopback device"
|
||||||
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@ DEVICES=""
|
||||||
|
|
||||||
zpool_create() {
|
zpool_create() {
|
||||||
for FILE in ${FILES}; do
|
for FILE in ${FILES}; do
|
||||||
DEVICE=`/sbin/losetup -f`
|
DEVICE=`unused_loop_device`
|
||||||
msg "Creating ${FILE} using loopback device ${DEVICE}"
|
msg "Creating ${FILE} using loopback device ${DEVICE}"
|
||||||
rm -f ${FILE} || exit 1
|
rm -f ${FILE} || exit 1
|
||||||
dd if=/dev/zero of=${FILE} bs=1024k count=256 &>/dev/null ||
|
dd if=/dev/zero of=${FILE} bs=1024k count=256 &>/dev/null ||
|
||||||
|
|
|
@ -13,7 +13,7 @@ DEVICES_M2=""
|
||||||
|
|
||||||
zpool_create() {
|
zpool_create() {
|
||||||
for FILE in ${FILES_M1}; do
|
for FILE in ${FILES_M1}; do
|
||||||
DEVICE=`/sbin/losetup -f`
|
DEVICE=`unused_loop_device`
|
||||||
msg "Creating ${FILE} using loopback device ${DEVICE}"
|
msg "Creating ${FILE} using loopback device ${DEVICE}"
|
||||||
rm -f ${FILE} || exit 1
|
rm -f ${FILE} || exit 1
|
||||||
dd if=/dev/zero of=${FILE} bs=1024k count=256 &>/dev/null ||
|
dd if=/dev/zero of=${FILE} bs=1024k count=256 &>/dev/null ||
|
||||||
|
|
|
@ -11,7 +11,7 @@ DEVICES=""
|
||||||
|
|
||||||
zpool_create() {
|
zpool_create() {
|
||||||
for FILE in ${FILES}; do
|
for FILE in ${FILES}; do
|
||||||
DEVICE=`/sbin/losetup -f`
|
DEVICE=`unused_loop_device`
|
||||||
msg "Creating ${FILE} using loopback device ${DEVICE}"
|
msg "Creating ${FILE} using loopback device ${DEVICE}"
|
||||||
rm -f ${FILE} || exit 1
|
rm -f ${FILE} || exit 1
|
||||||
dd if=/dev/zero of=${FILE} bs=1024k count=256 &>/dev/null ||
|
dd if=/dev/zero of=${FILE} bs=1024k count=256 &>/dev/null ||
|
||||||
|
|
|
@ -11,7 +11,7 @@ DEVICES=""
|
||||||
|
|
||||||
zpool_create() {
|
zpool_create() {
|
||||||
for FILE in ${FILES}; do
|
for FILE in ${FILES}; do
|
||||||
DEVICE=`/sbin/losetup -f`
|
DEVICE=`unused_loop_device`
|
||||||
msg "Creating ${FILE} using loopback device ${DEVICE}"
|
msg "Creating ${FILE} using loopback device ${DEVICE}"
|
||||||
rm -f ${FILE} || exit 1
|
rm -f ${FILE} || exit 1
|
||||||
dd if=/dev/zero of=${FILE} bs=1024k count=256 &>/dev/null ||
|
dd if=/dev/zero of=${FILE} bs=1024k count=256 &>/dev/null ||
|
||||||
|
|
Loading…
Reference in New Issue