Release 4.7 drivers/s390/char/tape_proc.c
/*
* tape device driver for S/390 and zSeries tapes.
*
* S390 and zSeries version
* Copyright IBM Corp. 2001
* Author(s): Carsten Otte <cotte@de.ibm.com>
* Michael Holzheu <holzheu@de.ibm.com>
* Tuan Ngo-Anh <ngoanh@de.ibm.com>
*
* PROCFS Functions
*/
#define KMSG_COMPONENT "tape"
#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
#include <linux/module.h>
#include <linux/vmalloc.h>
#include <linux/seq_file.h>
#include <linux/proc_fs.h>
#define TAPE_DBF_AREA tape_core_dbf
#include "tape.h"
static const char *tape_med_st_verbose[MS_SIZE] =
{
[MS_UNKNOWN] = "UNKNOWN ",
[MS_LOADED] = "LOADED ",
[MS_UNLOADED] = "UNLOADED"
};
/* our proc tapedevices entry */
static struct proc_dir_entry *tape_proc_devices;
/*
* Show function for /proc/tapedevices
*/
static int tape_proc_show(struct seq_file *m, void *v)
{
struct tape_device *device;
struct tape_request *request;
const char *str;
unsigned long n;
n = (unsigned long) v - 1;
if (!n) {
seq_printf(m, "TapeNo\tBusID CuType/Model\t"
"DevType/Model\tBlkSize\tState\tOp\tMedState\n");
}
device = tape_find_device(n);
if (IS_ERR(device))
return 0;
spin_lock_irq(get_ccwdev_lock(device->cdev));
seq_printf(m, "%d\t", (int) n);
seq_printf(m, "%-10.10s ", dev_name(&device->cdev->dev));
seq_printf(m, "%04X/", device->cdev->id.cu_type);
seq_printf(m, "%02X\t", device->cdev->id.cu_model);
seq_printf(m, "%04X/", device->cdev->id.dev_type);
seq_printf(m, "%02X\t\t", device->cdev->id.dev_model);
if (device->char_data.block_size == 0)
seq_printf(m, "auto\t");
else
seq_printf(m, "%i\t", device->char_data.block_size);
if (device->tape_state >= 0 &&
device->tape_state < TS_SIZE)
str = tape_state_verbose[device->tape_state];
else
str = "UNKNOWN";
seq_printf(m, "%s\t", str);
if (!list_empty(&device->req_queue)) {
request = list_entry(device->req_queue.next,
struct tape_request, list);
str = tape_op_verbose[request->op];
} else
str = "---";
seq_printf(m, "%s\t", str);
seq_printf(m, "%s\n", tape_med_st_verbose[device->medium_state]);
spin_unlock_irq(get_ccwdev_lock(device->cdev));
tape_put_device(device);
return 0;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
martin schwidefsky | martin schwidefsky | 317 | 96.94% | 2 | 50.00% |
andrew morton | andrew morton | 6 | 1.83% | 1 | 25.00% |
kay sievers | kay sievers | 4 | 1.22% | 1 | 25.00% |
| Total | 327 | 100.00% | 4 | 100.00% |
static void *tape_proc_start(struct seq_file *m, loff_t *pos)
{
if (*pos >= 256 / TAPE_MINORS_PER_DEV)
return NULL;
return (void *)((unsigned long) *pos + 1);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
martin schwidefsky | martin schwidefsky | 43 | 97.73% | 1 | 50.00% |
al viro | al viro | 1 | 2.27% | 1 | 50.00% |
| Total | 44 | 100.00% | 2 | 100.00% |
static void *tape_proc_next(struct seq_file *m, void *v, loff_t *pos)
{
++*pos;
return tape_proc_start(m, pos);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
martin schwidefsky | martin schwidefsky | 32 | 100.00% | 1 | 100.00% |
| Total | 32 | 100.00% | 1 | 100.00% |
static void tape_proc_stop(struct seq_file *m, void *v)
{
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
martin schwidefsky | martin schwidefsky | 14 | 100.00% | 1 | 100.00% |
| Total | 14 | 100.00% | 1 | 100.00% |
static const struct seq_operations tape_proc_seq = {
.start = tape_proc_start,
.next = tape_proc_next,
.stop = tape_proc_stop,
.show = tape_proc_show,
};
static int tape_proc_open(struct inode *inode, struct file *file)
{
return seq_open(file, &tape_proc_seq);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
martin schwidefsky | martin schwidefsky | 25 | 100.00% | 1 | 100.00% |
| Total | 25 | 100.00% | 1 | 100.00% |
static const struct file_operations tape_proc_ops =
{
.owner = THIS_MODULE,
.open = tape_proc_open,
.read = seq_read,
.llseek = seq_lseek,
.release = seq_release,
};
/*
* Initialize procfs stuff on startup
*/
void
tape_proc_init(void)
{
tape_proc_devices =
proc_create("tapedevices", S_IFREG | S_IRUGO | S_IWUSR, NULL,
&tape_proc_ops);
if (tape_proc_devices == NULL) {
return;
}
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
martin schwidefsky | martin schwidefsky | 29 | 85.29% | 1 | 33.33% |
denis v. lunev | denis v. lunev | 4 | 11.76% | 1 | 33.33% |
alexey dobriyan | alexey dobriyan | 1 | 2.94% | 1 | 33.33% |
| Total | 34 | 100.00% | 3 | 100.00% |
/*
* Cleanup all stuff registered to the procfs
*/
void
tape_proc_cleanup(void)
{
if (tape_proc_devices != NULL)
remove_proc_entry ("tapedevices", NULL);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
martin schwidefsky | martin schwidefsky | 19 | 95.00% | 1 | 50.00% |
alexey dobriyan | alexey dobriyan | 1 | 5.00% | 1 | 50.00% |
| Total | 20 | 100.00% | 2 | 100.00% |
Overall Contributors
| Person | Tokens | Prop | Commits | CommitProp |
martin schwidefsky | martin schwidefsky | 584 | 93.14% | 2 | 15.38% |
michael holzheu | michael holzheu | 14 | 2.23% | 2 | 15.38% |
andrew morton | andrew morton | 10 | 1.59% | 2 | 15.38% |
denis v. lunev | denis v. lunev | 9 | 1.44% | 1 | 7.69% |
kay sievers | kay sievers | 4 | 0.64% | 1 | 7.69% |
alexey dobriyan | alexey dobriyan | 2 | 0.32% | 1 | 7.69% |
arjan van de ven | arjan van de ven | 1 | 0.16% | 1 | 7.69% |
al viro | al viro | 1 | 0.16% | 1 | 7.69% |
heiko carstens | heiko carstens | 1 | 0.16% | 1 | 7.69% |
jan engelhardt | jan engelhardt | 1 | 0.16% | 1 | 7.69% |
| Total | 627 | 100.00% | 13 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.