2 * Copyright (c) 2014 Red Hat, Inc.
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation.
9 * This program is distributed in the hope that it would be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 #include "xfs_sysfs.h"
22 struct xfs_sysfs_attr {
23 struct attribute attr;
24 ssize_t (*show)(char *buf, void *data);
25 ssize_t (*store)(const char *buf, size_t count, void *data);
28 static inline struct xfs_sysfs_attr *
29 to_attr(struct attribute *attr)
31 return container_of(attr, struct xfs_sysfs_attr, attr);
34 #define XFS_SYSFS_ATTR_RW(name) \
35 static struct xfs_sysfs_attr xfs_sysfs_attr_##name = __ATTR_RW(name)
36 #define XFS_SYSFS_ATTR_RO(name) \
37 static struct xfs_sysfs_attr xfs_sysfs_attr_##name = __ATTR_RO(name)
39 #define ATTR_LIST(name) &xfs_sysfs_attr_##name.attr
42 * xfs_mount kobject. This currently has no attributes and thus no need for show
43 * and store helpers. The mp kobject serves as the per-mount parent object that
44 * is identified by the fsname under sysfs.
47 struct kobj_type xfs_mp_ktype = {
48 .release = xfs_sysfs_release,