mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-07-14 21:29:37 +02:00
Revert "eventfs/tracing: Add callback for release of an eventfs_inode"
This reverts commit14aa4f3efc
which is commitb63db58e2f
upstream. It breaks the Android kernel abi and can be brought back in the future in an abi-safe way if it is really needed. Bug: 161946584 Change-Id: I40755014c220cd615b1145f50ba32d8712b07d90 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
parent
5302e964f3
commit
117f556b94
|
@ -83,17 +83,10 @@ enum {
|
||||||
static void release_ei(struct kref *ref)
|
static void release_ei(struct kref *ref)
|
||||||
{
|
{
|
||||||
struct eventfs_inode *ei = container_of(ref, struct eventfs_inode, kref);
|
struct eventfs_inode *ei = container_of(ref, struct eventfs_inode, kref);
|
||||||
const struct eventfs_entry *entry;
|
|
||||||
struct eventfs_root_inode *rei;
|
struct eventfs_root_inode *rei;
|
||||||
|
|
||||||
WARN_ON_ONCE(!ei->is_freed);
|
WARN_ON_ONCE(!ei->is_freed);
|
||||||
|
|
||||||
for (int i = 0; i < ei->nr_entries; i++) {
|
|
||||||
entry = &ei->entries[i];
|
|
||||||
if (entry->release)
|
|
||||||
entry->release(entry->name, ei->data);
|
|
||||||
}
|
|
||||||
|
|
||||||
kfree(ei->entry_attrs);
|
kfree(ei->entry_attrs);
|
||||||
kfree_const(ei->name);
|
kfree_const(ei->name);
|
||||||
if (ei->is_events) {
|
if (ei->is_events) {
|
||||||
|
@ -118,18 +111,6 @@ static inline void free_ei(struct eventfs_inode *ei)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Called when creation of an ei fails, do not call release() functions.
|
|
||||||
*/
|
|
||||||
static inline void cleanup_ei(struct eventfs_inode *ei)
|
|
||||||
{
|
|
||||||
if (ei) {
|
|
||||||
/* Set nr_entries to 0 to prevent release() function being called */
|
|
||||||
ei->nr_entries = 0;
|
|
||||||
free_ei(ei);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline struct eventfs_inode *get_ei(struct eventfs_inode *ei)
|
static inline struct eventfs_inode *get_ei(struct eventfs_inode *ei)
|
||||||
{
|
{
|
||||||
if (ei)
|
if (ei)
|
||||||
|
@ -756,7 +737,7 @@ struct eventfs_inode *eventfs_create_dir(const char *name, struct eventfs_inode
|
||||||
|
|
||||||
/* Was the parent freed? */
|
/* Was the parent freed? */
|
||||||
if (list_empty(&ei->list)) {
|
if (list_empty(&ei->list)) {
|
||||||
cleanup_ei(ei);
|
free_ei(ei);
|
||||||
ei = NULL;
|
ei = NULL;
|
||||||
}
|
}
|
||||||
return ei;
|
return ei;
|
||||||
|
@ -849,7 +830,7 @@ struct eventfs_inode *eventfs_create_events_dir(const char *name, struct dentry
|
||||||
return ei;
|
return ei;
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
cleanup_ei(ei);
|
free_ei(ei);
|
||||||
tracefs_failed_creating(dentry);
|
tracefs_failed_creating(dentry);
|
||||||
return ERR_PTR(-ENOMEM);
|
return ERR_PTR(-ENOMEM);
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,8 +62,6 @@ struct eventfs_file;
|
||||||
typedef int (*eventfs_callback)(const char *name, umode_t *mode, void **data,
|
typedef int (*eventfs_callback)(const char *name, umode_t *mode, void **data,
|
||||||
const struct file_operations **fops);
|
const struct file_operations **fops);
|
||||||
|
|
||||||
typedef void (*eventfs_release)(const char *name, void *data);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* struct eventfs_entry - dynamically created eventfs file call back handler
|
* struct eventfs_entry - dynamically created eventfs file call back handler
|
||||||
* @name: Then name of the dynamic file in an eventfs directory
|
* @name: Then name of the dynamic file in an eventfs directory
|
||||||
|
@ -74,7 +72,6 @@ typedef void (*eventfs_release)(const char *name, void *data);
|
||||||
struct eventfs_entry {
|
struct eventfs_entry {
|
||||||
const char *name;
|
const char *name;
|
||||||
eventfs_callback callback;
|
eventfs_callback callback;
|
||||||
eventfs_release release;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct eventfs_inode;
|
struct eventfs_inode;
|
||||||
|
|
|
@ -2518,14 +2518,6 @@ static int event_callback(const char *name, umode_t *mode, void **data,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The file is incremented on creation and freeing the enable file decrements it */
|
|
||||||
static void event_release(const char *name, void *data)
|
|
||||||
{
|
|
||||||
struct trace_event_file *file = data;
|
|
||||||
|
|
||||||
event_file_put(file);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
event_create_dir(struct eventfs_inode *parent, struct trace_event_file *file)
|
event_create_dir(struct eventfs_inode *parent, struct trace_event_file *file)
|
||||||
{
|
{
|
||||||
|
@ -2540,7 +2532,6 @@ event_create_dir(struct eventfs_inode *parent, struct trace_event_file *file)
|
||||||
{
|
{
|
||||||
.name = "enable",
|
.name = "enable",
|
||||||
.callback = event_callback,
|
.callback = event_callback,
|
||||||
.release = event_release,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
.name = "filter",
|
.name = "filter",
|
||||||
|
@ -2609,9 +2600,6 @@ event_create_dir(struct eventfs_inode *parent, struct trace_event_file *file)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Gets decremented on freeing of the "enable" file */
|
|
||||||
event_file_get(file);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user