Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
journal.c File Reference
#include <linux/time.h>
#include <linux/semaphore.h>
#include <linux/vmalloc.h>
#include "reiserfs.h"
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/fcntl.h>
#include <linux/stat.h>
#include <linux/string.h>
#include <linux/buffer_head.h>
#include <linux/workqueue.h>
#include <linux/writeback.h>
#include <linux/blkdev.h>
#include <linux/backing-dev.h>
#include <linux/uaccess.h>
#include <linux/slab.h>

Go to the source code of this file.

Data Structures

struct  buffer_chunk
 

Macros

#define JOURNAL_LIST_ENTRY(h)
 
#define JOURNAL_WORK_ENTRY(h)
 
#define JOURNAL_TRANS_HALF
 
#define BUFNR   64 /*read ahead */
 
#define BLOCK_FREED   2 /* this block was freed, and can't be written. */
 
#define BLOCK_FREED_HOLDER   3 /* this block was freed during this transaction, and can't be written */
 
#define BLOCK_NEEDS_FLUSH   4 /* used in flush_journal_list */
 
#define BLOCK_DIRTIED   5
 
#define LIST_TOUCHED   1
 
#define LIST_DIRTY   2
 
#define LIST_COMMIT_PENDING   4 /* someone will commit this list */
 
#define FLUSH_ALL   1 /* flush commit and real blocks */
 
#define COMMIT_NOW   2 /* end and commit this transaction */
 
#define WAIT   4 /* wait for the log blocks to hit the disk */
 
#define CHUNK_SIZE   32
 
#define JH_ENTRY(l)   list_entry((l), struct reiserfs_jh, list)
 
#define REISERFS_STANDARD_BLKSIZE   (4096)
 

Enumerations

enum  { JBEGIN_REG = 0, JBEGIN_JOIN = 1, JBEGIN_ABORT = 2 }
 

Functions

int reiserfs_allocate_list_bitmaps (struct super_block *sb, struct reiserfs_list_bitmap *jb_array, unsigned int bmap_nr)
 
int reiserfs_in_journal (struct super_block *sb, unsigned int bmap_nr, int bit_nr, int search_all, b_blocknr_t *next_zero_bit)
 
void reiserfs_free_jh (struct buffer_head *bh)
 
int reiserfs_add_tail_list (struct inode *inode, struct buffer_head *bh)
 
int reiserfs_add_ordered_list (struct inode *inode, struct buffer_head *bh)
 
int journal_release (struct reiserfs_transaction_handle *th, struct super_block *sb)
 
int journal_release_error (struct reiserfs_transaction_handle *th, struct super_block *sb)
 
int journal_init (struct super_block *sb, const char *j_dev_name, int old_format, unsigned int commit_max_age)
 
int journal_transaction_should_end (struct reiserfs_transaction_handle *th, int new_alloc)
 
void reiserfs_block_writes (struct reiserfs_transaction_handle *th)
 
void reiserfs_allow_writes (struct super_block *s)
 
void reiserfs_wait_on_write_block (struct super_block *s)
 
struct
reiserfs_transaction_handle
reiserfs_persistent_transaction (struct super_block *s, int nblocks)
 
int reiserfs_end_persistent_transaction (struct reiserfs_transaction_handle *th)
 
int journal_join_abort (struct reiserfs_transaction_handle *th, struct super_block *sb, unsigned long nblocks)
 
int journal_begin (struct reiserfs_transaction_handle *th, struct super_block *sb, unsigned long nblocks)
 
int journal_mark_dirty (struct reiserfs_transaction_handle *th, struct super_block *sb, struct buffer_head *bh)
 
int journal_end (struct reiserfs_transaction_handle *th, struct super_block *sb, unsigned long nblocks)
 
int journal_end_sync (struct reiserfs_transaction_handle *th, struct super_block *sb, unsigned long nblocks)
 
void reiserfs_flush_old_commits (struct super_block *sb)
 
int journal_mark_freed (struct reiserfs_transaction_handle *th, struct super_block *sb, b_blocknr_t blocknr)
 
void reiserfs_update_inode_transaction (struct inode *inode)
 
int reiserfs_commit_for_inode (struct inode *inode)
 
void reiserfs_restore_prepared_buffer (struct super_block *sb, struct buffer_head *bh)
 
int reiserfs_prepare_for_journal (struct super_block *sb, struct buffer_head *bh, int wait)
 
void reiserfs_abort_journal (struct super_block *sb, int errno)
 

Variables

struct tree_balancecur_tb
 

Macro Definition Documentation

#define BLOCK_DIRTIED   5

Definition at line 77 of file journal.c.

#define BLOCK_FREED   2 /* this block was freed, and can't be written. */

Definition at line 73 of file journal.c.

#define BLOCK_FREED_HOLDER   3 /* this block was freed during this transaction, and can't be written */

Definition at line 74 of file journal.c.

#define BLOCK_NEEDS_FLUSH   4 /* used in flush_journal_list */

Definition at line 76 of file journal.c.

#define BUFNR   64 /*read ahead */

Definition at line 69 of file journal.c.

#define CHUNK_SIZE   32

Definition at line 668 of file journal.c.

#define COMMIT_NOW   2 /* end and commit this transaction */

Definition at line 86 of file journal.c.

#define FLUSH_ALL   1 /* flush commit and real blocks */

Definition at line 85 of file journal.c.

