2 * collectd - src/disk.c
3 * Copyright (C) 2005-2012 Florian octo Forster
4 * Copyright (C) 2009 Manuel Sanmartin
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; only version 2 of the License is applicable.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 * Florian octo Forster <octo at collectd.org>
27 #include "utils_ignorelist.h"
29 #if HAVE_MACH_MACH_TYPES_H
30 # include <mach/mach_types.h>
32 #if HAVE_MACH_MACH_INIT_H
33 # include <mach/mach_init.h>
35 #if HAVE_MACH_MACH_ERROR_H
36 # include <mach/mach_error.h>
38 #if HAVE_MACH_MACH_PORT_H
39 # include <mach/mach_port.h>
41 #if HAVE_COREFOUNDATION_COREFOUNDATION_H
42 # include <CoreFoundation/CoreFoundation.h>
44 #if HAVE_IOKIT_IOKITLIB_H
45 # include <IOKit/IOKitLib.h>
47 #if HAVE_IOKIT_IOTYPES_H
48 # include <IOKit/IOTypes.h>
50 #if HAVE_IOKIT_STORAGE_IOBLOCKSTORAGEDRIVER_H
51 # include <IOKit/storage/IOBlockStorageDriver.h>
53 #if HAVE_IOKIT_IOBSD_H
54 # include <IOKit/IOBSD.h>
61 # define UINT_MAX 4294967295U
65 # include <statgrab.h>
69 # ifndef _AIXVERSION_610
70 # include <sys/systemcfg.h>
72 # include <sys/protosw.h>
73 # include <libperfstat.h>
76 #if HAVE_IOKIT_IOKITLIB_H
77 static mach_port_t io_master_port = MACH_PORT_NULL;
78 /* This defaults to false for backwards compatibility. Please fix in the next
80 static _Bool use_bsd_name = 0;
81 /* #endif HAVE_IOKIT_IOKITLIB_H */
84 typedef struct diskstats
88 /* This overflows in roughly 1361 years */
89 unsigned int poll_count;
91 derive_t read_sectors;
92 derive_t write_sectors;
102 derive_t avg_read_time;
103 derive_t avg_write_time;
105 struct diskstats *next;
108 static diskstats_t *disklist;
109 /* #endif KERNEL_LINUX */
112 #define MAX_NUMDISK 1024
113 extern kstat_ctl_t *kc;
114 static kstat_t *ksp[MAX_NUMDISK];
115 static int numdisk = 0;
116 /* #endif HAVE_LIBKSTAT */
118 #elif defined(HAVE_LIBSTATGRAB)
119 /* #endif HAVE_LIBKSTATGRAB */
122 static perfstat_disk_t * stat_disk;
125 /* #endif HAVE_PERFSTAT */
128 # error "No applicable input method."
134 static char *conf_udev_name_attr = NULL;
135 static struct udev *handle_udev;
138 static const char *config_keys[] =
145 static int config_keys_num = STATIC_ARRAY_SIZE (config_keys);
147 static ignorelist_t *ignorelist = NULL;
149 static int disk_config (const char *key, const char *value)
151 if (ignorelist == NULL)
152 ignorelist = ignorelist_create (/* invert = */ 1);
153 if (ignorelist == NULL)
156 if (strcasecmp ("Disk", key) == 0)
158 ignorelist_add (ignorelist, value);
160 else if (strcasecmp ("IgnoreSelected", key) == 0)
165 ignorelist_set_invert (ignorelist, invert);
167 else if (strcasecmp ("UseBSDName", key) == 0)
169 #if HAVE_IOKIT_IOKITLIB_H
170 use_bsd_name = IS_TRUE (value) ? 1 : 0;
172 WARNING ("disk plugin: The \"UseBSDName\" option is only supported "
173 "on Mach / Mac OS X and will be ignored.");
176 else if (strcasecmp ("UdevNameAttr", key) == 0)
179 if (conf_udev_name_attr != NULL)
181 free (conf_udev_name_attr);
182 conf_udev_name_attr = NULL;
184 if ((conf_udev_name_attr = strdup (value)) == NULL)
187 WARNING ("disk plugin: The \"UdevNameAttr\" option is only supported "
188 "if collectd is built with libudev support");
197 } /* int disk_config */
199 static int disk_init (void)
201 #if HAVE_IOKIT_IOKITLIB_H
202 kern_return_t status;
204 if (io_master_port != MACH_PORT_NULL)
206 mach_port_deallocate (mach_task_self (),
208 io_master_port = MACH_PORT_NULL;
211 status = IOMasterPort (MACH_PORT_NULL, &io_master_port);
212 if (status != kIOReturnSuccess)
214 ERROR ("IOMasterPort failed: %s",
215 mach_error_string (status));
216 io_master_port = MACH_PORT_NULL;
219 /* #endif HAVE_IOKIT_IOKITLIB_H */
223 /* #endif KERNEL_LINUX */
233 for (numdisk = 0, ksp_chain = kc->kc_chain;
234 (numdisk < MAX_NUMDISK) && (ksp_chain != NULL);
235 ksp_chain = ksp_chain->ks_next)
237 if (strncmp (ksp_chain->ks_class, "disk", 4)
238 && strncmp (ksp_chain->ks_class, "partition", 9))
240 if (ksp_chain->ks_type != KSTAT_TYPE_IO)
242 ksp[numdisk++] = ksp_chain;
244 #endif /* HAVE_LIBKSTAT */
247 } /* int disk_init */
249 static void disk_submit (const char *plugin_instance,
251 derive_t read, derive_t write)
254 value_list_t vl = VALUE_LIST_INIT;
256 /* Both `ignorelist' and `plugin_instance' may be NULL. */
257 if (ignorelist_match (ignorelist, plugin_instance) != 0)
260 values[0].derive = read;
261 values[1].derive = write;
265 sstrncpy (vl.host, hostname_g, sizeof (vl.host));
266 sstrncpy (vl.plugin, "disk", sizeof (vl.plugin));
267 sstrncpy (vl.plugin_instance, plugin_instance,
268 sizeof (vl.plugin_instance));
269 sstrncpy (vl.type, type, sizeof (vl.type));
271 plugin_dispatch_values (&vl);
272 } /* void disk_submit */
275 static counter_t disk_calc_time_incr (counter_t delta_time, counter_t delta_ops)
277 double interval = CDTIME_T_TO_DOUBLE (plugin_get_interval ());
278 double avg_time = ((double) delta_time) / ((double) delta_ops);
279 double avg_time_incr = interval * avg_time;
281 return ((counter_t) (avg_time_incr + .5));
287 * Attempt to provide an rename disk instance from an assigned udev attribute.
289 * On success, it returns a strduped char* to the desired attribute value.
290 * Otherwise it returns NULL.
293 static char *disk_udev_attr_name (struct udev *udev, char *disk_name, const char *attr)
295 struct udev_device *dev;
299 dev = udev_device_new_from_subsystem_sysname (udev, "block", disk_name);
302 prop = udev_device_get_property_value (dev, attr);
304 output = strdup (prop);
305 DEBUG ("disk plugin: renaming %s => %s", disk_name, output);
307 udev_device_unref (dev);
313 #if HAVE_IOKIT_IOKITLIB_H
314 static signed long long dict_get_value (CFDictionaryRef dict, const char *key)
316 signed long long val_int;
320 /* `key_obj' needs to be released. */
321 key_obj = CFStringCreateWithCString (kCFAllocatorDefault, key,
322 kCFStringEncodingASCII);
325 DEBUG ("CFStringCreateWithCString (%s) failed.", key);
329 /* get => we don't need to release (== free) the object */
330 val_obj = (CFNumberRef) CFDictionaryGetValue (dict, key_obj);
336 DEBUG ("CFDictionaryGetValue (%s) failed.", key);
340 if (!CFNumberGetValue (val_obj, kCFNumberSInt64Type, &val_int))
342 DEBUG ("CFNumberGetValue (%s) failed.", key);
348 #endif /* HAVE_IOKIT_IOKITLIB_H */
350 static int disk_read (void)
352 #if HAVE_IOKIT_IOKITLIB_H
353 io_registry_entry_t disk;
354 io_registry_entry_t disk_child;
355 io_iterator_t disk_list;
356 CFDictionaryRef props_dict;
357 CFDictionaryRef stats_dict;
358 CFDictionaryRef child_dict;
359 CFStringRef tmp_cf_string_ref;
360 kern_return_t status;
362 signed long long read_ops;
363 signed long long read_byt;
364 signed long long read_tme;
365 signed long long write_ops;
366 signed long long write_byt;
367 signed long long write_tme;
371 char disk_name[DATA_MAX_NAME_LEN];
372 char disk_name_bsd[DATA_MAX_NAME_LEN];
374 /* Get the list of all disk objects. */
375 if (IOServiceGetMatchingServices (io_master_port,
376 IOServiceMatching (kIOBlockStorageDriverClass),
377 &disk_list) != kIOReturnSuccess)
379 ERROR ("disk plugin: IOServiceGetMatchingServices failed.");
383 while ((disk = IOIteratorNext (disk_list)) != 0)
389 /* `disk_child' must be released */
390 if ((status = IORegistryEntryGetChildEntry (disk, kIOServicePlane, &disk_child))
393 /* This fails for example for DVD/CD drives.. */
394 DEBUG ("IORegistryEntryGetChildEntry (disk) failed: 0x%08x", status);
395 IOObjectRelease (disk);
399 /* We create `props_dict' => we need to release it later */
400 if (IORegistryEntryCreateCFProperties (disk,
401 (CFMutableDictionaryRef *) &props_dict,
406 ERROR ("disk-plugin: IORegistryEntryCreateCFProperties failed.");
407 IOObjectRelease (disk_child);
408 IOObjectRelease (disk);
412 if (props_dict == NULL)
414 DEBUG ("IORegistryEntryCreateCFProperties (disk) failed.");
415 IOObjectRelease (disk_child);
416 IOObjectRelease (disk);
420 /* tmp_cf_string_ref doesn't need to be released. */
421 tmp_cf_string_ref = (CFStringRef) CFDictionaryGetValue (props_dict,
422 CFSTR(kIOBSDNameKey));
423 if (!tmp_cf_string_ref)
425 DEBUG ("disk plugin: CFDictionaryGetValue("
426 "kIOBSDNameKey) failed.");
427 CFRelease (props_dict);
428 IOObjectRelease (disk_child);
429 IOObjectRelease (disk);
432 assert (CFGetTypeID (tmp_cf_string_ref) == CFStringGetTypeID ());
434 memset (disk_name_bsd, 0, sizeof (disk_name_bsd));
435 CFStringGetCString (tmp_cf_string_ref,
436 disk_name_bsd, sizeof (disk_name_bsd),
437 kCFStringEncodingUTF8);
438 if (disk_name_bsd[0] == 0)
440 ERROR ("disk plugin: CFStringGetCString() failed.");
441 CFRelease (props_dict);
442 IOObjectRelease (disk_child);
443 IOObjectRelease (disk);
446 DEBUG ("disk plugin: disk_name_bsd = \"%s\"", disk_name_bsd);
448 stats_dict = (CFDictionaryRef) CFDictionaryGetValue (props_dict,
449 CFSTR (kIOBlockStorageDriverStatisticsKey));
451 if (stats_dict == NULL)
453 DEBUG ("disk plugin: CFDictionaryGetValue ("
455 kIOBlockStorageDriverStatisticsKey);
456 CFRelease (props_dict);
457 IOObjectRelease (disk_child);
458 IOObjectRelease (disk);
462 if (IORegistryEntryCreateCFProperties (disk_child,
463 (CFMutableDictionaryRef *) &child_dict,
468 DEBUG ("disk plugin: IORegistryEntryCreateCFProperties ("
469 "disk_child) failed.");
470 IOObjectRelease (disk_child);
471 CFRelease (props_dict);
472 IOObjectRelease (disk);
477 disk_major = (int) dict_get_value (child_dict,
479 disk_minor = (int) dict_get_value (child_dict,
481 read_ops = dict_get_value (stats_dict,
482 kIOBlockStorageDriverStatisticsReadsKey);
483 read_byt = dict_get_value (stats_dict,
484 kIOBlockStorageDriverStatisticsBytesReadKey);
485 read_tme = dict_get_value (stats_dict,
486 kIOBlockStorageDriverStatisticsTotalReadTimeKey);
487 write_ops = dict_get_value (stats_dict,
488 kIOBlockStorageDriverStatisticsWritesKey);
489 write_byt = dict_get_value (stats_dict,
490 kIOBlockStorageDriverStatisticsBytesWrittenKey);
491 /* This property describes the number of nanoseconds spent
492 * performing writes since the block storage driver was
493 * instantiated. It is one of the statistic entries listed
494 * under the top-level kIOBlockStorageDriverStatisticsKey
495 * property table. It has an OSNumber value. */
496 write_tme = dict_get_value (stats_dict,
497 kIOBlockStorageDriverStatisticsTotalWriteTimeKey);
500 sstrncpy (disk_name, disk_name_bsd, sizeof (disk_name));
502 ssnprintf (disk_name, sizeof (disk_name), "%i-%i",
503 disk_major, disk_minor);
504 DEBUG ("disk plugin: disk_name = \"%s\"", disk_name);
506 if ((read_byt != -1LL) || (write_byt != -1LL))
507 disk_submit (disk_name, "disk_octets", read_byt, write_byt);
508 if ((read_ops != -1LL) || (write_ops != -1LL))
509 disk_submit (disk_name, "disk_ops", read_ops, write_ops);
510 if ((read_tme != -1LL) || (write_tme != -1LL))
511 disk_submit (disk_name, "disk_time",
515 CFRelease (child_dict);
516 IOObjectRelease (disk_child);
517 CFRelease (props_dict);
518 IOObjectRelease (disk);
520 IOObjectRelease (disk_list);
521 /* #endif HAVE_IOKIT_IOKITLIB_H */
533 derive_t read_sectors = 0;
534 derive_t write_sectors = 0;
536 derive_t read_ops = 0;
537 derive_t read_merged = 0;
538 derive_t read_time = 0;
539 derive_t write_ops = 0;
540 derive_t write_merged = 0;
541 derive_t write_time = 0;
544 diskstats_t *ds, *pre_ds;
546 if ((fh = fopen ("/proc/diskstats", "r")) == NULL)
548 fh = fopen ("/proc/partitions", "r");
551 ERROR ("disk plugin: fopen (/proc/{diskstats,partitions}) failed.");
555 /* Kernel is 2.4.* */
560 handle_udev = udev_new();
563 while (fgets (buffer, sizeof (buffer), fh) != NULL)
569 numfields = strsplit (buffer, fields, 32);
571 if ((numfields != (14 + fieldshift)) && (numfields != 7))
574 minor = atoll (fields[1]);
576 disk_name = fields[2 + fieldshift];
578 for (ds = disklist, pre_ds = disklist; ds != NULL; pre_ds = ds, ds = ds->next)
579 if (strcmp (disk_name, ds->name) == 0)
584 if ((ds = (diskstats_t *) calloc (1, sizeof (diskstats_t))) == NULL)
587 if ((ds->name = strdup (disk_name)) == NULL)
602 /* Kernel 2.6, Partition */
603 read_ops = atoll (fields[3]);
604 read_sectors = atoll (fields[4]);
605 write_ops = atoll (fields[5]);
606 write_sectors = atoll (fields[6]);
608 else if (numfields == (14 + fieldshift))
610 read_ops = atoll (fields[3 + fieldshift]);
611 write_ops = atoll (fields[7 + fieldshift]);
613 read_sectors = atoll (fields[5 + fieldshift]);
614 write_sectors = atoll (fields[9 + fieldshift]);
616 if ((fieldshift == 0) || (minor == 0))
619 read_merged = atoll (fields[4 + fieldshift]);
620 read_time = atoll (fields[6 + fieldshift]);
621 write_merged = atoll (fields[8 + fieldshift]);
622 write_time = atoll (fields[10+ fieldshift]);
627 DEBUG ("numfields = %i; => unknown file format.", numfields);
632 derive_t diff_read_sectors;
633 derive_t diff_write_sectors;
635 /* If the counter wraps around, it's only 32 bits.. */
636 if (read_sectors < ds->read_sectors)
637 diff_read_sectors = 1 + read_sectors
638 + (UINT_MAX - ds->read_sectors);
640 diff_read_sectors = read_sectors - ds->read_sectors;
641 if (write_sectors < ds->write_sectors)
642 diff_write_sectors = 1 + write_sectors
643 + (UINT_MAX - ds->write_sectors);
645 diff_write_sectors = write_sectors - ds->write_sectors;
647 ds->read_bytes += 512 * diff_read_sectors;
648 ds->write_bytes += 512 * diff_write_sectors;
649 ds->read_sectors = read_sectors;
650 ds->write_sectors = write_sectors;
653 /* Calculate the average time an io-op needs to complete */
656 derive_t diff_read_ops;
657 derive_t diff_write_ops;
658 derive_t diff_read_time;
659 derive_t diff_write_time;
661 if (read_ops < ds->read_ops)
662 diff_read_ops = 1 + read_ops
663 + (UINT_MAX - ds->read_ops);
665 diff_read_ops = read_ops - ds->read_ops;
666 DEBUG ("disk plugin: disk_name = %s; read_ops = %"PRIi64"; "
667 "ds->read_ops = %"PRIi64"; diff_read_ops = %"PRIi64";",
669 read_ops, ds->read_ops, diff_read_ops);
671 if (write_ops < ds->write_ops)
672 diff_write_ops = 1 + write_ops
673 + (UINT_MAX - ds->write_ops);
675 diff_write_ops = write_ops - ds->write_ops;
677 if (read_time < ds->read_time)
678 diff_read_time = 1 + read_time
679 + (UINT_MAX - ds->read_time);
681 diff_read_time = read_time - ds->read_time;
683 if (write_time < ds->write_time)
684 diff_write_time = 1 + write_time
685 + (UINT_MAX - ds->write_time);
687 diff_write_time = write_time - ds->write_time;
689 if (diff_read_ops != 0)
690 ds->avg_read_time += disk_calc_time_incr (
691 diff_read_time, diff_read_ops);
692 if (diff_write_ops != 0)
693 ds->avg_write_time += disk_calc_time_incr (
694 diff_write_time, diff_write_ops);
696 ds->read_ops = read_ops;
697 ds->read_time = read_time;
698 ds->write_ops = write_ops;
699 ds->write_time = write_time;
702 /* Don't write to the RRDs if we've just started.. */
704 if (ds->poll_count <= 2)
706 DEBUG ("disk plugin: (ds->poll_count = %i) <= "
707 "(min_poll_count = 2); => Not writing.",
712 if ((read_ops == 0) && (write_ops == 0))
714 DEBUG ("disk plugin: ((read_ops == 0) && "
715 "(write_ops == 0)); => Not writing.");
719 output_name = disk_name;
722 alt_name = disk_udev_attr_name (handle_udev, disk_name,
723 conf_udev_name_attr);
727 if (alt_name != NULL)
728 output_name = alt_name;
730 if ((ds->read_bytes != 0) || (ds->write_bytes != 0))
731 disk_submit (output_name, "disk_octets",
732 ds->read_bytes, ds->write_bytes);
734 if ((ds->read_ops != 0) || (ds->write_ops != 0))
735 disk_submit (output_name, "disk_ops",
736 read_ops, write_ops);
738 if ((ds->avg_read_time != 0) || (ds->avg_write_time != 0))
739 disk_submit (output_name, "disk_time",
740 ds->avg_read_time, ds->avg_write_time);
744 disk_submit (output_name, "disk_merged",
745 read_merged, write_merged);
748 /* release udev-based alternate name, if allocated */
750 } /* while (fgets (buffer, sizeof (buffer), fh) != NULL) */
753 udev_unref(handle_udev);
757 /* #endif defined(KERNEL_LINUX) */
760 # if HAVE_KSTAT_IO_T_WRITES && HAVE_KSTAT_IO_T_NWRITES && HAVE_KSTAT_IO_T_WTIME
761 # define KIO_ROCTETS reads
762 # define KIO_WOCTETS writes
763 # define KIO_ROPS nreads
764 # define KIO_WOPS nwrites
765 # define KIO_RTIME rtime
766 # define KIO_WTIME wtime
767 # elif HAVE_KSTAT_IO_T_NWRITTEN && HAVE_KSTAT_IO_T_WRITES && HAVE_KSTAT_IO_T_WTIME
768 # define KIO_ROCTETS nread
769 # define KIO_WOCTETS nwritten
770 # define KIO_ROPS reads
771 # define KIO_WOPS writes
772 # define KIO_RTIME rtime
773 # define KIO_WTIME wtime
775 # error "kstat_io_t does not have the required members"
777 static kstat_io_t kio;
783 for (i = 0; i < numdisk; i++)
785 if (kstat_read (kc, ksp[i], &kio) == -1)
788 if (strncmp (ksp[i]->ks_class, "disk", 4) == 0)
790 disk_submit (ksp[i]->ks_name, "disk_octets",
791 kio.KIO_ROCTETS, kio.KIO_WOCTETS);
792 disk_submit (ksp[i]->ks_name, "disk_ops",
793 kio.KIO_ROPS, kio.KIO_WOPS);
794 /* FIXME: Convert this to microseconds if necessary */
795 disk_submit (ksp[i]->ks_name, "disk_time",
796 kio.KIO_RTIME, kio.KIO_WTIME);
798 else if (strncmp (ksp[i]->ks_class, "partition", 9) == 0)
800 disk_submit (ksp[i]->ks_name, "disk_octets",
801 kio.KIO_ROCTETS, kio.KIO_WOCTETS);
802 disk_submit (ksp[i]->ks_name, "disk_ops",
803 kio.KIO_ROPS, kio.KIO_WOPS);
806 /* #endif defined(HAVE_LIBKSTAT) */
808 #elif defined(HAVE_LIBSTATGRAB)
809 sg_disk_io_stats *ds;
811 char name[DATA_MAX_NAME_LEN];
813 if ((ds = sg_get_disk_io_stats(&disks)) == NULL)
816 for (counter=0; counter < disks; counter++) {
817 strncpy(name, ds->disk_name, sizeof(name));
818 name[sizeof(name)-1] = '\0'; /* strncpy doesn't terminate longer strings */
819 disk_submit (name, "disk_octets", ds->read_bytes, ds->write_bytes);
822 /* #endif defined(HAVE_LIBSTATGRAB) */
824 #elif defined(HAVE_PERFSTAT)
825 derive_t read_sectors;
826 derive_t write_sectors;
831 perfstat_id_t firstpath;
835 if ((numdisk = perfstat_disk(NULL, NULL, sizeof(perfstat_disk_t), 0)) < 0)
838 WARNING ("disk plugin: perfstat_disk: %s",
839 sstrerror (errno, errbuf, sizeof (errbuf)));
843 if (numdisk != pnumdisk || stat_disk==NULL) {
846 stat_disk = (perfstat_disk_t *)calloc(numdisk, sizeof(perfstat_disk_t));
850 firstpath.name[0]='\0';
851 if ((rnumdisk = perfstat_disk(&firstpath, stat_disk, sizeof(perfstat_disk_t), numdisk)) < 0)
854 WARNING ("disk plugin: perfstat_disk : %s",
855 sstrerror (errno, errbuf, sizeof (errbuf)));
859 for (i = 0; i < rnumdisk; i++)
861 read_sectors = stat_disk[i].rblks*stat_disk[i].bsize;
862 write_sectors = stat_disk[i].wblks*stat_disk[i].bsize;
863 disk_submit (stat_disk[i].name, "disk_octets", read_sectors, write_sectors);
865 read_ops = stat_disk[i].xrate;
866 write_ops = stat_disk[i].xfers - stat_disk[i].xrate;
867 disk_submit (stat_disk[i].name, "disk_ops", read_ops, write_ops);
869 read_time = stat_disk[i].rserv;
870 read_time *= ((double)(_system_configuration.Xint)/(double)(_system_configuration.Xfrac)) / 1000000.0;
871 write_time = stat_disk[i].wserv;
872 write_time *= ((double)(_system_configuration.Xint)/(double)(_system_configuration.Xfrac)) / 1000000.0;
873 disk_submit (stat_disk[i].name, "disk_time", read_time, write_time);
875 #endif /* defined(HAVE_PERFSTAT) */
878 } /* int disk_read */
880 void module_register (void)
882 plugin_register_config ("disk", disk_config,
883 config_keys, config_keys_num);
884 plugin_register_init ("disk", disk_init);
885 plugin_register_read ("disk", disk_read);
886 } /* void module_register */