+#if KERNEL_LINUX
+static void submit_in_progress (char const *disk_name, gauge_t in_progress)
+{
+ value_t v;
+ value_list_t vl = VALUE_LIST_INIT;
+
+ if (ignorelist_match (ignorelist, disk_name) != 0)
+ return;
+
+ v.gauge = in_progress;
+
+ vl.values = &v;
+ vl.values_len = 1;
+ sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+ sstrncpy (vl.plugin, "disk", sizeof (vl.plugin));
+ sstrncpy (vl.plugin_instance, disk_name, sizeof (vl.plugin_instance));
+ sstrncpy (vl.type, "pending_operations", sizeof (vl.type));
+
+ plugin_dispatch_values (&vl);
+}
+
+static counter_t disk_calc_time_incr (counter_t delta_time, counter_t delta_ops)
+{
+ double interval = CDTIME_T_TO_DOUBLE (plugin_get_interval ());
+ double avg_time = ((double) delta_time) / ((double) delta_ops);
+ double avg_time_incr = interval * avg_time;
+
+ return ((counter_t) (avg_time_incr + .5));
+}
+#endif
+
+#if HAVE_LIBUDEV
+/**
+ * Attempt to provide an rename disk instance from an assigned udev attribute.
+ *
+ * On success, it returns a strduped char* to the desired attribute value.
+ * Otherwise it returns NULL.
+ */
+
+static char *disk_udev_attr_name (struct udev *udev, char *disk_name, const char *attr)
+{
+ struct udev_device *dev;
+ const char *prop;
+ char *output = NULL;
+
+ dev = udev_device_new_from_subsystem_sysname (udev, "block", disk_name);
+ if (dev != NULL)
+ {
+ prop = udev_device_get_property_value (dev, attr);
+ if (prop) {
+ output = strdup (prop);
+ DEBUG ("disk plugin: renaming %s => %s", disk_name, output);
+ }
+ udev_device_unref (dev);
+ }
+ return output;
+}
+#endif
+