Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
proportions.h File Reference
#include <linux/percpu_counter.h>
#include <linux/spinlock.h>
#include <linux/mutex.h>

Go to the source code of this file.

Data Structures

struct  prop_global
 
struct  prop_descriptor
 
struct  prop_local_percpu
 
struct  prop_local_single
 

Macros

#define PROP_MAX_SHIFT   (BITS_PER_LONG/2)
 
#define PROP_FRAC_SHIFT   (BITS_PER_LONG - PROP_MAX_SHIFT - 1)
 
#define PROP_FRAC_BASE   (1UL << PROP_FRAC_SHIFT)
 
#define INIT_PROP_LOCAL_SINGLE(name)
 

Functions

int prop_descriptor_init (struct prop_descriptor *pd, int shift)
 
void prop_change_shift (struct prop_descriptor *pd, int new_shift)
 
int prop_local_init_percpu (struct prop_local_percpu *pl)
 
void prop_local_destroy_percpu (struct prop_local_percpu *pl)
 
void __prop_inc_percpu (struct prop_descriptor *pd, struct prop_local_percpu *pl)
 
void prop_fraction_percpu (struct prop_descriptor *pd, struct prop_local_percpu *pl, long *numerator, long *denominator)
 
void __prop_inc_percpu_max (struct prop_descriptor *pd, struct prop_local_percpu *pl, long frac)
 
int prop_local_init_single (struct prop_local_single *pl)
 
void prop_local_destroy_single (struct prop_local_single *pl)
 
void __prop_inc_single (struct prop_descriptor *pd, struct prop_local_single *pl)
 
void prop_fraction_single (struct prop_descriptor *pd, struct prop_local_single *pl, long *numerator, long *denominator)
 

Macro Definition Documentation

#define INIT_PROP_LOCAL_SINGLE (   name)
Value:
{ .lock = __RAW_SPIN_LOCK_UNLOCKED(name.lock), \
}

Definition at line 116 of file proportions.h.

#define PROP_FRAC_BASE   (1UL << PROP_FRAC_SHIFT)

Definition at line 91 of file proportions.h.

#define PROP_FRAC_SHIFT   (BITS_PER_LONG - PROP_MAX_SHIFT - 1)

Definition at line 90 of file proportions.h.

#define PROP_MAX_SHIFT   (BITS_PER_LONG/2)

Definition at line 87 of file proportions.h.

Function Documentation

void __prop_inc_percpu ( struct prop_descriptor pd,
struct prop_local_percpu pl 
)

Definition at line 256 of file proportions.c.

void __prop_inc_percpu_max ( struct prop_descriptor pd,
struct prop_local_percpu pl,
long  frac 
)

Definition at line 270 of file proportions.c.

void __prop_inc_single ( struct prop_descriptor pd,
struct prop_local_single pl 
)

Definition at line 376 of file proportions.c.

void prop_change_shift ( struct prop_descriptor pd,
int  new_shift 
)

Definition at line 105 of file proportions.c.

int prop_descriptor_init ( struct prop_descriptor pd,
int  shift 
)

Definition at line 76 of file proportions.c.

void prop_fraction_percpu ( struct prop_descriptor pd,
struct prop_local_percpu pl,
long numerator,
long denominator 
)

Definition at line 303 of file proportions.c.

void prop_fraction_single ( struct prop_descriptor pd,
struct prop_local_single pl,
long numerator,
long denominator 
)

Definition at line 391 of file proportions.c.

void prop_local_destroy_percpu ( struct prop_local_percpu pl)

Definition at line 199 of file proportions.c.

void prop_local_destroy_single ( struct prop_local_single pl)

Definition at line 334 of file proportions.c.

int prop_local_init_percpu ( struct prop_local_percpu pl)

Definition at line 191 of file proportions.c.

int prop_local_init_single ( struct prop_local_single pl)

Definition at line 325 of file proportions.c.