| OLD | NEW |
| 1 /* do_mounts_dm.c | 1 /* do_mounts_dm.c |
| 2 * Copyright (C) 2010 The Chromium OS Authors <chromium-os-dev@chromium.org> | 2 * Copyright (C) 2010 The Chromium OS Authors <chromium-os-dev@chromium.org> |
| 3 * All Rights Reserved. | 3 * All Rights Reserved. |
| 4 * Based on do_mounts_md.c | 4 * Based on do_mounts_md.c |
| 5 * | 5 * |
| 6 * This file is released under the GPL. | 6 * This file is released under the GPL. |
| 7 */ | 7 */ |
| 8 #include <linux/async.h> |
| 8 #include <linux/device-mapper.h> | 9 #include <linux/device-mapper.h> |
| 9 #include <linux/fs.h> | 10 #include <linux/fs.h> |
| 10 #include <linux/string.h> | 11 #include <linux/string.h> |
| 11 | 12 |
| 12 #include "do_mounts.h" | 13 #include "do_mounts.h" |
| 13 | 14 |
| 14 #define DM_MAX_NAME 32 | 15 #define DM_MAX_NAME 32 |
| 15 #define DM_MAX_UUID 129 | 16 #define DM_MAX_UUID 129 |
| 16 #define DM_NO_UUID "none" | 17 #define DM_NO_UUID "none" |
| 17 | 18 |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 continue; | 193 continue; |
| 193 | 194 |
| 194 /* Temporarily terminate with a nul */ | 195 /* Temporarily terminate with a nul */ |
| 195 candidate_end--; | 196 candidate_end--; |
| 196 old_char = *candidate_end; | 197 old_char = *candidate_end; |
| 197 *candidate_end = '\0'; | 198 *candidate_end = '\0'; |
| 198 | 199 |
| 199 DMDEBUG("converting candidate device '%s' to dev_t", candidate); | 200 DMDEBUG("converting candidate device '%s' to dev_t", candidate); |
| 200 /* Use the boot-time specific device naming */ | 201 /* Use the boot-time specific device naming */ |
| 201 dev = name_to_dev_t(candidate); | 202 dev = name_to_dev_t(candidate); |
| 203 |
| 204 /* If it failed, but the candidate starts with /dev/, then try |
| 205 * after device probing ends. |
| 206 */ |
| 207 if (!dev && strncmp(candidate, "/dev/", 5) == 0) { |
| 208 DMINFO("waiting to resolve device '%s'...", |
| 209 candidate); |
| 210 while (driver_probe_done() != 0 || |
| 211 (dev = name_to_dev_t(candidate)) == 0) |
| 212 msleep(100); |
| 213 async_synchronize_full(); |
| 214 } |
| 215 DMDEBUG(" -> %u", dev); |
| 216 |
| 202 *candidate_end = old_char; | 217 *candidate_end = old_char; |
| 203 | |
| 204 DMDEBUG(" -> %u", dev); | |
| 205 /* No suitable replacement found */ | 218 /* No suitable replacement found */ |
| 206 if (!dev) | 219 if (!dev) |
| 207 continue; | 220 continue; |
| 208 | 221 |
| 209 /* Rewrite the /dev/path as a major:minor */ | 222 /* Rewrite the /dev/path as a major:minor */ |
| 210 len = snprintf(candidate, len, "%u:%u", MAJOR(dev), MINOR(dev)); | 223 len = snprintf(candidate, len, "%u:%u", MAJOR(dev), MINOR(dev)); |
| 211 if (!len) { | 224 if (!len) { |
| 212 DMERR("error substituting device major/minor."); | 225 DMERR("error substituting device major/minor."); |
| 213 break; | 226 break; |
| 214 } | 227 } |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 | 431 |
| 419 __setup("dm=", dm_setup); | 432 __setup("dm=", dm_setup); |
| 420 | 433 |
| 421 void __init dm_run_setup(void) | 434 void __init dm_run_setup(void) |
| 422 { | 435 { |
| 423 if (!dm_early_setup) | 436 if (!dm_early_setup) |
| 424 return; | 437 return; |
| 425 printk(KERN_INFO "dm: attempting early device configuration.\n"); | 438 printk(KERN_INFO "dm: attempting early device configuration.\n"); |
| 426 dm_setup_drive(); | 439 dm_setup_drive(); |
| 427 } | 440 } |
| OLD | NEW |