Release 4.14 arch/s390/hypfs/hypfs_dbfs.c
// SPDX-License-Identifier: GPL-2.0
/*
* Hypervisor filesystem for Linux on s390 - debugfs interface
*
* Copyright IBM Corp. 2010
* Author(s): Michael Holzheu <holzheu@linux.vnet.ibm.com>
*/
#include <linux/slab.h>
#include "hypfs.h"
static struct dentry *dbfs_dir;
static struct hypfs_dbfs_data *hypfs_dbfs_data_alloc(struct hypfs_dbfs_file *f)
{
struct hypfs_dbfs_data *data;
data = kmalloc(sizeof(*data), GFP_KERNEL);
if (!data)
return NULL;
data->dbfs_file = f;
return data;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Michael Holzheu | 48 | 100.00% | 1 | 100.00% |
Total | 48 | 100.00% | 1 | 100.00% |
static void hypfs_dbfs_data_free(struct hypfs_dbfs_data *data)
{
data->dbfs_file->data_free(data->buf_free_ptr);
kfree(data);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Michael Holzheu | 27 | 100.00% | 2 | 100.00% |
Total | 27 | 100.00% | 2 | 100.00% |
static ssize_t dbfs_read(struct file *file, char __user *buf,
size_t size, loff_t *ppos)
{
struct hypfs_dbfs_data *data;
struct hypfs_dbfs_file *df;
ssize_t rc;
if (*ppos != 0)
return 0;
df = file_inode(file)->i_private;
mutex_lock(&df->lock);
data = hypfs_dbfs_data_alloc(df);
if (!data) {
mutex_unlock(&df->lock);
return -ENOMEM;
}
rc = df->data_create(&data->buf, &data->buf_free_ptr, &data->size);
if (rc) {
mutex_unlock(&df->lock);
kfree(data);
return rc;
}
mutex_unlock(&df->lock);
rc = simple_read_from_buffer(buf, size, ppos, data->buf, data->size);
hypfs_dbfs_data_free(data);
return rc;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Michael Holzheu | 165 | 98.21% | 2 | 66.67% |
Al Viro | 3 | 1.79% | 1 | 33.33% |
Total | 168 | 100.00% | 3 | 100.00% |
static long dbfs_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
struct hypfs_dbfs_file *df = file_inode(file)->i_private;
long rc;
mutex_lock(&df->lock);
if (df->unlocked_ioctl)
rc = df->unlocked_ioctl(file, cmd, arg);
else
rc = -ENOTTY;
mutex_unlock(&df->lock);
return rc;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Martin Schwidefsky | 71 | 91.03% | 1 | 50.00% |
Al Viro | 7 | 8.97% | 1 | 50.00% |
Total | 78 | 100.00% | 2 | 100.00% |
static const struct file_operations dbfs_ops = {
.read = dbfs_read,
.llseek = no_llseek,
.unlocked_ioctl = dbfs_ioctl,
};
int hypfs_dbfs_create_file(struct hypfs_dbfs_file *df)
{
df->dentry = debugfs_create_file(df->name, 0400, dbfs_dir, df,
&dbfs_ops);
if (IS_ERR(df->dentry))
return PTR_ERR(df->dentry);
mutex_init(&df->lock);
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Michael Holzheu | 58 | 100.00% | 1 | 100.00% |
Total | 58 | 100.00% | 1 | 100.00% |
void hypfs_dbfs_remove_file(struct hypfs_dbfs_file *df)
{
debugfs_remove(df->dentry);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Michael Holzheu | 17 | 100.00% | 1 | 100.00% |
Total | 17 | 100.00% | 1 | 100.00% |
int hypfs_dbfs_init(void)
{
dbfs_dir = debugfs_create_dir("s390_hypfs", NULL);
return PTR_ERR_OR_ZERO(dbfs_dir);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Michael Holzheu | 21 | 95.45% | 1 | 50.00% |
Rusty Russell | 1 | 4.55% | 1 | 50.00% |
Total | 22 | 100.00% | 2 | 100.00% |
void hypfs_dbfs_exit(void)
{
debugfs_remove(dbfs_dir);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Michael Holzheu | 12 | 100.00% | 1 | 100.00% |
Total | 12 | 100.00% | 1 | 100.00% |
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Michael Holzheu | 378 | 80.94% | 2 | 25.00% |
Martin Schwidefsky | 76 | 16.27% | 1 | 12.50% |
Al Viro | 10 | 2.14% | 2 | 25.00% |
Heiko Carstens | 1 | 0.21% | 1 | 12.50% |
Rusty Russell | 1 | 0.21% | 1 | 12.50% |
Greg Kroah-Hartman | 1 | 0.21% | 1 | 12.50% |
Total | 467 | 100.00% | 8 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.