diff options
author | Seth Jennings <sjenning@linux.vnet.ibm.com> | 2013-06-04 00:33:02 +0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-06-04 00:55:01 +0400 |
commit | 3a76e5e09fbb51e756b4e732e3e65446f4984cf5 (patch) | |
tree | b08061613e352317bc3189abff31609279c0f2fa /lib/fault-inject.c | |
parent | 4993632218e2202d4f110c8e83ae819ca26e6845 (diff) | |
download | linux-3a76e5e09fbb51e756b4e732e3e65446f4984cf5.tar.xz |
debugfs: add get/set for atomic types
debugfs currently lack the ability to create attributes
that set/get atomic_t values.
This patch adds support for this through a new
debugfs_create_atomic_t() function.
Signed-off-by: Seth Jennings <sjenning@linux.vnet.ibm.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Mel Gorman <mgorman@suse.de>
Acked-by: Rik van Riel <riel@redhat.com>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'lib/fault-inject.c')
-rw-r--r-- | lib/fault-inject.c | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/lib/fault-inject.c b/lib/fault-inject.c index c5c7a762b850..d7d501ea856d 100644 --- a/lib/fault-inject.c +++ b/lib/fault-inject.c @@ -182,27 +182,6 @@ static struct dentry *debugfs_create_stacktrace_depth( #endif /* CONFIG_FAULT_INJECTION_STACKTRACE_FILTER */ -static int debugfs_atomic_t_set(void *data, u64 val) -{ - atomic_set((atomic_t *)data, val); - return 0; -} - -static int debugfs_atomic_t_get(void *data, u64 *val) -{ - *val = atomic_read((atomic_t *)data); - return 0; -} - -DEFINE_SIMPLE_ATTRIBUTE(fops_atomic_t, debugfs_atomic_t_get, - debugfs_atomic_t_set, "%lld\n"); - -static struct dentry *debugfs_create_atomic_t(const char *name, umode_t mode, - struct dentry *parent, atomic_t *value) -{ - return debugfs_create_file(name, mode, parent, value, &fops_atomic_t); -} - struct dentry *fault_create_debugfs_attr(const char *name, struct dentry *parent, struct fault_attr *attr) { |