Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
internal.h File Reference
#include <linux/fscache-cache.h>
#include <linux/timer.h>
#include <linux/wait.h>
#include <linux/workqueue.h>
#include <linux/security.h>

Go to the source code of this file.

Data Structures

struct  cachefiles_object
 
struct  cachefiles_cache
 
struct  cachefiles_one_read
 
struct  cachefiles_one_write
 
struct  cachefiles_xattr
 

Macros

#define CACHEFILES_DEBUG_KENTER   1
 
#define CACHEFILES_DEBUG_KLEAVE   2
 
#define CACHEFILES_DEBUG_KDEBUG   4
 
#define CACHEFILES_OBJECT_ACTIVE   0 /* T if marked active */
 
#define CACHEFILES_OBJECT_BURIED   1 /* T if preemptively buried */
 
#define CACHEFILES_READY   0 /* T if cache prepared */
 
#define CACHEFILES_DEAD   1 /* T if cache dead */
 
#define CACHEFILES_CULLING   2 /* T if cull engaged */
 
#define CACHEFILES_STATE_CHANGED   3 /* T if state changed (poll trigger) */
 
#define cachefiles_proc_init()   (0)
 
#define cachefiles_proc_cleanup()   do {} while (0)
 
#define cachefiles_hist(hist, start_jif)   do {} while (0)
 
#define kerror(FMT,...)   printk(KERN_ERR "CacheFiles: "FMT"\n", ##__VA_ARGS__)
 
#define cachefiles_io_error(___cache, FMT,...)
 
#define cachefiles_io_error_obj(object, FMT,...)
 
#define dbgprintk(FMT,...)   printk(KERN_DEBUG "[%-6.6s] "FMT"\n", current->comm, ##__VA_ARGS__)
 
#define kenter(FMT,...)   dbgprintk("==> %s("FMT")", __func__, ##__VA_ARGS__)
 
#define kleave(FMT,...)   dbgprintk("<== %s()"FMT"", __func__, ##__VA_ARGS__)
 
#define kdebug(FMT,...)   dbgprintk(FMT, ##__VA_ARGS__)
 
#define _enter(FMT,...)   no_printk("==> %s("FMT")", __func__, ##__VA_ARGS__)
 
#define _leave(FMT,...)   no_printk("<== %s()"FMT"", __func__, ##__VA_ARGS__)
 
#define _debug(FMT,...)   no_printk(FMT, ##__VA_ARGS__)
 
#define ASSERT(X)
 
#define ASSERTCMP(X, OP, Y)
 
#define ASSERTIF(C, X)
 
#define ASSERTIFCMP(C, X, OP, Y)
 

Functions

int cachefiles_daemon_bind (struct cachefiles_cache *cache, char *args)
 
void cachefiles_daemon_unbind (struct cachefiles_cache *cache)
 
int cachefiles_has_space (struct cachefiles_cache *cache, unsigned fnr, unsigned bnr)
 
charcachefiles_cook_key (const u8 *raw, int keylen, uint8_t type)
 
int cachefiles_delete_object (struct cachefiles_cache *cache, struct cachefiles_object *object)
 
int cachefiles_walk_to_object (struct cachefiles_object *parent, struct cachefiles_object *object, const char *key, struct cachefiles_xattr *auxdata)
 
struct dentrycachefiles_get_directory (struct cachefiles_cache *cache, struct dentry *dir, const char *name)
 
int cachefiles_cull (struct cachefiles_cache *cache, struct dentry *dir, char *filename)
 
int cachefiles_check_in_use (struct cachefiles_cache *cache, struct dentry *dir, char *filename)
 
int cachefiles_read_or_alloc_page (struct fscache_retrieval *, struct page *, gfp_t)
 
int cachefiles_read_or_alloc_pages (struct fscache_retrieval *, struct list_head *, unsigned *, gfp_t)
 
int cachefiles_allocate_page (struct fscache_retrieval *, struct page *, gfp_t)
 
int cachefiles_allocate_pages (struct fscache_retrieval *, struct list_head *, unsigned *, gfp_t)
 
int cachefiles_write_page (struct fscache_storage *, struct page *)
 
void cachefiles_uncache_page (struct fscache_object *, struct page *)
 
int cachefiles_get_security_ID (struct cachefiles_cache *cache)
 
int cachefiles_determine_cache_security (struct cachefiles_cache *cache, struct dentry *root, const struct cred **_saved_cred)
 
int cachefiles_check_object_type (struct cachefiles_object *object)
 
int cachefiles_set_object_xattr (struct cachefiles_object *object, struct cachefiles_xattr *auxdata)
 
