Displaying 1 result from an estimated 1 matches for "btrfsdevicelist".
2010 Dec 05
1
[PATCH 4/5][REPOST][BTRFS-PROGS] Avoid to scan cdrom and floppy
...1;
+}
+
+int btrfs_scan_block_devices(int run_ioctl, int checklist)
+{
+
+	struct stat st;
+	int ret;
+	int fd;
+	struct btrfs_fs_devices *tmp_devices;
+	u64 num_devices;
+	FILE *proc_partitions;
+	int i;
+	char buf[1024];
+	char name[100], fullpath[110];
+
+	if(checklist)
+		init_device_checklist(BTRFSDEVICELIST);
+
+	proc_partitions = fopen("/proc/partitions","r");
+	if (!proc_partitions) {
+		fprintf(stderr, "Unable to open ''/proc/partitions'' for 
scanning\n");
+		return -ENOENT;
+	}
+	/* skip the header */
+	for(i=0; i < 2 ; i++)
+		if(!fgets(buf, 1023,...