Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
dat.c File Reference
#include <linux/types.h>
#include <linux/buffer_head.h>
#include <linux/string.h>
#include <linux/errno.h>
#include "nilfs.h"
#include "mdt.h"
#include "alloc.h"
#include "dat.h"

Go to the source code of this file.

Data Structures

struct  nilfs_dat_info
 

Macros

#define NILFS_CNO_MIN   ((__u64)1)
 
#define NILFS_CNO_MAX   (~(__u64)0)
 

Functions

int nilfs_dat_prepare_alloc (struct inode *dat, struct nilfs_palloc_req *req)
 
void nilfs_dat_commit_alloc (struct inode *dat, struct nilfs_palloc_req *req)
 
void nilfs_dat_abort_alloc (struct inode *dat, struct nilfs_palloc_req *req)
 
int nilfs_dat_prepare_start (struct inode *dat, struct nilfs_palloc_req *req)
 
void nilfs_dat_commit_start (struct inode *dat, struct nilfs_palloc_req *req, sector_t blocknr)
 
int nilfs_dat_prepare_end (struct inode *dat, struct nilfs_palloc_req *req)
 
void nilfs_dat_commit_end (struct inode *dat, struct nilfs_palloc_req *req, int dead)
 
void nilfs_dat_abort_end (struct inode *dat, struct nilfs_palloc_req *req)
 
int nilfs_dat_prepare_update (struct inode *dat, struct nilfs_palloc_req *oldreq, struct nilfs_palloc_req *newreq)
 
void nilfs_dat_commit_update (struct inode *dat, struct nilfs_palloc_req *oldreq, struct nilfs_palloc_req *newreq, int dead)
 
void nilfs_dat_abort_update (struct inode *dat, struct nilfs_palloc_req *oldreq, struct nilfs_palloc_req *newreq)
 
int nilfs_dat_mark_dirty (struct inode *dat, __u64 vblocknr)
 
int nilfs_dat_freev (struct inode *dat, __u64 *vblocknrs, size_t nitems)
 
int nilfs_dat_move (struct inode *dat, __u64 vblocknr, sector_t blocknr)
 
int nilfs_dat_translate (struct inode *dat, __u64 vblocknr, sector_t *blocknrp)
 
ssize_t nilfs_dat_get_vinfo (struct inode *dat, void *buf, unsigned visz, size_t nvi)
 
int nilfs_dat_read (struct super_block *sb, size_t entry_size, struct nilfs_inode *raw_inode, struct inode **inodep)
 

Macro Definition Documentation

#define NILFS_CNO_MAX   (~(__u64)0)

Definition at line 34 of file dat.c.

#define NILFS_CNO_MIN   ((__u64)1)

Definition at line 33 of file dat.c.

Function Documentation

void nilfs_dat_abort_alloc ( struct inode dat,
struct nilfs_palloc_req req 
)

Definition at line 106 of file dat.c.

void nilfs_dat_abort_end ( struct inode dat,
struct nilfs_palloc_req req 
)

Definition at line 213 of file dat.c.

void nilfs_dat_abort_update ( struct inode dat,
struct nilfs_palloc_req oldreq,
struct nilfs_palloc_req newreq 
)

Definition at line 255 of file dat.c.

void nilfs_dat_commit_alloc ( struct inode dat,
struct nilfs_palloc_req req 
)

Definition at line 89 of file dat.c.

void nilfs_dat_commit_end ( struct inode dat,
struct nilfs_palloc_req req,
int  dead 
)

Definition at line 187 of file dat.c.

void nilfs_dat_commit_start ( struct inode dat,
struct nilfs_palloc_req req,
sector_t  blocknr 
)

Definition at line 139 of file dat.c.

void nilfs_dat_commit_update ( struct inode dat,
struct nilfs_palloc_req oldreq,
struct nilfs_palloc_req newreq,
int  dead 
)

Definition at line 247 of file dat.c.

int nilfs_dat_freev ( struct inode dat,
__u64 vblocknrs,
size_t  nitems 
)

nilfs_dat_freev - free virtual block numbers : DAT file inode : array of virtual block numbers : number of virtual block numbers

Description: nilfs_dat_freev() frees the virtual block numbers specified by and .

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 - The virtual block number have not been allocated.

Definition at line 307 of file dat.c.

ssize_t nilfs_dat_get_vinfo ( struct inode dat,
void buf,
unsigned  visz,
size_t  nvi 
)

Definition at line 433 of file dat.c.

int nilfs_dat_mark_dirty ( struct inode dat,
__u64  vblocknr 
)

nilfs_dat_mark_dirty - : DAT file inode : virtual block number

Description:

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.

Definition at line 277 of file dat.c.

int nilfs_dat_move ( struct inode dat,
__u64  vblocknr,
sector_t  blocknr 
)

nilfs_dat_move - change a block number : DAT file inode : virtual block number : block number

Description: nilfs_dat_move() changes the block number associated with to .

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.

Definition at line 328 of file dat.c.

int nilfs_dat_prepare_alloc ( struct inode dat,
struct nilfs_palloc_req req 
)

Definition at line 74 of file dat.c.

int nilfs_dat_prepare_end ( struct inode dat,
struct nilfs_palloc_req req 
)

Definition at line 155 of file dat.c.

int nilfs_dat_prepare_start ( struct inode dat,
struct nilfs_palloc_req req 
)

Definition at line 130 of file dat.c.

int nilfs_dat_prepare_update ( struct inode dat,
struct nilfs_palloc_req oldreq,
struct nilfs_palloc_req newreq 
)

Definition at line 232 of file dat.c.

int nilfs_dat_read ( struct super_block sb,
size_t  entry_size,
struct nilfs_inode raw_inode,
struct inode **  inodep 
)

nilfs_dat_read - read or get dat inode : super block instance : size of a dat entry : on-disk dat inode : buffer to store the inode

Definition at line 479 of file dat.c.

int nilfs_dat_translate ( struct inode dat,
__u64  vblocknr,
sector_t blocknrp 
)

nilfs_dat_translate - translate a virtual block number to a block number : DAT file inode : virtual block number : pointer to a block number

Description: nilfs_dat_translate() maps the virtual block number to the corresponding block number.

Return Value: On success, 0 is returned and the block number 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 block number associated with does not exist.

Definition at line 397 of file dat.c.