Lines Matching refs:loop_device_fd
128 int loop_device_fd = in BindToUnusedLoopDevice() local
130 if (loop_device_fd == -1 && errno == ENOENT) { in BindToUnusedLoopDevice()
135 loop_device_fd = in BindToUnusedLoopDevice()
138 TEST_AND_RETURN_FALSE_ERRNO(loop_device_fd != -1); in BindToUnusedLoopDevice()
139 ScopedFdCloser loop_device_fd_closer(&loop_device_fd); in BindToUnusedLoopDevice()
142 if (ioctl(loop_device_fd, LOOP_GET_STATUS64, &device_info) != -1 || in BindToUnusedLoopDevice()
154 TEST_AND_RETURN_FALSE_ERRNO(ioctl(loop_device_fd, LOOP_SET_FD, data_fd) == 0); in BindToUnusedLoopDevice()
166 ioctl(loop_device_fd, LOOP_SET_STATUS64, &device_info) == 0); in BindToUnusedLoopDevice()
170 if (ioctl(loop_device_fd, BLKROSET, &ro) != 0) { in BindToUnusedLoopDevice()
178 int loop_device_fd = in UnbindLoopDevice() local
180 if (loop_device_fd == -1 && errno == ENOENT) in UnbindLoopDevice()
182 TEST_AND_RETURN_FALSE_ERRNO(loop_device_fd != -1); in UnbindLoopDevice()
183 ScopedFdCloser loop_device_fd_closer(&loop_device_fd); in UnbindLoopDevice()
187 int get_stat_err = ioctl(loop_device_fd, LOOP_GET_STATUS64, &device_info); in UnbindLoopDevice()
191 TEST_AND_RETURN_FALSE_ERRNO(ioctl(loop_device_fd, LOOP_CLR_FD) == 0); in UnbindLoopDevice()