Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
notifier.c File Reference
#include <linux/kdebug.h>
#include <linux/kprobes.h>
#include <linux/export.h>
#include <linux/notifier.h>
#include <linux/rcupdate.h>
#include <linux/vmalloc.h>
#include <linux/reboot.h>

Go to the source code of this file.

Functions

 BLOCKING_NOTIFIER_HEAD (reboot_notifier_list)
 
int atomic_notifier_chain_register (struct atomic_notifier_head *nh, struct notifier_block *n)
 
 EXPORT_SYMBOL_GPL (atomic_notifier_chain_register)
 
int atomic_notifier_chain_unregister (struct atomic_notifier_head *nh, struct notifier_block *n)
 
 EXPORT_SYMBOL_GPL (atomic_notifier_chain_unregister)
 
int __kprobes __atomic_notifier_call_chain (struct atomic_notifier_head *nh, unsigned long val, void *v, int nr_to_call, int *nr_calls)
 
 EXPORT_SYMBOL_GPL (__atomic_notifier_call_chain)
 
int __kprobes atomic_notifier_call_chain (struct atomic_notifier_head *nh, unsigned long val, void *v)
 
 EXPORT_SYMBOL_GPL (atomic_notifier_call_chain)
 
int blocking_notifier_chain_register (struct blocking_notifier_head *nh, struct notifier_block *n)
 
 EXPORT_SYMBOL_GPL (blocking_notifier_chain_register)
 
int blocking_notifier_chain_cond_register (struct blocking_notifier_head *nh, struct notifier_block *n)
 
 EXPORT_SYMBOL_GPL (blocking_notifier_chain_cond_register)
 
int blocking_notifier_chain_unregister (struct blocking_notifier_head *nh, struct notifier_block *n)
 
 EXPORT_SYMBOL_GPL (blocking_notifier_chain_unregister)
 
int __blocking_notifier_call_chain (struct blocking_notifier_head *nh, unsigned long val, void *v, int nr_to_call, int *nr_calls)
 
 EXPORT_SYMBOL_GPL (__blocking_notifier_call_chain)
 
int blocking_notifier_call_chain (struct blocking_notifier_head *nh, unsigned long val, void *v)
 
 EXPORT_SYMBOL_GPL (blocking_notifier_call_chain)
 
int raw_notifier_chain_register (struct raw_notifier_head *nh, struct notifier_block *n)
 
 EXPORT_SYMBOL_GPL (raw_notifier_chain_register)
 
int raw_notifier_chain_unregister (struct raw_notifier_head *nh, struct notifier_block *n)
 
 EXPORT_SYMBOL_GPL (raw_notifier_chain_unregister)
 
int __raw_notifier_call_chain (struct raw_notifier_head *nh, unsigned long val, void *v, int nr_to_call, int *nr_calls)
 
 EXPORT_SYMBOL_GPL (__raw_notifier_call_chain)
 
int raw_notifier_call_chain (struct raw_notifier_head *nh, unsigned long val, void *v)
 
 EXPORT_SYMBOL_GPL (raw_notifier_call_chain)
 
int srcu_notifier_chain_register (struct srcu_notifier_head *nh, struct notifier_block *n)
 
 EXPORT_SYMBOL_GPL (srcu_notifier_chain_register)
 
int srcu_notifier_chain_unregister (struct srcu_notifier_head *nh, struct notifier_block *n)
 
 EXPORT_SYMBOL_GPL (srcu_notifier_chain_unregister)
 
int __srcu_notifier_call_chain (struct srcu_notifier_head *nh, unsigned long val, void *v, int nr_to_call, int *nr_calls)
 
 EXPORT_SYMBOL_GPL (__srcu_notifier_call_chain)
 
int srcu_notifier_call_chain (struct srcu_notifier_head *nh, unsigned long val, void *v)
 
 EXPORT_SYMBOL_GPL (srcu_notifier_call_chain)
 
void srcu_init_notifier_head (struct srcu_notifier_head *nh)
 
 EXPORT_SYMBOL_GPL (srcu_init_notifier_head)
 
int notrace __kprobes notify_die (enum die_val val, const char *str, struct pt_regs *regs, long err, int trap, int sig)
 
int register_die_notifier (struct notifier_block *nb)
 
 EXPORT_SYMBOL_GPL (register_die_notifier)
 
int unregister_die_notifier (struct notifier_block *nb)
 
 EXPORT_SYMBOL_GPL (unregister_die_notifier)
 

Function Documentation

int __kprobes __atomic_notifier_call_chain ( struct atomic_notifier_head nh,
unsigned long  val,
void v,
int  nr_to_call,
int nr_calls 
)

__atomic_notifier_call_chain - Call functions in an atomic notifier chain : Pointer to head of the atomic notifier chain : Value passed unmodified to notifier function : Pointer passed unmodified to notifier function : See the comment for notifier_call_chain. : See the comment for notifier_call_chain.

