mirror of
https://github.com/systemd/systemd.git
synced 2024-12-25 01:34:28 +03:00
remove all PHYSDEVPATH handling and warning about
This commit is contained in:
parent
efca104ccf
commit
e3196993f1
@ -36,7 +36,6 @@ struct udev_device {
|
|||||||
char *driver;
|
char *driver;
|
||||||
char *action;
|
char *action;
|
||||||
char *devpath_old;
|
char *devpath_old;
|
||||||
char *physdevpath;
|
|
||||||
char *knodename;
|
char *knodename;
|
||||||
char **envp;
|
char **envp;
|
||||||
char *monitor_buf;
|
char *monitor_buf;
|
||||||
@ -625,7 +624,6 @@ void udev_device_unref(struct udev_device *udev_device)
|
|||||||
free(udev_device->driver);
|
free(udev_device->driver);
|
||||||
free(udev_device->devpath_old);
|
free(udev_device->devpath_old);
|
||||||
free(udev_device->knodename);
|
free(udev_device->knodename);
|
||||||
free(udev_device->physdevpath);
|
|
||||||
udev_list_cleanup_entries(udev_device->udev, &udev_device->sysattr_list);
|
udev_list_cleanup_entries(udev_device->udev, &udev_device->sysattr_list);
|
||||||
free(udev_device->envp);
|
free(udev_device->envp);
|
||||||
free(udev_device->monitor_buf);
|
free(udev_device->monitor_buf);
|
||||||
@ -1192,19 +1190,6 @@ int udev_device_set_knodename(struct udev_device *udev_device, const char *knode
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *udev_device_get_physdevpath(struct udev_device *udev_device)
|
|
||||||
{
|
|
||||||
return udev_device->physdevpath;
|
|
||||||
}
|
|
||||||
|
|
||||||
int udev_device_set_physdevpath(struct udev_device *udev_device, const char *physdevpath)
|
|
||||||
{
|
|
||||||
udev_device->physdevpath = strdup(physdevpath);
|
|
||||||
if (udev_device->physdevpath == NULL)
|
|
||||||
return -ENOMEM;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int udev_device_get_timeout(struct udev_device *udev_device)
|
int udev_device_get_timeout(struct udev_device *udev_device)
|
||||||
{
|
{
|
||||||
return udev_device->timeout;
|
return udev_device->timeout;
|
||||||
|
@ -586,15 +586,10 @@ retry:
|
|||||||
min = strtoull(&key[6], NULL, 10);
|
min = strtoull(&key[6], NULL, 10);
|
||||||
} else if (strncmp(key, "DEVPATH_OLD=", 12) == 0) {
|
} else if (strncmp(key, "DEVPATH_OLD=", 12) == 0) {
|
||||||
udev_device_set_devpath_old(udev_device, &key[12]);
|
udev_device_set_devpath_old(udev_device, &key[12]);
|
||||||
} else if (strncmp(key, "PHYSDEVPATH=", 12) == 0) {
|
|
||||||
udev_device_set_physdevpath(udev_device, &key[12]);
|
|
||||||
} else if (strncmp(key, "SEQNUM=", 7) == 0) {
|
} else if (strncmp(key, "SEQNUM=", 7) == 0) {
|
||||||
udev_device_set_seqnum(udev_device, strtoull(&key[7], NULL, 10));
|
udev_device_set_seqnum(udev_device, strtoull(&key[7], NULL, 10));
|
||||||
} else if (strncmp(key, "TIMEOUT=", 8) == 0) {
|
} else if (strncmp(key, "TIMEOUT=", 8) == 0) {
|
||||||
udev_device_set_timeout(udev_device, strtoull(&key[8], NULL, 10));
|
udev_device_set_timeout(udev_device, strtoull(&key[8], NULL, 10));
|
||||||
} else if (strncmp(key, "PHYSDEV", 7) == 0) {
|
|
||||||
/* suppress deprecated values */
|
|
||||||
continue;
|
|
||||||
} else {
|
} else {
|
||||||
udev_device_add_property_from_string(udev_device, key);
|
udev_device_add_property_from_string(udev_device, key);
|
||||||
}
|
}
|
||||||
|
@ -64,8 +64,6 @@ const char *udev_device_get_devpath_old(struct udev_device *udev_device);
|
|||||||
int udev_device_set_devpath_old(struct udev_device *udev_device, const char *devpath_old);
|
int udev_device_set_devpath_old(struct udev_device *udev_device, const char *devpath_old);
|
||||||
const char *udev_device_get_knodename(struct udev_device *udev_device);
|
const char *udev_device_get_knodename(struct udev_device *udev_device);
|
||||||
int udev_device_set_knodename(struct udev_device *udev_device, const char *knodename);
|
int udev_device_set_knodename(struct udev_device *udev_device, const char *knodename);
|
||||||
const char *udev_device_get_physdevpath(struct udev_device *udev_device);
|
|
||||||
int udev_device_set_physdevpath(struct udev_device *udev_device, const char *physdevpath);
|
|
||||||
int udev_device_get_timeout(struct udev_device *udev_device);
|
int udev_device_get_timeout(struct udev_device *udev_device);
|
||||||
int udev_device_set_timeout(struct udev_device *udev_device, int timeout);
|
int udev_device_set_timeout(struct udev_device *udev_device, int timeout);
|
||||||
int udev_device_get_event_timeout(struct udev_device *udev_device);
|
int udev_device_get_event_timeout(struct udev_device *udev_device);
|
||||||
|
@ -1137,8 +1137,6 @@ static int add_rule(struct udev_rules *rules, char *line,
|
|||||||
{
|
{
|
||||||
char *linepos;
|
char *linepos;
|
||||||
char *attr;
|
char *attr;
|
||||||
int physdev = 0;
|
|
||||||
int waitfor = 0;
|
|
||||||
struct rule_tmp rule_tmp;
|
struct rule_tmp rule_tmp;
|
||||||
|
|
||||||
memset(&rule_tmp, 0x00, sizeof(struct rule_tmp));
|
memset(&rule_tmp, 0x00, sizeof(struct rule_tmp));
|
||||||
@ -1280,8 +1278,6 @@ static int add_rule(struct udev_rules *rules, char *line,
|
|||||||
err(rules->udev, "error parsing ENV attribute\n");
|
err(rules->udev, "error parsing ENV attribute\n");
|
||||||
goto invalid;
|
goto invalid;
|
||||||
}
|
}
|
||||||
if (strncmp(attr, "PHYSDEV", 7) == 0)
|
|
||||||
physdev = 1;
|
|
||||||
if (op < OP_MATCH_MAX) {
|
if (op < OP_MATCH_MAX) {
|
||||||
if (rule_add_key(&rule_tmp, TK_M_ENV, op, value, attr) != 0)
|
if (rule_add_key(&rule_tmp, TK_M_ENV, op, value, attr) != 0)
|
||||||
goto invalid;
|
goto invalid;
|
||||||
@ -1378,7 +1374,6 @@ static int add_rule(struct udev_rules *rules, char *line,
|
|||||||
|
|
||||||
if (strcasecmp(key, "WAIT_FOR") == 0 || strcasecmp(key, "WAIT_FOR_SYSFS") == 0) {
|
if (strcasecmp(key, "WAIT_FOR") == 0 || strcasecmp(key, "WAIT_FOR_SYSFS") == 0) {
|
||||||
rule_add_key(&rule_tmp, TK_M_WAITFOR, 0, value, NULL);
|
rule_add_key(&rule_tmp, TK_M_WAITFOR, 0, value, NULL);
|
||||||
waitfor = 1;
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1536,10 +1531,6 @@ static int add_rule(struct udev_rules *rules, char *line,
|
|||||||
err(rules->udev, "unknown key '%s' in %s:%u\n", key, filename, lineno);
|
err(rules->udev, "unknown key '%s' in %s:%u\n", key, filename, lineno);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (physdev && !waitfor)
|
|
||||||
err(rules->udev, "PHYSDEV* values are deprecated and not available on recent kernels, "
|
|
||||||
"please fix it in %s:%u\n", filename, lineno);
|
|
||||||
|
|
||||||
/* add rule token */
|
/* add rule token */
|
||||||
rule_tmp.rule.rule.token_count = 1 + rule_tmp.token_cur;
|
rule_tmp.rule.rule.token_count = 1 + rule_tmp.token_cur;
|
||||||
if (add_token(rules, &rule_tmp.rule) != 0)
|
if (add_token(rules, &rule_tmp.rule) != 0)
|
||||||
|
15
udev/udevd.c
15
udev/udevd.c
@ -339,7 +339,7 @@ static int compare_devpath(const char *running, const char *waiting)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* lookup event for identical, parent, child, or physical device */
|
/* lookup event for identical, parent, child device */
|
||||||
static int devpath_busy(struct udev_event *event)
|
static int devpath_busy(struct udev_event *event)
|
||||||
{
|
{
|
||||||
struct udev_list_node *loop;
|
struct udev_list_node *loop;
|
||||||
@ -390,19 +390,6 @@ static int devpath_busy(struct udev_event *event)
|
|||||||
event->delaying_seqnum = udev_device_get_seqnum(loop_event->dev);
|
event->delaying_seqnum = udev_device_get_seqnum(loop_event->dev);
|
||||||
return 5;
|
return 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* check physical device event (special case of parent) */
|
|
||||||
if (udev_device_get_physdevpath(event->dev) != NULL &&
|
|
||||||
strcmp(udev_device_get_action(event->dev), "add") == 0)
|
|
||||||
if (compare_devpath(udev_device_get_devpath(loop_event->dev),
|
|
||||||
udev_device_get_physdevpath(event->dev)) != 0) {
|
|
||||||
dbg(event->udev, "%llu, physical device event still pending %llu (%s)\n",
|
|
||||||
udev_device_get_seqnum(event->dev),
|
|
||||||
udev_device_get_seqnum(loop_event->dev),
|
|
||||||
udev_device_get_devpath(loop_event->dev));
|
|
||||||
event->delaying_seqnum = udev_device_get_seqnum(loop_event->dev);
|
|
||||||
return 6;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user