Linux Kernel
3.7.1
|
#include <linux/types.h>
#include <linux/fs.h>
#include <linux/buffer_head.h>
#include <linux/nilfs2_fs.h>
#include "alloc.h"
#include "dat.h"
Go to the source code of this file.
Data Structures | |
union | nilfs_bmap_ptr_req |
struct | nilfs_bmap_stats |
struct | nilfs_bmap_operations |
struct | nilfs_bmap |
struct | nilfs_bmap_store |
Macros | |
#define | NILFS_BMAP_INVALID_PTR 0 |
#define | nilfs_bmap_keydiff_abs(diff) ((diff) < 0 ? -(diff) : (diff)) |
#define | NILFS_BMAP_SIZE (NILFS_INODE_BMAP_SIZE * sizeof(__le64)) |
#define | NILFS_BMAP_KEY_BIT (sizeof(unsigned long) * 8 /* CHAR_BIT */) |
#define | NILFS_BMAP_NEW_PTR_INIT (1UL << (sizeof(unsigned long) * 8 /* CHAR_BIT */ - 1)) |
#define | NILFS_BMAP_PTR_P 0 /* physical block number (i.e. LBN) */ |
#define | NILFS_BMAP_PTR_VS |
#define | NILFS_BMAP_PTR_VM |
#define | NILFS_BMAP_PTR_U (-1) /* never perform pointer operations */ |
#define | NILFS_BMAP_USE_VBN(bmap) ((bmap)->b_ptr_type > 0) |
#define | NILFS_BMAP_DIRTY 0x00000001 |
#define | NILFS_BMAP_LARGE 0x1 |
#define | NILFS_BMAP_SMALL_LOW NILFS_DIRECT_KEY_MIN |
#define | NILFS_BMAP_SMALL_HIGH NILFS_DIRECT_KEY_MAX |
#define | NILFS_BMAP_LARGE_LOW NILFS_BTREE_ROOT_NCHILDREN_MAX |
#define | NILFS_BMAP_LARGE_HIGH NILFS_BTREE_KEY_MAX |
#define nilfs_bmap_keydiff_abs | ( | diff | ) | ((diff) < 0 ? -(diff) : (diff)) |
#define NILFS_BMAP_LARGE_HIGH NILFS_BTREE_KEY_MAX |
#define NILFS_BMAP_LARGE_LOW NILFS_BTREE_ROOT_NCHILDREN_MAX |
#define NILFS_BMAP_NEW_PTR_INIT (1UL << (sizeof(unsigned long) * 8 /* CHAR_BIT */ - 1)) |
#define NILFS_BMAP_PTR_U (-1) /* never perform pointer operations */ |
#define NILFS_BMAP_PTR_VM |
#define NILFS_BMAP_PTR_VS |
#define NILFS_BMAP_SIZE (NILFS_INODE_BMAP_SIZE * sizeof(__le64)) |
#define NILFS_BMAP_SMALL_HIGH NILFS_DIRECT_KEY_MAX |
#define NILFS_BMAP_SMALL_LOW NILFS_DIRECT_KEY_MIN |
int nilfs_bmap_assign | ( | struct nilfs_bmap * | bmap, |
struct buffer_head ** | bh, | ||
unsigned long | blocknr, | ||
union nilfs_binfo * | binfo | ||
) |
nilfs_bmap_assign - assign a new block number to a block : bmap : pointer to buffer head : block number : block information
Description: nilfs_bmap_assign() assigns the block number to the buffer specified by .
Return Value: On success, 0 is returned and the buffer head of a newly create buffer and the block information associated with the buffer are stored in the place pointed by and , respectively. On error, one of the following negative error codes is returned.
%-EIO - I/O error.
%-ENOMEM - Insufficient amount of memory available.
void nilfs_bmap_clear | ( | struct nilfs_bmap * | bmap | ) |
nilfs_bmap_clear - free resources a bmap holds : bmap
Description: nilfs_bmap_clear() frees resources associated with .
int nilfs_bmap_delete | ( | struct nilfs_bmap * | bmap, |
unsigned long | key | ||
) |
nilfs_bmap_delete - delete a key-record pair from a bmap : bmap : key
Description: nilfs_bmap_delete() deletes the key-record pair specified by from .
Return Value: On success, 0 is returned. On error, one of the following negative error codes is returned.
%-EIO - I/O error.
%-ENOMEM - Insufficient amount of memory available.
%-ENOENT - A record associated with does not exist.
__u64 nilfs_bmap_find_target_in_group | ( | const struct nilfs_bmap * | ) |
__u64 nilfs_bmap_find_target_seq | ( | const struct nilfs_bmap * | , |
__u64 | |||
) |
|
read |
void nilfs_bmap_init_gc | ( | struct nilfs_bmap * | ) |
int nilfs_bmap_insert | ( | struct nilfs_bmap * | bmap, |
unsigned long | key, | ||
unsigned long | rec | ||
) |
nilfs_bmap_insert - insert a new key-record pair into a bmap : bmap : key : record
Description: nilfs_bmap_insert() inserts the new key-record pair specified by and into .
Return Value: On success, 0 is returned. On error, one of the following negative error codes is returned.
%-EIO - I/O error.
%-ENOMEM - Insufficient amount of memory available.
%-EEXIST - A record associated with already exist.
int nilfs_bmap_last_key | ( | struct nilfs_bmap * | , |
unsigned long * | |||
) |
nilfs_bmap_lookup_at_level - find a data block or node block : bmap : key : level : place to store the value associated to
Description: nilfs_bmap_lookup_at_level() finds a record whose key matches in the block at of the bmap.
Return Value: On success, 0 is returned and the record associated with is stored in the place pointed by . On error, one of the following negative error codes is returned.
%-EIO - I/O error.
%-ENOMEM - Insufficient amount of memory available.
%-ENOENT - A record associated with does not exist.
int nilfs_bmap_lookup_contig | ( | struct nilfs_bmap * | , |
__u64 | , | ||
__u64 * | , | ||
unsigned | |||
) |
void nilfs_bmap_lookup_dirty_buffers | ( | struct nilfs_bmap * | bmap, |
struct list_head * | listp | ||
) |
int nilfs_bmap_mark | ( | struct nilfs_bmap * | bmap, |
__u64 | key, | ||
int | level | ||
) |
nilfs_bmap_mark - mark block dirty : bmap : key : level
Description: nilfs_bmap_mark() marks the block specified by and as dirty.
Return Value: On success, 0 is returned. On error, one of the following negative error codes is returned.
%-EIO - I/O error.
%-ENOMEM - Insufficient amount of memory available.
int nilfs_bmap_propagate | ( | struct nilfs_bmap * | bmap, |
struct buffer_head * | bh | ||
) |
nilfs_bmap_propagate - propagate dirty state : bmap : buffer head
Description: nilfs_bmap_propagate() marks the buffers that directly or indirectly refer to the block specified by dirty.
Return Value: On success, 0 is returned. On error, one of the following negative error codes is returned.
%-EIO - I/O error.
%-ENOMEM - Insufficient amount of memory available.
int nilfs_bmap_read | ( | struct nilfs_bmap * | bmap, |
struct nilfs_inode * | raw_inode | ||
) |
nilfs_bmap_read - read a bmap from an inode : bmap : on-disk inode
Description: nilfs_bmap_read() initializes the bmap .
Return Value: On success, 0 is returned. On error, the following negative error code is returned.
%-ENOMEM - Insufficient amount of memory available.
void nilfs_bmap_restore | ( | struct nilfs_bmap * | , |
const struct nilfs_bmap_store * | |||
) |
void nilfs_bmap_save | ( | const struct nilfs_bmap * | , |
struct nilfs_bmap_store * | |||
) |
int nilfs_bmap_test_and_clear_dirty | ( | struct nilfs_bmap * | bmap | ) |
int nilfs_bmap_truncate | ( | struct nilfs_bmap * | bmap, |
unsigned long | key | ||
) |
nilfs_bmap_truncate - truncate a bmap to a specified key : bmap : key
Description: nilfs_bmap_truncate() removes key-record pairs whose keys are greater than or equal to from .
Return Value: On success, 0 is returned. On error, one of the following negative error codes is returned.
%-EIO - I/O error.
%-ENOMEM - Insufficient amount of memory available.
void nilfs_bmap_write | ( | struct nilfs_bmap * | bmap, |
struct nilfs_inode * | raw_inode | ||
) |
nilfs_bmap_write - write back a bmap to an inode : bmap : on-disk inode
Description: nilfs_bmap_write() stores in .