ReactOS 0.4.16-dev-297-gc569aee
|
#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>
Go to the source code of this file.
Variables | |
static struct kmem_cache * | journal_head_cache = NULL |
struct kmem_cache * | jbd_handle_cache = NULL |
|
inlinestatic |
Definition at line 1188 of file replay.c.
Referenced by __journal_file_buffer().
|
inlinestatic |
Definition at line 1212 of file replay.c.
Referenced by __journal_temp_unlink_buffer().
|
static |
Definition at line 1313 of file replay.c.
|
static |
Definition at line 65 of file replay.c.
Referenced by __journal_abort_soft().
Definition at line 82 of file replay.c.
Referenced by journal_abort(), and journal_bmap().
void __journal_file_buffer | ( | struct journal_head * | jh, |
transaction_t * | transaction, | ||
int | jlist | ||
) |
Definition at line 1337 of file replay.c.
Referenced by __dispose_buffer(), journal_file_buffer(), and journal_forget().
|
static |
Definition at line 381 of file replay.c.
Referenced by journal_put_journal_head(), and journal_remove_journal_head().
|
static |
Definition at line 1234 of file replay.c.
Referenced by __journal_file_buffer(), __journal_unfile_buffer(), and journal_forget().
void __journal_unfile_buffer | ( | struct journal_head * | jh | ) |
Definition at line 1286 of file replay.c.
Referenced by __dispose_buffer(), journal_forget(), and journal_unfile_buffer().
Definition at line 21 of file replay.c.
Referenced by __journal_abort_hard(), and log_start_commit().
void journal_abort () - Shutdown the journal immediately. @journal: the journal to shutdown. @errno: 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: journal to act on.
An error must be cleared or Acked to take a FS out of readonly mode.
Definition at line 199 of file replay.c.
struct journal_head * journal_add_journal_head | ( | struct buffer_head * | bh | ) |
Definition at line 325 of file replay.c.
Referenced by journal_get_descriptor_buffer().
|
static |
Definition at line 249 of file replay.c.
Referenced by journal_add_journal_head().
Definition at line 484 of file replay.c.
Referenced by journal_init_inode(), journal_next_log_block(), and jread().
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: Journal to check. @compat: bitmask of compatible features @ro: bitmask of features that force read-only mount @incompat: 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.
Definition at line 767 of file replay.c.
Referenced by journal_set_features().
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: Journal to check. @compat: bitmask of compatible features @ro: bitmask of features that force read-only mount @incompat: bitmask of incompatible features
Check whether the journal uses all of a given set of features. Return true (non-zero) if it does.
Definition at line 736 of file replay.c.
Referenced by journal_set_features().
int journal_clear_err | ( | journal_t * | journal | ) |
int journal_clear_err () - clears the journal's error state @journal: journal to act on.
An error must be cleared or Acked to take a FS out of readonly mode.
|
static |
Definition at line 827 of file replay.c.
Referenced by journal_update_format().
void journal_destroy | ( | journal_t * | journal | ) |
void journal_destroy() - Release a journal_t structure. @journal: Journal to act on.
Release a journal_t structure once it is no longer in use by the journaled object.
Definition at line 678 of file replay.c.
Referenced by Ext2RecoverJournal().
Definition at line 1621 of file replay.c.
Referenced by journal_exit(), and journal_init().
int journal_errno | ( | journal_t * | journal | ) |
int journal_errno () - returns the journal's error state. @journal: 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.
Definition at line 1641 of file replay.c.
Referenced by DriverEntry().
|
static |
Definition at line 858 of file replay.c.
Referenced by journal_get_superblock().
void journal_file_buffer | ( | struct journal_head * | jh, |
transaction_t * | transaction, | ||
int | jlist | ||
) |
Definition at line 1408 of file replay.c.
int journal_forget | ( | handle_t * | handle, |
struct buffer_head * | bh | ||
) |
void journal_forget() - bforget() for potentially-journaled buffers. @handle: transaction handle @bh: bh to 'forget'
We can only do the bforget if there are no commits pending against the buffer. If the buffer is dirty in the current running transaction we can safely unlink it.
bh may not be a journalled buffer at all - it may be a non-JBD buffer which came off the hashtable. Check for this.
Decrements bh->b_count by one.
Allow this call even if the handle has aborted — it may be part of the caller's cleanup after an abort.
Definition at line 1447 of file replay.c.
|
static |
Definition at line 273 of file replay.c.
Referenced by __journal_remove_journal_head(), and journal_add_journal_head().
struct journal_head * journal_get_descriptor_buffer | ( | journal_t * | journal | ) |
Definition at line 518 of file replay.c.
|
static |
Definition at line 871 of file replay.c.
Referenced by journal_update_format(), and load_superblock().
struct journal_head * journal_grab_journal_head | ( | struct buffer_head * | bh | ) |
Definition at line 1628 of file replay.c.
Referenced by DriverEntry().
Definition at line 1609 of file replay.c.
Referenced by journal_init().
|
static |
Definition at line 547 of file replay.c.
Referenced by journal_init_inode().
Definition at line 1585 of file replay.c.
Referenced by journal_init_caches().
journal_t * journal_init_inode () - creates a journal which maps to a inode. @inode: An inode to create the journal in
journal_init_inode creates a journal which maps an on-disk inode as the journal. The inode must exist already, must support bmap() and must have all data blocks preallocated.
Definition at line 592 of file replay.c.
Referenced by Ext2RecoverJournal().
Definition at line 221 of file replay.c.
Referenced by journal_init_caches().
int journal_load | ( | journal_t * | journal | ) |
int journal_load() - Read journal from disk. @journal: 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.
Definition at line 1121 of file replay.c.
Referenced by Ext2RecoverJournal().
Definition at line 461 of file replay.c.
Referenced by journal_get_descriptor_buffer().
void journal_put_journal_head | ( | struct journal_head * | jh | ) |
Definition at line 443 of file replay.c.
void journal_release_buffer | ( | handle_t * | handle, |
struct buffer_head * | bh | ||
) |
Definition at line 1425 of file replay.c.
Referenced by ext3_journal_release_buffer().
void journal_remove_journal_head | ( | struct buffer_head * | bh | ) |
Definition at line 432 of file replay.c.
Referenced by __dispose_buffer(), and journal_forget().
|
static |
Definition at line 1087 of file replay.c.
Referenced by journal_load().
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: Journal to act on. @compat: bitmask of compatible features @ro: bitmask of features that force read-only mount @incompat: bitmask of incompatible features
Mark a given journal feature as present on the superblock. Returns true if the requested features could be set.
Definition at line 804 of file replay.c.
void journal_unfile_buffer | ( | journal_t * | journal, |
struct journal_head * | jh | ||
) |
Definition at line 1292 of file replay.c.
int journal_update_format | ( | journal_t * | journal | ) |
int journal_update_format () - Update on-disk journal structure. @journal: Journal to act on.
Given an initialised but unloaded journal struct, poke about in the on-disk structure to update it to the most recent supported version.
Definition at line 999 of file replay.c.
void journal_update_superblock() - Update journal sb on disk. @journal: The journal to update. @wait: Set to '0' if you don't want to wait for IO completion.
Update a journal's dynamic superblock fields and write it to disk, optionally waiting for the IO to complete.
Definition at line 1030 of file replay.c.
Referenced by __journal_abort_soft(), journal_destroy(), journal_reset(), journal_wipe(), and journal_wipe_recovery().
int journal_wipe() - Wipe journal contents @journal: Journal to act on. @write: 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.
Definition at line 964 of file replay.c.
void journal_wipe_recovery | ( | journal_t * | journal | ) |
wipe all journal data ...
Definition at line 659 of file replay.c.
Referenced by Ext2RecoverJournal().
|
static |
Definition at line 931 of file replay.c.
Referenced by journal_load(), and journal_wipe().
module_exit | ( | journal_exit | ) |
module_init | ( | journal_init | ) |
MODULE_LICENSE | ( | "GPL" | ) |
struct kmem_cache* jbd_handle_cache = NULL |
Definition at line 1583 of file replay.c.
Referenced by journal_destroy_handle_cache(), and journal_init_handle_cache().
|
static |
Definition at line 216 of file replay.c.
Referenced by journal_alloc_journal_head(), journal_destroy_journal_head_cache(), journal_free_journal_head(), and journal_init_journal_head_cache().