• S
    tracing/events: make modules have their own file_operations structure · 701970b3
    Steven Rostedt 提交于
    For proper module reference counting, the file_operations that modules use
    must have the "owner" field set to the module. Unfortunately, the trace events
    use share file_operations. The same file_operations are used by all both
    kernel core and all modules.
    
    This patch makes the modules allocate their own file_operations and
    copies the functions from the core kernel. This allows those file
    operations to be owned by the module.
    
    Care is taken to free this code on module unload.
    
    Thanks to Greg KH for reminding me that file_operations must be owned
    by the module to have reference counting take place.
    
    [ Impact: fix modular tracepoints / potential crash ]
    Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
    Acked-by: NGreg Kroah-Hartman <gregkh@suse.de>
    701970b3
trace_events.c 25.5 KB