Lines Matching refs:dev_fd
83 int ctl_fd, dev_fd, rc, i;
125 dev_fd = open(buf, O_RDONLY);
127 if (dev_fd < 0)
130 if (ioctl(dev_fd, LOOP_GET_STATUS, &loopinfo) == 0) {
136 close(dev_fd);
144 close(dev_fd);
154 int dev_fd, file_fd;
157 dev_fd = open(dev, O_RDWR);
158 if (dev_fd < 0) {
166 close(dev_fd);
170 if (ioctl(dev_fd, LOOP_SET_FD, file_fd) < 0) {
171 close(dev_fd);
185 if (ioctl(dev_fd, LOOP_SET_STATUS, &loopinfo)) {
186 close(dev_fd);
193 close(dev_fd);
240 int tst_detach_device_by_fd(const char *dev, int dev_fd)
248 ret = ioctl(dev_fd, LOOP_CLR_FD, 0);
270 int dev_fd, ret;
272 dev_fd = open(dev, O_RDONLY);
273 if (dev_fd < 0) {
278 ret = tst_detach_device_by_fd(dev, dev_fd);
279 close(dev_fd);