Lines Matching refs:loop
33 #include <linux/loop.h>
393 } else if (!strncmp(source, "loop@", 5)) {
394 int mode, loop, fd;
404 sprintf(tmp, "/dev/block/loop%d", n);
405 loop = open(tmp, mode);
406 if (loop < 0) {
410 /* if it is a blank loop device */
411 if (ioctl(loop, LOOP_GET_STATUS, &info) < 0 && errno == ENXIO) {
412 /* if it becomes our loop device */
413 if (ioctl(loop, LOOP_SET_FD, fd) >= 0) {
417 ioctl(loop, LOOP_CLR_FD, 0);
418 close(loop);
422 close(loop);
427 close(loop);