summaryrefslogtreecommitdiff
path: root/arch/s390/hypfs/hypfs_dbfs.c
diff options
context:
space:
mode:
authorMartin Schwidefsky <schwidefsky@de.ibm.com>2014-01-24 09:18:52 +0100
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2014-01-24 09:40:59 +0100
commit07be0382097027cde68d9268cc628741069b5762 (patch)
treefee25ed4434d1d3d1d670b53065864ccc12c0d18 /arch/s390/hypfs/hypfs_dbfs.c
parentfded4329da9e8486b434d6c4aceab1ab3f433d8a (diff)
downloadlinux-next-07be0382097027cde68d9268cc628741069b5762.tar.gz
s390/hypfs: add interface for diagnose 0x304
To provide access to the set-partition-resource-parameter interface to user space add a new attribute to hypfs/debugfs: * s390_hypsfs/diag_304 The data for the query-partition-resource-parameters command can be access by a read on the attribute. All other diagnose 0x304 requests need to be submitted via ioctl with CAP_SYS_ADMIN rights. Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/hypfs/hypfs_dbfs.c')
-rw-r--r--arch/s390/hypfs/hypfs_dbfs.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/s390/hypfs/hypfs_dbfs.c b/arch/s390/hypfs/hypfs_dbfs.c
index 17ab8b7b53cc..2badf2bf9cd7 100644
--- a/arch/s390/hypfs/hypfs_dbfs.c
+++ b/arch/s390/hypfs/hypfs_dbfs.c
@@ -81,9 +81,25 @@ static ssize_t dbfs_read(struct file *file, char __user *buf,
return rc;
}
+static long dbfs_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
+{
+ struct hypfs_dbfs_file *df;
+ long rc;
+
+ df = file->f_path.dentry->d_inode->i_private;
+ mutex_lock(&df->lock);
+ if (df->unlocked_ioctl)
+ rc = df->unlocked_ioctl(file, cmd, arg);
+ else
+ rc = -ENOTTY;
+ mutex_unlock(&df->lock);
+ return rc;
+}
+
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)