]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/s390/block/dasd_proc.c
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jk/spufs into...
[linux-2.6-omap-h63xx.git] / drivers / s390 / block / dasd_proc.c
index 8b3b0f4a157c09aaa23299a6cdbdfc8be2f1406f..556063e8f7a91d1163450cc63d1cd9128e6a77b4 100644 (file)
@@ -28,6 +28,7 @@ static struct proc_dir_entry *dasd_proc_root_entry = NULL;
 static struct proc_dir_entry *dasd_devices_entry = NULL;
 static struct proc_dir_entry *dasd_statistics_entry = NULL;
 
+#ifdef CONFIG_DASD_PROFILE
 static char *
 dasd_get_user_string(const char __user *user_buf, size_t user_len)
 {
@@ -47,16 +48,24 @@ dasd_get_user_string(const char __user *user_buf, size_t user_len)
                buffer[user_len] = 0;
        return buffer;
 }
+#endif /* CONFIG_DASD_PROFILE */
 
 static int
 dasd_devices_show(struct seq_file *m, void *v)
 {
        struct dasd_device *device;
+       struct dasd_block *block;
        char *substr;
 
        device = dasd_device_from_devindex((unsigned long) v - 1);
        if (IS_ERR(device))
                return 0;
+       if (device->block)
+               block = device->block;
+       else {
+               dasd_put_device(device);
+               return 0;
+       }
        /* Print device number. */
        seq_printf(m, "%s", device->cdev->dev.bus_id);
        /* Print discipline string. */
@@ -65,14 +74,14 @@ dasd_devices_show(struct seq_file *m, void *v)
        else
                seq_printf(m, "(none)");
        /* Print kdev. */
-       if (device->gdp)
+       if (block->gdp)
                seq_printf(m, " at (%3d:%6d)",
-                          device->gdp->major, device->gdp->first_minor);
+                          block->gdp->major, block->gdp->first_minor);
        else
                seq_printf(m, "  at (???:??????)");
        /* Print device name. */
-       if (device->gdp)
-               seq_printf(m, " is %-8s", device->gdp->disk_name);
+       if (block->gdp)
+               seq_printf(m, " is %-8s", block->gdp->disk_name);
        else
                seq_printf(m, " is ????????");
        /* Print devices features. */
@@ -98,14 +107,14 @@ dasd_devices_show(struct seq_file *m, void *v)
        case DASD_STATE_READY:
        case DASD_STATE_ONLINE:
                seq_printf(m, "active ");
-               if (dasd_check_blocksize(device->bp_block))
+               if (dasd_check_blocksize(block->bp_block))
                        seq_printf(m, "n/f       ");
                else
                        seq_printf(m,
                                   "at blocksize: %d, %ld blocks, %ld MB",
-                                  device->bp_block, device->blocks,
-                                  ((device->bp_block >> 9) *
-                                   device->blocks) >> 11);
+                                  block->bp_block, block->blocks,
+                                  ((block->bp_block >> 9) *
+                                   block->blocks) >> 11);
                break;
        default:
                seq_printf(m, "no stat");
@@ -135,7 +144,7 @@ static void dasd_devices_stop(struct seq_file *m, void *v)
 {
 }
 
-static struct seq_operations dasd_devices_seq_ops = {
+static const struct seq_operations dasd_devices_seq_ops = {
        .start          = dasd_devices_start,
        .next           = dasd_devices_next,
        .stop           = dasd_devices_stop,
@@ -167,6 +176,7 @@ dasd_calc_metrics(char *page, char **start, off_t off,
        return len;
 }
 
+#ifdef CONFIG_DASD_PROFILE
 static char *
 dasd_statistics_array(char *str, unsigned int *array, int shift)
 {
@@ -180,6 +190,7 @@ dasd_statistics_array(char *str, unsigned int *array, int shift)
        str += sprintf(str,"\n");
        return str;
 }
+#endif /* CONFIG_DASD_PROFILE */
 
 static int
 dasd_statistics_read(char *page, char **start, off_t off,