summaryrefslogtreecommitdiff
path: root/fs/debugfs/internal.h
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2023-11-24 17:25:26 +0100
committerJohannes Berg <johannes.berg@intel.com>2023-11-27 11:24:55 +0100
commit8c88a474357ead632b07c70bf7f119ace8c3b39e (patch)
tree31c18cdb506b19cef567f05306f958c3d65c9dfa /fs/debugfs/internal.h
parentf4acfcd4deb158b96595250cc332901b282d15b0 (diff)
debugfs: add API to allow debugfs operations cancellation
In some cases there might be longer-running hardware accesses in debugfs files, or attempts to acquire locks, and we want to still be able to quickly remove the files. Introduce a cancellations API to use inside the debugfs handler functions to be able to cancel such operations on a per-file basis. Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'fs/debugfs/internal.h')
-rw-r--r--fs/debugfs/internal.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/debugfs/internal.h b/fs/debugfs/internal.h
index c7d61cfc97d2..0c4c68cf161f 100644
--- a/fs/debugfs/internal.h
+++ b/fs/debugfs/internal.h
@@ -8,6 +8,7 @@
#ifndef _DEBUGFS_INTERNAL_H_
#define _DEBUGFS_INTERNAL_H_
#include <linux/lockdep.h>
+#include <linux/list.h>
struct file_operations;
@@ -29,6 +30,10 @@ struct debugfs_fsdata {
struct lock_class_key key;
char *lock_name;
#endif
+
+ /* protect cancellations */
+ struct mutex cancellations_mtx;
+ struct list_head cancellations;
};
};
};