Calls each function in a notifier chain in turn. The functions run in an atomic context, so they must not block. This routine uses RCU to synchronize with changes to the chain.

If the return value of the notifier can be and'ed with NOTIFY_STOP_MASK then atomic_notifier_call_chain() will return immediately, with the return value of the notifier function which halted execution. Otherwise the return value is the return value of the last notifier function called.

Definition at line 175 of file notifier.c.

int __blocking_notifier_call_chain ( struct blocking_notifier_head nh,
unsigned long  val,
void v,
int  nr_to_call,
int nr_calls 
)

__blocking_notifier_call_chain - Call functions in a blocking notifier chain : Pointer to head of the blocking notifier chain : Value passed unmodified to notifier function : Pointer passed unmodified to notifier function : See comment for notifier_call_chain. : See comment for notifier_call_chain.

Calls each function in a notifier chain in turn. The functions run in a process context, so they are allowed to block.

If the return value of the notifier can be and'ed with NOTIFY_STOP_MASK then blocking_notifier_call_chain() will return immediately, with the return value of the notifier function which halted execution. Otherwise the return value is the return value of the last notifier function called.

Definition at line 301 of file notifier.c.

int __raw_notifier_call_chain ( struct raw_notifier_head nh,
unsigned long  val,
void v,
int  nr_to_call,
int nr_calls 
)

__raw_notifier_call_chain - Call functions in a raw notifier chain : Pointer to head of the raw notifier chain : Value passed unmodified to notifier function : Pointer passed unmodified to notifier function : See comment for notifier_call_chain. : See comment for notifier_call_chain

Calls each function in a notifier chain in turn. The functions run in an undefined context. All locking must be provided by the caller.

If the return value of the notifier can be and'ed with NOTIFY_STOP_MASK then raw_notifier_call_chain() will return immediately, with the return value of the notifier function which halted execution. Otherwise the return value is the return value of the last notifier function called.

Definition at line 387 of file notifier.c.

int __srcu_notifier_call_chain ( struct srcu_notifier_head nh,
unsigned long  val,
void v,
int  nr_to_call,
int nr_calls 
)

__srcu_notifier_call_chain - Call functions in an SRCU notifier chain : Pointer to head of the SRCU notifier chain : Value passed unmodified to notifier function : Pointer passed unmodified to notifier function : See comment for notifier_call_chain. : See comment for notifier_call_chain

Calls each function in a notifier chain in turn. The functions run in a process context, so they are allowed to block.

If the return value of the notifier can be and'ed with NOTIFY_STOP_MASK then srcu_notifier_call_chain() will return immediately, with the return value of the notifier function which halted execution. Otherwise the return value is the return value of the last notifier function called.

Definition at line 486 of file notifier.c.

int __kprobes atomic_notifier_call_chain ( struct atomic_notifier_head nh,
unsigned long  val,
void v 
)

Definition at line 188 of file notifier.c.

int atomic_notifier_chain_register ( struct atomic_notifier_head nh,
struct notifier_block n 
)

atomic_notifier_chain_register - Add notifier to an atomic notifier chain : Pointer to head of the atomic notifier chain
: New entry in notifier chain

Adds a notifier to an atomic notifier chain.

Currently always returns zero.

Definition at line 120 of file notifier.c.

int atomic_notifier_chain_unregister ( struct atomic_notifier_head nh,
struct notifier_block n 
)

atomic_notifier_chain_unregister - Remove notifier from an atomic notifier chain : Pointer to head of the atomic notifier chain
: Entry to remove from notifier chain

Removes a notifier from an atomic notifier chain.

Returns zero on success or %-ENOENT on failure.

Definition at line 142 of file notifier.c.

int blocking_notifier_call_chain ( struct blocking_notifier_head nh,
unsigned long  val,
void v 
)

Definition at line 322 of file notifier.c.

int blocking_notifier_chain_cond_register ( struct blocking_notifier_head nh,
struct notifier_block n 
)

blocking_notifier_chain_cond_register - Cond add notifier to a blocking notifier chain : Pointer to head of the blocking notifier chain
: New entry in notifier chain

Adds a notifier to a blocking notifier chain, only if not already present in the chain. Must be called in process context.

Currently always returns zero.

Definition at line 241 of file notifier.c.

int blocking_notifier_chain_register ( struct blocking_notifier_head nh,
struct notifier_block n 
)

blocking_notifier_chain_register - Add notifier to a blocking notifier chain : Pointer to head of the blocking notifier chain
: New entry in notifier chain

Adds a notifier to a blocking notifier chain. Must be called in process context.

Currently always returns zero.

Definition at line 210 of file notifier.c.

int blocking_notifier_chain_unregister ( struct blocking_notifier_head nh,
struct notifier_block n 
)

blocking_notifier_chain_unregister - Remove notifier from a blocking notifier chain : Pointer to head of the blocking notifier chain
: Entry to remove from notifier chain

