Lines Matching refs:device
15 Associate a loopback device with a file, or show current file (if any)
16 associated with a loop device.
18 Instead of a device:
20 -f Find first unused loop device (may create one)
25 -d DEV Detach loopback device
29 -s Show device name (alias --show)
49 // -f: *device is NULL
51 // Perform requested operation on one device. Returns 1 if handled, 0 if error
52 static int loopback_setup(char *device, char *file)
56 int racy = !device;
58 // Open file (ffd) and loop device (lfd)
61 if (!device) {
64 // We assume /dev is devtmpfs so device creation has no lag. Otherwise
67 // mount -o loop depends on found device being at the start of toybuf.
70 sprintf(device = toybuf, "%s/loop%d", TT.dir, i);
76 if (device) lfd = open(device, TT.openflags);
78 // Stat the loop device to see if there's a current association.
82 // ENXIO expected if we're just trying to print the first unused device.
84 puts(device);
88 perror_msg_raw(device ? device : "-f");
101 perror_msg_raw(device);
104 // Associate file with this device?
112 perror_exit("%s=%s", device, file);
118 if (ioctl(lfd, LOOP_SET_STATUS64, loop)) perror_exit("%s=%s", device, file);
119 if (FLAG(s)) puts(device);
122 xprintf("%s: [%lld]:%llu (%s)", device, (long long)loop->lo_device,
168 // With just device, display current association
169 // -a, -f substitute for device
170 // -j substitute for device