#define JH_ENTRY (   l)    list_entry((l), struct reiserfs_jh, list)

Definition at line 788 of file journal.c.

#define JOURNAL_LIST_ENTRY (   h)
Value:
j_list))

Definition at line 56 of file journal.c.

#define JOURNAL_TRANS_HALF
Value:
1018 /* must be correct to keep the desc and commit
structs at 4k */

Definition at line 68 of file journal.c.

#define JOURNAL_WORK_ENTRY (   h)
Value:
j_working_list))

Definition at line 58 of file journal.c.

#define LIST_COMMIT_PENDING   4 /* someone will commit this list */

Definition at line 82 of file journal.c.

#define LIST_DIRTY   2

Definition at line 81 of file journal.c.

#define LIST_TOUCHED   1

Definition at line 80 of file journal.c.

#define REISERFS_STANDARD_BLKSIZE   (4096)

When creating/tuning a file system user can assign some journal params within boundaries which depend on the ratio blocksize/standard_blocksize.

For blocks >= standard_blocksize transaction size should be not less then JOURNAL_TRANS_MIN_DEFAULT, and not more then JOURNAL_TRANS_MAX_DEFAULT.

For blocks < standard_blocksize these boundaries should be decreased proportionally.

Definition at line 2621 of file journal.c.

#define WAIT   4 /* wait for the log blocks to hit the disk */

Definition at line 87 of file journal.c.

Enumeration Type Documentation

anonymous enum
Enumerator:
JBEGIN_REG 
JBEGIN_JOIN 
JBEGIN_ABORT 

Definition at line 107 of file journal.c.

Function Documentation

int journal_begin ( struct reiserfs_transaction_handle th,
struct super_block sb,
unsigned long  nblocks 
)

Definition at line 3165 of file journal.c.

int journal_end ( struct reiserfs_transaction_handle th,
struct super_block sb,
unsigned long  nblocks 
)

Definition at line 3322 of file journal.c.

int journal_end_sync ( struct reiserfs_transaction_handle th,
struct super_block sb,
unsigned long  nblocks 
)

Definition at line 3454 of file journal.c.

int journal_init ( struct super_block sb,
const char j_dev_name,
int  old_format,
unsigned int  commit_max_age 
)

Definition at line 2669 of file journal.c.

int journal_join_abort ( struct reiserfs_transaction_handle th,
struct super_block sb,
unsigned long  nblocks 
)

Definition at line 3152 of file journal.c.

int journal_mark_dirty ( struct reiserfs_transaction_handle th,
struct super_block sb,
struct buffer_head *  bh 
)

Definition at line 3219 of file journal.c.

int journal_mark_freed ( struct reiserfs_transaction_handle th,
struct super_block sb,
b_blocknr_t  blocknr 
)

Definition at line 3657 of file journal.c.

int journal_release ( struct reiserfs_transaction_handle th,
struct super_block sb 
)

Definition at line 1944 of file journal.c.

int journal_release_error ( struct reiserfs_transaction_handle th,
struct super_block sb 
)

Definition at line 1953 of file journal.c.

int journal_transaction_should_end ( struct reiserfs_transaction_handle th,
int  new_alloc 
)

Definition at line 2870 of file journal.c.

void reiserfs_abort_journal ( struct super_block sb,
int  errno 
)

Definition at line 4269 of file journal.c.

int reiserfs_add_ordered_list ( struct inode inode,
struct buffer_head *  bh 
)

Definition at line 783 of file journal.c.

int reiserfs_add_tail_list ( struct inode inode,
struct buffer_head *  bh 
)

Definition at line 779 of file journal.c.

int reiserfs_allocate_list_bitmaps ( struct super_block sb,
struct reiserfs_list_bitmap jb_array,
unsigned int  bmap_nr 
)

Definition at line 280 of file journal.c.

void reiserfs_allow_writes ( struct super_block s)

Definition at line 2905 of file journal.c.

void reiserfs_block_writes ( struct reiserfs_transaction_handle th)

Definition at line 2894 of file journal.c.

int reiserfs_commit_for_inode ( struct inode inode)

Definition at line 3805 of file journal.c.

int reiserfs_end_persistent_transaction ( struct reiserfs_transaction_handle th)

Definition at line 3124 of file journal.c.

void reiserfs_flush_old_commits ( struct super_block sb)

Definition at line 3495 of file journal.c.

void reiserfs_free_jh ( struct buffer_head *  bh)

Definition at line 727 of file journal.c.

int reiserfs_in_journal ( struct super_block sb,
unsigned int  bmap_nr,
int  bit_nr,
int  search_all,
b_blocknr_t next_zero_bit 
)

Definition at line 458 of file journal.c.

struct reiserfs_transaction_handle* reiserfs_persistent_transaction ( struct super_block s,
int  nblocks 
)
read

Definition at line 3093 of file journal.c.

int reiserfs_prepare_for_journal ( struct super_block sb,
struct buffer_head *  bh,
int  wait 
)

Definition at line 3852 of file journal.c.

void reiserfs_restore_prepared_buffer ( struct super_block sb,
struct buffer_head *  bh 
)

Definition at line 3822 of file journal.c.

void reiserfs_update_inode_transaction ( struct inode inode)

Definition at line 3737 of file journal.c.

void reiserfs_wait_on_write_block ( struct super_block s)

Definition at line 2914 of file journal.c.

Variable Documentation