Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
extent_map.c File Reference
#include <linux/err.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/spinlock.h>
#include <linux/hardirq.h>
#include "ctree.h"
#include "extent_map.h"

Go to the source code of this file.

Functions

int __init extent_map_init (void)
 
void extent_map_exit (void)
 
void extent_map_tree_init (struct extent_map_tree *tree)
 
struct extent_mapalloc_extent_map (void)
 
void free_extent_map (struct extent_map *em)
 
int unpin_extent_cache (struct extent_map_tree *tree, u64 start, u64 len, u64 gen)
 
int add_extent_mapping (struct extent_map_tree *tree, struct extent_map *em)
 
struct extent_map__lookup_extent_mapping (struct extent_map_tree *tree, u64 start, u64 len, int strict)
 
struct extent_maplookup_extent_mapping (struct extent_map_tree *tree, u64 start, u64 len)
 
struct extent_mapsearch_extent_mapping (struct extent_map_tree *tree, u64 start, u64 len)
 
int remove_extent_mapping (struct extent_map_tree *tree, struct extent_map *em)
 

Function Documentation

struct extent_map* __lookup_extent_mapping ( struct extent_map_tree tree,
u64  start,
u64  len,
int  strict 
)
read

Definition at line 334 of file extent_map.c.

int add_extent_mapping ( struct extent_map_tree tree,
struct extent_map em 
)

add_extent_mapping - add new extent map to the extent tree : tree to insert new map in : map to insert

Insert into or perform a simple forward/backward merge with existing mappings. The extent_map struct passed in will be inserted into the tree directly, with an additional reference taken, or a reference dropped if the merge attempt was successful.

Definition at line 298 of file extent_map.c.

struct extent_map* alloc_extent_map ( void  )
read

alloc_extent_map - allocate new extent map structure

Allocate a new extent_map structure. The new structure is returned with a reference count of one and needs to be freed using free_extent_map()

Definition at line 49 of file extent_map.c.

void extent_map_exit ( void  )

Definition at line 22 of file extent_map.c.

int __init extent_map_init ( void  )

Definition at line 12 of file extent_map.c.

void extent_map_tree_init ( struct extent_map_tree tree)

extent_map_tree_init - initialize extent map tree : tree to initialize

Initialize the extent tree . Should be called for each new inode or other user of the extent_map interface.

Definition at line 35 of file extent_map.c.

void free_extent_map ( struct extent_map em)

free_extent_map - drop reference count of an extent_map : extent map beeing releasead

Drops the reference out on by one and free the structure if the reference count hits zero.

Definition at line 71 of file extent_map.c.

struct extent_map* lookup_extent_mapping ( struct extent_map_tree tree,
u64  start,
u64  len 
)
read

lookup_extent_mapping - lookup extent_map : tree to lookup in : byte offset to start the search : length of the lookup range

Find and return the first extent_map struct in that intersects the [start, len] range. There may be additional objects in the tree that intersect, so check the object returned carefully to make sure that no additional lookups are needed.

Definition at line 373 of file extent_map.c.

int remove_extent_mapping ( struct extent_map_tree tree,
struct extent_map em 
)

remove_extent_mapping - removes an extent_map from the extent tree : extent tree to remove from : extent map beeing removed

Removes from . No reference counts are dropped, and no checks are done to see if the range is in use

Definition at line 404 of file extent_map.c.

struct extent_map* search_extent_mapping ( struct extent_map_tree tree,
u64  start,
u64  len 
)
read

search_extent_mapping - find a nearby extent map : tree to lookup in : byte offset to start the search : length of the lookup range

Find and return the first extent_map struct in that intersects the [start, len] range.

If one can't be found, any nearby extent may be returned

Definition at line 390 of file extent_map.c.

int unpin_extent_cache ( struct extent_map_tree tree,
u64  start,
u64  len,
u64  gen 
)

unpint_extent_cache - unpin an extent from the cache : tree to unpin the extent in : logical offset in the file : length of the extent : generation that this extent has been modified in : if this is set we need to clear the prealloc flag

Called after an extent has been written to disk properly. Set the generation to the generation that actually added the file item to the inode so we know we need to sync this extent when we call fsync().

Definition at line 248 of file extent_map.c.