Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions | Variables
memory.c File Reference
#include <linux/hash.h>
#include <linux/slab.h>
#include "common.h"

Go to the source code of this file.

Functions

void tomoyo_warn_oom (const char *function)
 
bool tomoyo_memory_ok (void *ptr)
 
voidtomoyo_commit_ok (void *data, const unsigned int size)
 
struct tomoyo_grouptomoyo_get_group (struct tomoyo_acl_param *param, const u8 idx)
 

Variables

unsigned int tomoyo_memory_used [TOMOYO_MAX_MEMORY_STAT]
 
unsigned int tomoyo_memory_quota [TOMOYO_MAX_MEMORY_STAT]
 
struct list_head tomoyo_name_list [TOMOYO_MAX_HASH]
 

: The string to store into the permernent memory.

tomoyo_get_name - Allocate permanent memory for string data.

Returns pointer to "struct tomoyo_path_info" on success, NULL otherwise.

struct tomoyo_policy_namespace tomoyo_kernel_namespace
 
struct tomoyo_path_infotomoyo_get_name (const char *name)
 
void __init tomoyo_mm_init (void)
 

Function Documentation

void* tomoyo_commit_ok ( void data,
const unsigned int  size 
)

tomoyo_commit_ok - Check memory quota.

: Data to copy from. : Size in byte.

Returns pointer to allocated memory on success, NULL otherwise. is zero-cleared on success.

Caller holds tomoyo_policy_lock mutex.

Definition at line 72 of file memory.c.

struct tomoyo_group* tomoyo_get_group ( struct tomoyo_acl_param param,
const u8  idx 
)
read

tomoyo_get_group - Allocate memory for "struct tomoyo_path_group"/"struct tomoyo_number_group".

Parameters
Pointer to "struct tomoyo_acl_param". : Index number.

Returns pointer to "struct tomoyo_group" on success, NULL otherwise.

Definition at line 92 of file memory.c.

struct tomoyo_path_info* tomoyo_get_name ( const char name)
read

Definition at line 147 of file memory.c.

bool tomoyo_memory_ok ( void ptr)

tomoyo_memory_ok - Check memory quota.

: Pointer to allocated memory.

Returns true on success, false otherwise.

Returns true if is not NULL and quota not exceeded, false otherwise.

Caller holds tomoyo_policy_lock mutex.

Definition at line 46 of file memory.c.

void __init tomoyo_mm_init ( void  )

tomoyo_mm_init - Initialize mm related code.

Definition at line 190 of file memory.c.

void tomoyo_warn_oom ( const char function)

tomoyo_warn_oom - Print out of memory warning message.

: Function's name.

Definition at line 16 of file memory.c.

Variable Documentation

struct tomoyo_policy_namespace tomoyo_kernel_namespace

Definition at line 185 of file memory.c.

unsigned int tomoyo_memory_quota[TOMOYO_MAX_MEMORY_STAT]

Definition at line 33 of file memory.c.

unsigned int tomoyo_memory_used[TOMOYO_MAX_MEMORY_STAT]

Definition at line 31 of file memory.c.

struct list_head tomoyo_name_list[TOMOYO_MAX_HASH]

Definition at line 138 of file memory.c.