aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorSeth Jennings <sjenning@linux.vnet.ibm.com>2013-06-03 16:33:02 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-06-03 16:55:01 -0400
commit3a76e5e09fbb51e756b4e732e3e65446f4984cf5 (patch)
treeb08061613e352317bc3189abff31609279c0f2fa /lib
parent4993632218e2202d4f110c8e83ae819ca26e6845 (diff)
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')
-rw-r--r--lib/fault-inject.c21
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(
182 182
183#endif /* CONFIG_FAULT_INJECTION_STACKTRACE_FILTER */ 183#endif /* CONFIG_FAULT_INJECTION_STACKTRACE_FILTER */
184 184
185static int debugfs_atomic_t_set(void *data, u64 val)
186{
187 atomic_set((atomic_t *)data, val);
188 return 0;
189}
190
191static int debugfs_atomic_t_get(void *data, u64 *val)
192{
193 *val = atomic_read((atomic_t *)data);
194 return 0;
195}
196
197DEFINE_SIMPLE_ATTRIBUTE(fops_atomic_t, debugfs_atomic_t_get,
198 debugfs_atomic_t_set, "%lld\n");
199
200static struct dentry *debugfs_create_atomic_t(const char *name, umode_t mode,
201 struct dentry *parent, atomic_t *value)
202{
203 return debugfs_create_file(name, mode, parent, value, &fops_atomic_t);
204}
205
206struct dentry *fault_create_debugfs_attr(const char *name, 185struct dentry *fault_create_debugfs_attr(const char *name,
207 struct dentry *parent, struct fault_attr *attr) 186 struct dentry *parent, struct fault_attr *attr)
208{ 187{