Initial commit

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
This commit is contained in:
Robert Baldyga
2019-03-29 08:39:34 +01:00
commit 94e8ca09e0
140 changed files with 37144 additions and 0 deletions

35
modules/cas_disk/sysfs.c Normal file
View File

@@ -0,0 +1,35 @@
/*
* Copyright(c) 2012-2019 Intel Corporation
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
#include "cas_disk_defs.h"
#include "sysfs.h"
static ssize_t _casdsk_sysfs_show(struct kobject *kobj, struct attribute *attr,
char *page)
{
struct casdsk_attribute *casdsk_attr =
container_of(attr, struct casdsk_attribute, attr);
if (!casdsk_attr->show)
return -EIO;
return casdsk_attr->show(kobj, page);
}
static ssize_t _casdsk_sysfs_store(struct kobject *kobj, struct attribute *attr,
const char *buf, size_t len)
{
struct casdsk_attribute *casdsk_attr =
container_of(attr, struct casdsk_attribute, attr);
if (!casdsk_attr->store)
return -EIO;
return casdsk_attr->store(kobj, buf, len);
}
const struct sysfs_ops casdsk_sysfs_ops = {
.show = _casdsk_sysfs_show,
.store = _casdsk_sysfs_store
};