Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Enumerations | Functions
recovery.c File Reference
#include <linux/buffer_head.h>
#include <linux/blkdev.h>
#include <linux/swap.h>
#include <linux/slab.h>
#include <linux/crc32.h>
#include "nilfs.h"
#include "segment.h"
#include "sufile.h"
#include "page.h"
#include "segbuf.h"

Go to the source code of this file.

Data Structures

struct  nilfs_recovery_block
 
struct  nilfs_segment_entry
 

Enumerations

enum  {
  NILFS_SEG_VALID, NILFS_SEG_NO_SUPER_ROOT, NILFS_SEG_FAIL_IO, NILFS_SEG_FAIL_MAGIC,
  NILFS_SEG_FAIL_SEQ, NILFS_SEG_FAIL_CHECKSUM_SUPER_ROOT, NILFS_SEG_FAIL_CHECKSUM_FULL, NILFS_SEG_FAIL_CONSISTENCY
}
 

Functions

int nilfs_read_super_root_block (struct the_nilfs *nilfs, sector_t sr_block, struct buffer_head **pbh, int check)
 
void nilfs_dispose_segment_list (struct list_head *head)
 
int nilfs_salvage_orphan_logs (struct the_nilfs *nilfs, struct super_block *sb, struct nilfs_recovery_info *ri)
 
int nilfs_search_super_root (struct the_nilfs *nilfs, struct nilfs_recovery_info *ri)
 

Enumeration Type Documentation

anonymous enum
Enumerator:
NILFS_SEG_VALID 
NILFS_SEG_NO_SUPER_ROOT 
NILFS_SEG_FAIL_IO 
NILFS_SEG_FAIL_MAGIC 
NILFS_SEG_FAIL_SEQ 
NILFS_SEG_FAIL_CHECKSUM_SUPER_ROOT 
NILFS_SEG_FAIL_CHECKSUM_FULL 
NILFS_SEG_FAIL_CONSISTENCY 

Definition at line 37 of file recovery.c.

Function Documentation

void nilfs_dispose_segment_list ( struct list_head head)

Definition at line 416 of file recovery.c.

int nilfs_read_super_root_block ( struct the_nilfs nilfs,
sector_t  sr_block,
struct buffer_head **  pbh,
int  check 
)

nilfs_read_super_root_block - read super root block : nilfs object : disk block number of the super root block : address of a buffer_head pointer to return super root buffer : CRC check flag

Definition at line 142 of file recovery.c.

int nilfs_salvage_orphan_logs ( struct the_nilfs nilfs,
struct super_block sb,
struct nilfs_recovery_info ri 
)

nilfs_salvage_orphan_logs - salvage logs written after the latest checkpoint : nilfs object : super block instance : pointer to a nilfs_recovery_info struct to store search results.

Return Value: On success, 0 is returned. On error, one of the following negative error code is returned.

%-EINVAL - Inconsistent filesystem state.

%-EIO - I/O error

%-ENOSPC - No space left on device (only in a panic state).

%-ERESTARTSYS - Interrupted.

%-ENOMEM - Insufficient memory available.

Definition at line 743 of file recovery.c.

int nilfs_search_super_root ( struct the_nilfs nilfs,
struct nilfs_recovery_info ri 
)

nilfs_search_super_root - search the latest valid super root : the_nilfs : pointer to a nilfs_recovery_info struct to store search results.

nilfs_search_super_root() looks for the latest super-root from a partial segment pointed by the superblock. It sets up struct the_nilfs through this search. It fills nilfs_recovery_info (ri) required for recovery.

Return Value: On success, 0 is returned. On error, one of the following negative error code is returned.

%-EINVAL - No valid segment found

%-EIO - I/O error

%-ENOMEM - Insufficient memory available.

Definition at line 812 of file recovery.c.