]> err.no Git - systemd/commitdiff
libudev: udev_device - add more properties
authorKay Sievers <kay.sievers@vrfy.org>
Wed, 10 Sep 2008 08:09:34 +0000 (10:09 +0200)
committerKay Sievers <kay.sievers@vrfy.org>
Wed, 10 Sep 2008 08:09:34 +0000 (10:09 +0200)
udev/lib/libudev-device.c
udev/lib/libudev-private.h
udev/lib/libudev.c

index 578afe7ec2d4e77bf707faed29da7063121a7417..ec0aa9ae5d4ab3c09341ad58efe3d0cbef1635bf 100644 (file)
@@ -47,7 +47,10 @@ struct udev_device {
        char *physdevpath;
        int timeout;
        dev_t devnum;
-       long long int seqnum;
+       unsigned long long int seqnum;
+       int num_fake_partitions;
+       int link_priority;
+       int ignore_remove;
 };
 
 struct udev_device *device_init(struct udev *udev)
@@ -487,3 +490,39 @@ int device_set_devnum(struct udev_device *udev_device, dev_t devnum)
        udev_device->devnum = devnum;
        return 0;
 }
+
+int device_get_num_fake_partitions(struct udev_device *udev_device)
+{
+       if (udev_device == NULL)
+               return -1;
+       return udev_device->num_fake_partitions;
+}
+
+int device_set_num_fake_partitions(struct udev_device *udev_device, int num)
+{
+       udev_device->num_fake_partitions = num;
+}
+
+int device_get_link_priority(struct udev_device *udev_device)
+{
+       if (udev_device == NULL)
+               return -1;
+       return udev_device->link_priority;
+}
+
+int device_set_link_priority(struct udev_device *udev_device, int prio)
+{
+        udev_device->link_priority = prio;
+}
+
+int device_get_ignore_remove(struct udev_device *udev_device)
+{
+       if (udev_device == NULL)
+               return -1;
+       return udev_device->ignore_remove;
+}
+
+int device_set_ignore_remove(struct udev_device *udev_device, int ignore)
+{
+        udev_device->ignore_remove = ignore;
+}
index bc91927bed61de9dd63af1d3d60edbc03053a037..9c54b01027402ec7b450b806b6ea6cd7e946f3a2 100644 (file)
@@ -70,6 +70,12 @@ extern int device_get_timeout(struct udev_device *udev_device);
 extern int device_set_timeout(struct udev_device *udev_device, int timeout);
 extern int device_set_devnum(struct udev_device *udev_device, dev_t devnum);
 extern int device_set_seqnum(struct udev_device *udev_device, unsigned long long int seqnum);
+extern int device_get_num_fake_partitions(struct udev_device *udev_device);
+extern int device_set_num_fake_partitions(struct udev_device *udev_device, int num);
+extern int device_get_link_priority(struct udev_device *udev_device);
+extern int device_set_link_priority(struct udev_device *udev_device, int prio);
+extern int device_get_ignore_remove(struct udev_device *udev_device);
+extern int device_set_ignore_remove(struct udev_device *udev_device, int ignore);
 
 /* udev_ctrl - daemon runtime setup */
 struct udev_ctrl;
index 6239377ece80734f1221ca17489087cbd6ec5dfd..50fe0d1c893cad111ab7b37192ceb3029edfdfbc 100644 (file)
@@ -48,7 +48,7 @@ struct udev {
        int selinux_enabled;
        security_context_t selinux_prev_scontext;
 #endif
-       int run:1;
+       int run;
 };
 
 void udev_log(struct udev *udev,