Lines Matching refs:loop_fd
82 int loop_fd = -1; /* Loop device */ variable
90 if (loop_fd != -1) { in die()
91 ioctl(loop_fd, LOOP_CLR_FD, 0); /* Free loop device */ in die()
92 close(loop_fd); in die()
93 loop_fd = -1; in die()
121 int loop_fd; in do_mount() local
123 for (n = 0; loop_fd < 0; n++) { in do_mount()
125 loop_fd = open(devfdname, O_RDWR); in do_mount()
126 if (loop_fd < 0 && errno == ENOENT) { in do_mount()
129 if (ioctl(loop_fd, LOOP_SET_FD, (void *)dev_fd)) { in do_mount()
130 close(loop_fd); in do_mount()
131 loop_fd = -1; in do_mount()
138 if (ioctl(loop_fd, LOOP_GET_STATUS64, &loopinfo) || in do_mount()
140 ioctl(loop_fd, LOOP_SET_STATUS64, &loopinfo))) in do_mount()
144 *cookie = loop_fd; in do_mount()
192 int loop_fd = cookie; in do_umount() local
197 if (loop_fd != -1) { in do_umount()
198 ioctl(loop_fd, LOOP_CLR_FD, 0); /* Free loop device */ in do_umount()
199 close(loop_fd); in do_umount()
200 loop_fd = -1; in do_umount()