int cachefiles_update_object_xattr (struct cachefiles_object *object, struct cachefiles_xattr *auxdata)
 
int cachefiles_check_object_xattr (struct cachefiles_object *object, struct cachefiles_xattr *auxdata)
 
int cachefiles_remove_object_xattr (struct cachefiles_cache *cache, struct dentry *dentry)
 

Variables

unsigned cachefiles_debug
 
struct kmem_cachecachefiles_object_jar
 
struct file_operations cachefiles_daemon_fops
 
struct fscache_cache_ops cachefiles_cache_ops
 

Macro Definition Documentation

#define _debug (   FMT,
  ... 
)    no_printk(FMT, ##__VA_ARGS__)

Definition at line 302 of file internal.h.

#define _enter (   FMT,
  ... 
)    no_printk("==> %s("FMT")", __func__, ##__VA_ARGS__)

Definition at line 300 of file internal.h.

#define _leave (   FMT,
  ... 
)    no_printk("<== %s()"FMT"", __func__, ##__VA_ARGS__)

Definition at line 301 of file internal.h.

#define ASSERT (   X)
Value:
do { \
if (unlikely(!(X))) { \
printk(KERN_ERR "\n"); \
printk(KERN_ERR "CacheFiles: Assertion failed\n"); \
BUG(); \
} \
} while (0)

Definition at line 307 of file internal.h.

#define ASSERTCMP (   X,
  OP,
 
)
Value:
do { \
if (unlikely(!((X) OP (Y)))) { \
printk(KERN_ERR "\n"); \
printk(KERN_ERR "CacheFiles: Assertion failed\n"); \
printk(KERN_ERR "%lx " #OP " %lx is false\n", \
(unsigned long)(X), (unsigned long)(Y)); \
BUG(); \
} \
} while (0)

Definition at line 316 of file internal.h.

#define ASSERTIF (   C,
  X 
)
Value:
do { \
if (unlikely((C) && !(X))) { \
printk(KERN_ERR "\n"); \
printk(KERN_ERR "CacheFiles: Assertion failed\n"); \
BUG(); \
} \
} while (0)

Definition at line 327 of file internal.h.

#define ASSERTIFCMP (   C,
  X,
  OP,
 
)
Value:
do { \
if (unlikely((C) && !((X) OP (Y)))) { \
printk(KERN_ERR "\n"); \
printk(KERN_ERR "CacheFiles: Assertion failed\n"); \
printk(KERN_ERR "%lx " #OP " %lx is false\n", \
(unsigned long)(X), (unsigned long)(Y)); \
BUG(); \
} \
} while (0)

Definition at line 336 of file internal.h.

#define CACHEFILES_CULLING   2 /* T if cull engaged */

Definition at line 78 of file internal.h.

#define CACHEFILES_DEAD   1 /* T if cache dead */

Definition at line 77 of file internal.h.

#define CACHEFILES_DEBUG_KDEBUG   4

Definition at line 24 of file internal.h.

#define CACHEFILES_DEBUG_KENTER   1

Definition at line 22 of file internal.h.

#define CACHEFILES_DEBUG_KLEAVE   2

Definition at line 23 of file internal.h.

#define cachefiles_hist (   hist,
  start_jif 
)    do {} while (0)

Definition at line 190 of file internal.h.

