Linux Kernel
3.7.1
|
#include <linux/module.h>
#include <linux/time.h>
#include <linux/fs.h>
#include <linux/jbd.h>
#include <linux/errno.h>
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/mm.h>
#include <linux/freezer.h>
#include <linux/pagemap.h>
#include <linux/kthread.h>
#include <linux/poison.h>
#include <linux/proc_fs.h>
#include <linux/debugfs.h>
#include <linux/ratelimit.h>
#include <trace/events/jbd.h>
#include <asm/uaccess.h>
#include <asm/page.h>
Go to the source code of this file.
Macros | |
#define | CREATE_TRACE_POINTS |
#define | MIN_LOG_RESERVED_BLOCKS 32 /* Allow for rounding errors */ |
Variables | |
struct kmem_cache * | jbd_handle_cache |
EXPORT_SYMBOL | ( | journal_start | ) |
EXPORT_SYMBOL | ( | journal_restart | ) |
EXPORT_SYMBOL | ( | journal_extend | ) |
EXPORT_SYMBOL | ( | journal_stop | ) |
EXPORT_SYMBOL | ( | journal_lock_updates | ) |
EXPORT_SYMBOL | ( | journal_unlock_updates | ) |
EXPORT_SYMBOL | ( | journal_get_write_access | ) |
EXPORT_SYMBOL | ( | journal_get_create_access | ) |
EXPORT_SYMBOL | ( | journal_get_undo_access | ) |
EXPORT_SYMBOL | ( | journal_dirty_data | ) |
EXPORT_SYMBOL | ( | journal_dirty_metadata | ) |
EXPORT_SYMBOL | ( | journal_release_buffer | ) |
EXPORT_SYMBOL | ( | journal_forget | ) |
EXPORT_SYMBOL | ( | journal_flush | ) |
EXPORT_SYMBOL | ( | journal_revoke | ) |
EXPORT_SYMBOL | ( | journal_init_dev | ) |
EXPORT_SYMBOL | ( | journal_init_inode | ) |
EXPORT_SYMBOL | ( | journal_update_format | ) |
EXPORT_SYMBOL | ( | journal_check_used_features | ) |
EXPORT_SYMBOL | ( | journal_check_available_features | ) |
EXPORT_SYMBOL | ( | journal_set_features | ) |
EXPORT_SYMBOL | ( | journal_create | ) |
EXPORT_SYMBOL | ( | journal_load | ) |
EXPORT_SYMBOL | ( | journal_destroy | ) |
EXPORT_SYMBOL | ( | journal_abort | ) |
EXPORT_SYMBOL | ( | journal_errno | ) |
EXPORT_SYMBOL | ( | journal_ack_err | ) |
EXPORT_SYMBOL | ( | journal_clear_err | ) |
EXPORT_SYMBOL | ( | log_wait_commit | ) |
EXPORT_SYMBOL | ( | log_start_commit | ) |
EXPORT_SYMBOL | ( | journal_start_commit | ) |
EXPORT_SYMBOL | ( | journal_force_commit_nested | ) |
EXPORT_SYMBOL | ( | journal_wipe | ) |
EXPORT_SYMBOL | ( | journal_blocks_per_page | ) |
EXPORT_SYMBOL | ( | journal_invalidatepage | ) |
EXPORT_SYMBOL | ( | journal_try_to_free_buffers | ) |
EXPORT_SYMBOL | ( | journal_force_commit | ) |
EXPORT_SYMBOL | ( | journal_trans_will_send_data_barrier | ) |
void journal_abort () - Shutdown the journal immediately. : the journal to shutdown. : an error number to record in the journal indicating the reason for the shutdown.
Perform a complete, immediate shutdown of the ENTIRE journal (not of a single transaction). This operation cannot be undone without closing and reopening the journal.
The journal_abort function is intended to support higher level error recovery mechanisms such as the ext2/ext3 remount-readonly error mode.
Journal abort has very specific semantics. Any existing dirty, unjournaled buffers in the main filesystem will still be written to disk by bdflush, but the journaling mechanism will be suspended immediately and no further transaction commits will be honoured.
Any dirty, journaled buffers will be written back to disk without hitting the journal. Atomicity cannot be guaranteed on an aborted filesystem, but we do attempt to leave as much data as possible behind for fsck to use for cleanup.
Any attempt to get a new transaction handle on a journal which is in ABORT state will just result in an -EROFS error return. A journal_stop on an existing handle will return -EIO if we have entered abort state during the update.
Recursive transactions are not disturbed by journal abort until the final journal_stop, which will receive the -EIO error.
Finally, the journal_abort call allows the caller to supply an errno which will be recorded (if possible) in the journal superblock. This allows a client to record failure conditions in the middle of a transaction without having to complete the transaction to record the failure to disk. ext3_error, for example, now uses this functionality.
Errors which originate from within the journaling layer will NOT supply an errno; a null errno implies that absolutely no further writes are done to the journal (unless there are any already in progress).
void journal_ack_err | ( | journal_t * | journal | ) |
void journal_ack_err() - Ack journal err. : journal to act on.
An error must be cleared or Acked to take a FS out of readonly mode.
|
read |
int journal_check_available_features | ( | journal_t * | journal, |
unsigned long | compat, | ||
unsigned long | ro, | ||
unsigned long | incompat | ||
) |
int journal_check_available_features() - Check feature set in journalling layer : Journal to check. : bitmask of compatible features : bitmask of features that force read-only mount : bitmask of incompatible features
Check whether the journaling code supports the use of all of a given set of features on this journal. Return true (non-zero) if it can.
int journal_check_used_features | ( | journal_t * | journal, |
unsigned long | compat, | ||
unsigned long | ro, | ||
unsigned long | incompat | ||
) |
*int journal_check_used_features () - Check if features specified are used. : Journal to check. : bitmask of compatible features : bitmask of features that force read-only mount : bitmask of incompatible features
Check whether the journal uses all of a given set of features. Return true (non-zero) if it does.
int journal_clear_err | ( | journal_t * | journal | ) |
int journal_create | ( | journal_t * | journal | ) |
int journal_create() - Initialise the new journal file : Journal to create. This structure must have been initialised
Given a journal_t structure which tells us which disk blocks we can use, create a new journal superblock and initialise all of the journal fields from scratch.
int journal_destroy | ( | journal_t * | journal | ) |
void journal_destroy() - Release a journal_t structure. : Journal to act on.
Release a journal_t structure once it is no longer in use by the journaled object. Return <0 if we couldn't clean up the journal.
int journal_errno | ( | journal_t * | journal | ) |
int journal_errno () - returns the journal's error state. : journal to examine.
This is the errno numbet set with journal_abort(), the last time the journal was mounted - if the journal was stopped without calling abort this will be 0.
If the journal has been aborted on this mount time -EROFS will be returned.
int journal_flush | ( | journal_t * | journal | ) |
|
read |
|
read |
journal_t* journal_init_dev | ( | struct block_device * | bdev, |
struct block_device * | fs_dev, | ||
int | start, | ||
int | len, | ||
int | blocksize | ||
) |
journal_t * journal_init_dev() - creates and initialises a journal structure : Block device on which to create the journal : Device which hold journalled filesystem for this journal. : Block nr Start of journal. : Length of the journal in blocks. : blocksize of journalling device
Returns: a newly created journal_t *
journal_init_dev creates a journal which maps a fixed contiguous range of blocks on an arbitrary block device.
int journal_load | ( | journal_t * | journal | ) |
int journal_load() - Read journal from disk. : Journal to act on.
Given a journal_t structure which tells us which disk blocks contain a journal, read the journal from disk to initialise the in-memory structures.
void journal_put_journal_head | ( | struct journal_head * | jh | ) |
int journal_set_features | ( | journal_t * | journal, |
unsigned long | compat, | ||
unsigned long | ro, | ||
unsigned long | incompat | ||
) |
int journal_set_features () - Mark a given journal feature in the superblock : Journal to act on. : bitmask of compatible features : bitmask of features that force read-only mount : bitmask of incompatible features
Mark a given journal feature as present on the superblock. Returns true if the requested features could be set.
int journal_update_format | ( | journal_t * | journal | ) |
void journal_update_sb_log_tail | ( | journal_t * | journal, |
tid_t | tail_tid, | ||
unsigned int | tail_block, | ||
int | write_op | ||
) |
journal_update_sb_log_tail() - Update log tail in journal sb on disk. : The journal to update. : TID of the new transaction at the tail of the log : The first block of the transaction at the tail of the log : With which operation should we write the journal sb
Update a journal's superblock information about log tail and write it to disk, waiting for the IO to complete.
int journal_wipe() - Wipe journal contents : Journal to act on. : flag (see below)
Wipe out all of the contents of a journal, safely. This will produce a warning if the journal contains any valid recovery information. Must be called between journal_init_*() and journal_load().
If 'write' is non-zero, then we wipe out the journal on disk; otherwise we merely suppress recovery.
int journal_write_metadata_buffer | ( | transaction_t * | transaction, |
struct journal_head * | jh_in, | ||
struct journal_head ** | jh_out, | ||
unsigned int | blocknr | ||
) |
module_exit | ( | journal_exit | ) |
module_init | ( | journal_init | ) |
MODULE_LICENSE | ( | "GPL" | ) |
struct kmem_cache* jbd_handle_cache |