int ignore_device;
int ignore_remove;
char program_result[PATH_SIZE];
+ int link_priority;
int test_run;
};
name_index(udev->dev->devpath, name_loop->name, 1);
}
fprintf(f, "M:%u:%u\n", major(udev->devt), minor(udev->devt));
+ if (udev->link_priority)
+ fprintf(f, "L:%u\n", udev->link_priority);
if (udev->partitions)
fprintf(f, "A:%u\n", udev->partitions);
if (udev->ignore_remove)
line[count-2] = '\0';
name_list_add(&udev->symlink_list, line, 0);
break;
+ case 'L':
+ if (count > sizeof(line))
+ count = sizeof(line);
+ memcpy(line, &bufline[2], count-2);
+ line[count-2] = '\0';
+ udev->link_priority = atoi(line);
+ break;
case 'A':
if (count > sizeof(line))
count = sizeof(line);
udev->ignore_remove = 1;
dbg("remove event should be ignored");
}
+ if (rule->link_priority) {
+ udev->link_priority = rule->link_priority;
+ info("link_priority=%i", udev->link_priority);
+ }
/* apply all_partitions option only at a main block device */
if (rule->partitions &&
strcmp(udev->dev->subsystem, "block") == 0 && udev->dev->kernel_number[0] == '\0') {
mode_t mode;
enum key_operation mode_operation;
+ unsigned int link_priority;
unsigned int partitions;
unsigned int last_rule:1,
ignore_device:1,
}
if (strcasecmp(key, "OPTIONS") == 0) {
+ const char *pos;
+
if (strstr(value, "last_rule") != NULL) {
dbg("last rule to be applied");
rule->last_rule = 1;
dbg("remove event should be ignored");
rule->ignore_remove = 1;
}
+ pos = strstr(value, "link_priority=");
+ if (pos != NULL) {
+ rule->link_priority = atoi(&pos[strlen("link_priority=")]);
+ info("link priority=%i", rule->link_priority);
+ }
if (strstr(value, "all_partitions") != NULL) {
dbg("creation of partition nodes requested");
rule->partitions = DEFAULT_PARTITIONS_COUNT;