Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
segment.h File Reference
#include <linux/types.h>
#include <linux/fs.h>
#include <linux/buffer_head.h>
#include <linux/nilfs2_fs.h>
#include "nilfs.h"

Go to the source code of this file.

Data Structures

struct  nilfs_recovery_info
 
struct  nilfs_cstage
 
struct  nilfs_segsum_pointer
 
struct  nilfs_sc_info
 

Macros

#define NILFS_RECOVERY_SR_UPDATED   1 /* The super root was updated */
 
#define NILFS_RECOVERY_ROLLFORWARD_DONE   2 /* Rollforward was carried out */
 
#define NILFS_SEGCTOR_QUIT   0x0001 /* segctord is being destroyed */
 
#define NILFS_SEGCTOR_COMMIT   0x0004 /* committed transaction exists */
 
#define NILFS_SC_CLEANUP_RETRY
 
#define NILFS_SC_DEFAULT_TIMEOUT
 
#define NILFS_SC_DEFAULT_SR_FREQ
 
#define NILFS_SC_DEFAULT_WATERMARK   3600
 

Enumerations

enum  {
  NILFS_SC_DIRTY, NILFS_SC_UNCLOSED, NILFS_SC_SUPER_ROOT, NILFS_SC_PRIOR_FLUSH,
  NILFS_SC_HAVE_DELTA
}
 

Functions

void nilfs_relax_pressure_in_lock (struct super_block *)
 
int nilfs_construct_segment (struct super_block *)
 
int nilfs_construct_dsync_segment (struct super_block *, struct inode *, loff_t, loff_t)
 
void nilfs_flush_segment (struct super_block *, ino_t)
 
int nilfs_clean_segments (struct super_block *, struct nilfs_argv *, void **)
 
int nilfs_attach_log_writer (struct super_block *sb, struct nilfs_root *root)
 
void nilfs_detach_log_writer (struct super_block *sb)
 
int nilfs_read_super_root_block (struct the_nilfs *, sector_t, struct buffer_head **, int)
 
int nilfs_search_super_root (struct the_nilfs *, struct nilfs_recovery_info *)
 
int nilfs_salvage_orphan_logs (struct the_nilfs *nilfs, struct super_block *sb, struct nilfs_recovery_info *ri)
 
void nilfs_dispose_segment_list (struct list_head *)
 

Variables

struct kmem_cachenilfs_transaction_cachep
 

Macro Definition Documentation

#define NILFS_RECOVERY_ROLLFORWARD_DONE   2 /* Rollforward was carried out */

Definition at line 65 of file segment.h.

#define NILFS_RECOVERY_SR_UPDATED   1 /* The super root was updated */

Definition at line 64 of file segment.h.

#define NILFS_SC_CLEANUP_RETRY
Value:
3 /* Retry count of construction when
destroying segctord */

Definition at line 204 of file segment.h.

#define NILFS_SC_DEFAULT_SR_FREQ
Value:
30 /* Maximum frequency of super root
creation */

Definition at line 210 of file segment.h.

#define NILFS_SC_DEFAULT_TIMEOUT
Value:
5 /* Timeout value of dirty blocks.
It triggers construction of a
logical segment with a super root */

Definition at line 209 of file segment.h.

#define NILFS_SC_DEFAULT_WATERMARK   3600

Definition at line 215 of file segment.h.

#define NILFS_SEGCTOR_COMMIT   0x0004 /* committed transaction exists */

Definition at line 199 of file segment.h.

#define NILFS_SEGCTOR_QUIT   0x0001 /* segctord is being destroyed */

Definition at line 198 of file segment.h.

Enumeration Type Documentation

anonymous enum
Enumerator:
NILFS_SC_DIRTY 
NILFS_SC_UNCLOSED 
NILFS_SC_SUPER_ROOT 
NILFS_SC_PRIOR_FLUSH 
NILFS_SC_HAVE_DELTA 

Definition at line 186 of file segment.h.

Function Documentation

int nilfs_attach_log_writer ( struct super_block sb,
struct nilfs_root root 
)

nilfs_attach_log_writer - attach log writer : super block instance : root object of the current filesystem tree

This allocates a log writer object, initializes it, and starts the log writer.

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

%-ENOMEM - Insufficient memory available.

Definition at line 2656 of file segment.c.

int nilfs_clean_segments ( struct super_block ,
struct nilfs_argv ,
void **   
)

Definition at line 2320 of file segment.c.

int nilfs_construct_dsync_segment ( struct super_block sb,
struct inode inode,
loff_t  start,
loff_t  end 
)

nilfs_construct_dsync_segment - construct a data-only logical segment : super block : inode whose data blocks should be written out : start byte offset : end byte offset (inclusive)

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

%-EROFS - Read only filesystem.

%-EIO - I/O error

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

%-ERESTARTSYS - Interrupted.

%-ENOMEM - Insufficient memory available.

Definition at line 2172 of file segment.c.

int nilfs_construct_segment ( struct super_block sb)

nilfs_construct_segment - construct a logical segment : super block

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

%-EROFS - Read only filesystem.

%-EIO - I/O error

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

%-ERESTARTSYS - Interrupted.

%-ENOMEM - Insufficient memory available.

Definition at line 2135 of file segment.c.

void nilfs_detach_log_writer ( struct super_block sb)

nilfs_detach_log_writer - destroy log writer : super block instance

This kills log writer daemon, frees the log writer object, and destroys list of dirty files.

Definition at line 2689 of file segment.c.

void nilfs_dispose_segment_list ( struct list_head )

Definition at line 416 of file recovery.c.

void nilfs_flush_segment ( struct super_block sb,
ino_t  ino 
)

nilfs_flush_segment - trigger a segment construction for resource control : super block : inode number of the file to be flushed out.

Definition at line 2045 of file segment.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.

void nilfs_relax_pressure_in_lock ( struct super_block )

Definition at line 271 of file segment.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.

Variable Documentation

struct kmem_cache* nilfs_transaction_cachep

Definition at line 71 of file super.c.