#define cachefiles_io_error (   ___cache,
  FMT,
  ... 
)
Value:
do { \
kerror("I/O Error: " FMT, ##__VA_ARGS__); \
fscache_io_error(&(___cache)->cache); \
set_bit(CACHEFILES_DEAD, &(___cache)->flags); \
} while (0)

Definition at line 247 of file internal.h.

#define cachefiles_io_error_obj (   object,
  FMT,
  ... 
)
Value:
do { \
\
___cache = container_of((object)->fscache.cache, \
struct cachefiles_cache, cache); \
cachefiles_io_error(___cache, FMT, ##__VA_ARGS__); \
} while (0)

Definition at line 254 of file internal.h.

#define CACHEFILES_OBJECT_ACTIVE   0 /* T if marked active */

Definition at line 36 of file internal.h.

#define CACHEFILES_OBJECT_BURIED   1 /* T if preemptively buried */

Definition at line 37 of file internal.h.

#define cachefiles_proc_cleanup (   void)    do {} while (0)

Definition at line 189 of file internal.h.

#define cachefiles_proc_init (   void)    (0)

Definition at line 188 of file internal.h.

#define CACHEFILES_READY   0 /* T if cache prepared */

Definition at line 76 of file internal.h.

#define CACHEFILES_STATE_CHANGED   3 /* T if state changed (poll trigger) */

Definition at line 79 of file internal.h.

#define dbgprintk (   FMT,
  ... 
)    printk(KERN_DEBUG "[%-6.6s] "FMT"\n", current->comm, ##__VA_ARGS__)

Definition at line 267 of file internal.h.

#define kdebug (   FMT,
  ... 
)    dbgprintk(FMT, ##__VA_ARGS__)

Definition at line 272 of file internal.h.

#define kenter (   FMT,
  ... 
)    dbgprintk("==> %s("FMT")", __func__, ##__VA_ARGS__)

Definition at line 270 of file internal.h.

#define kerror (   FMT,
  ... 
)    printk(KERN_ERR "CacheFiles: "FMT"\n", ##__VA_ARGS__)

Definition at line 245 of file internal.h.

#define kleave (   FMT,
  ... 
)    dbgprintk("<== %s()"FMT"", __func__, ##__VA_ARGS__)

Definition at line 271 of file internal.h.

Function Documentation

int cachefiles_allocate_page ( struct fscache_retrieval ,
struct page ,
gfp_t   
)

Definition at line 803 of file rdwr.c.

int cachefiles_allocate_pages ( struct fscache_retrieval ,
struct list_head ,
unsigned *  ,
gfp_t   
)

Definition at line 843 of file rdwr.c.

int cachefiles_check_in_use ( struct cachefiles_cache cache,
struct dentry dir,
char filename 
)

Definition at line 973 of file namei.c.

int cachefiles_check_object_type ( struct cachefiles_object object)

Definition at line 29 of file xattr.c.

int cachefiles_check_object_xattr ( struct cachefiles_object object,
struct cachefiles_xattr auxdata 
)

Definition at line 165 of file xattr.c.

char* cachefiles_cook_key ( const u8 raw,
int  keylen,
uint8_t  type 
)

Definition at line 37 of file key.c.

int cachefiles_cull ( struct cachefiles_cache cache,
struct dentry dir,
char filename 
)

Definition at line 913 of file namei.c.

int cachefiles_daemon_bind ( struct cachefiles_cache cache,
char args 
)

Definition at line 30 of file bind.c.

void cachefiles_daemon_unbind ( struct cachefiles_cache cache)

Definition at line 261 of file bind.c.

int cachefiles_delete_object ( struct cachefiles_cache cache,
struct cachefiles_object object 
)

Definition at line 418 of file namei.c.

int cachefiles_determine_cache_security ( struct cachefiles_cache cache,
struct dentry root,
const struct cred **  _saved_cred 
)

Definition at line 83 of file security.c.

struct dentry* cachefiles_get_directory ( struct cachefiles_cache cache,
struct dentry dir,
const char name 
)
read

Definition at line 720 of file namei.c.

int cachefiles_get_security_ID ( struct cachefiles_cache cache)

Definition at line 20 of file security.c.

int cachefiles_has_space ( struct cachefiles_cache cache,
unsigned  fnr,
unsigned  bnr 
)

Definition at line 675 of file daemon.c.

int cachefiles_read_or_alloc_page ( struct fscache_retrieval ,
struct page ,
gfp_t   
)

Definition at line 391 of file rdwr.c.

int cachefiles_read_or_alloc_pages ( struct fscache_retrieval ,
struct list_head ,
unsigned *  ,
gfp_t   
)

Definition at line 688 of file rdwr.c.

int cachefiles_remove_object_xattr ( struct cachefiles_cache cache,
struct dentry dentry 
)

Definition at line 274 of file xattr.c.

int cachefiles_set_object_xattr ( struct cachefiles_object object,
struct cachefiles_xattr auxdata 
)

Definition at line 106 of file xattr.c.

void cachefiles_uncache_page ( struct fscache_object ,
struct page  
)

Definition at line 972 of file rdwr.c.

int cachefiles_update_object_xattr ( struct cachefiles_object object,
struct cachefiles_xattr auxdata 
)

Definition at line 135 of file xattr.c.

int cachefiles_walk_to_object ( struct cachefiles_object parent,
struct cachefiles_object object,
const char key,
struct cachefiles_xattr auxdata 
)

Definition at line 464 of file namei.c.

int cachefiles_write_page ( struct fscache_storage ,
struct page  
)

Definition at line 888 of file rdwr.c.

Variable Documentation

struct fscache_cache_ops cachefiles_cache_ops

Definition at line 451 of file interface.c.

struct file_operations cachefiles_daemon_fops

Definition at line 51 of file daemon.c.

unsigned cachefiles_debug

Definition at line 27 of file main.c.

struct kmem_cache* cachefiles_object_jar

Definition at line 35 of file main.c.