Removes a notifier from a blocking notifier chain. Must be called from process context.

Returns zero on success or %-ENOENT on failure.

Definition at line 263 of file notifier.c.

BLOCKING_NOTIFIER_HEAD ( reboot_notifier_list  )
EXPORT_SYMBOL_GPL ( atomic_notifier_chain_register  )
EXPORT_SYMBOL_GPL ( atomic_notifier_chain_unregister  )
EXPORT_SYMBOL_GPL ( __atomic_notifier_call_chain  )
EXPORT_SYMBOL_GPL ( atomic_notifier_call_chain  )
EXPORT_SYMBOL_GPL ( blocking_notifier_chain_register  )
EXPORT_SYMBOL_GPL ( blocking_notifier_chain_cond_register  )
EXPORT_SYMBOL_GPL ( blocking_notifier_chain_unregister  )
EXPORT_SYMBOL_GPL ( __blocking_notifier_call_chain  )
EXPORT_SYMBOL_GPL ( blocking_notifier_call_chain  )
EXPORT_SYMBOL_GPL ( raw_notifier_chain_register  )
EXPORT_SYMBOL_GPL ( raw_notifier_chain_unregister  )
EXPORT_SYMBOL_GPL ( __raw_notifier_call_chain  )
EXPORT_SYMBOL_GPL ( raw_notifier_call_chain  )
EXPORT_SYMBOL_GPL ( srcu_notifier_chain_register  )
EXPORT_SYMBOL_GPL ( srcu_notifier_chain_unregister  )
EXPORT_SYMBOL_GPL ( __srcu_notifier_call_chain  )
EXPORT_SYMBOL_GPL ( srcu_notifier_call_chain  )
EXPORT_SYMBOL_GPL ( srcu_init_notifier_head  )
EXPORT_SYMBOL_GPL ( register_die_notifier  )
EXPORT_SYMBOL_GPL ( unregister_die_notifier  )
int notrace __kprobes notify_die ( enum die_val  val,
const char str,
struct pt_regs regs,
long  err,
int  trap,
int  sig 
)

Definition at line 530 of file notifier.c.

int raw_notifier_call_chain ( struct raw_notifier_head nh,
unsigned long  val,
void v 
)

Definition at line 395 of file notifier.c.

int raw_notifier_chain_register ( struct raw_notifier_head nh,
struct notifier_block n 
)

raw_notifier_chain_register - Add notifier to a raw notifier chain : Pointer to head of the raw notifier chain
: New entry in notifier chain

Adds a notifier to a raw notifier chain. All locking must be provided by the caller.

Currently always returns zero.

Definition at line 344 of file notifier.c.

int raw_notifier_chain_unregister ( struct raw_notifier_head nh,
struct notifier_block n 
)

raw_notifier_chain_unregister - Remove notifier from a raw notifier chain : Pointer to head of the raw notifier chain
: Entry to remove from notifier chain

Removes a notifier from a raw notifier chain. All locking must be provided by the caller.

Returns zero on success or %-ENOENT on failure.

Definition at line 361 of file notifier.c.

int register_die_notifier ( struct notifier_block nb)

Definition at line 544 of file notifier.c.

void srcu_init_notifier_head ( struct srcu_notifier_head nh)

srcu_init_notifier_head - Initialize an SRCU notifier head : Pointer to head of the srcu notifier chain

Unlike other sorts of notifier heads, SRCU notifier heads require dynamic initialization. Be sure to call this routine before calling any of the other SRCU notifier routines for this head.

If an SRCU notifier head is deallocated, it must first be cleaned up by calling srcu_cleanup_notifier_head(). Otherwise the head's per-cpu data (used by the SRCU mechanism) will leak.

Definition at line 519 of file notifier.c.

int srcu_notifier_call_chain ( struct srcu_notifier_head nh,
unsigned long  val,
void v 
)

Definition at line 500 of file notifier.c.

int srcu_notifier_chain_register ( struct srcu_notifier_head nh,
struct notifier_block n 
)

srcu_notifier_chain_register - Add notifier to an SRCU notifier chain : Pointer to head of the SRCU notifier chain
: New entry in notifier chain

Adds a notifier to an SRCU notifier chain. Must be called in process context.

Currently always returns zero.

Definition at line 417 of file notifier.c.

int srcu_notifier_chain_unregister ( struct srcu_notifier_head nh,
struct notifier_block n 
)

srcu_notifier_chain_unregister - Remove notifier from an SRCU notifier chain : Pointer to head of the SRCU notifier chain
: Entry to remove from notifier chain

Removes a notifier from an SRCU notifier chain. Must be called from process context.

Returns zero on success or %-ENOENT on failure.

Definition at line 447 of file notifier.c.

int unregister_die_notifier ( struct notifier_block nb)

Definition at line 551 of file notifier.c.