コード例 #1
0
ファイル: net_connection.c プロジェクト: alepom/pimidi
void net_ctx_journal_reset( uint8_t ctx_id )
{
	net_ctx_t *ctx = NULL;

	if( ctx_id > _max_ctx - 1) return;

	ctx = net_ctx_find_by_id( ctx_id );

	if( ! ctx) return;

	journal_reset( ctx->journal);
}
コード例 #2
0
ファイル: replay.c プロジェクト: Axure/Ext3Fsd
/**
 * 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.
 */
int journal_load(journal_t *journal)
{
    int err;
    journal_superblock_t *sb;

    err = load_superblock(journal);
    if (err)
        return err;

    sb = journal->j_superblock;
    /* If this is a V2 superblock, then we have to check the
     * features flags on it. */

    if (journal->j_format_version >= 2) {
        if ((sb->s_feature_ro_compat &
                ~cpu_to_be32(JFS_KNOWN_ROCOMPAT_FEATURES)) ||
                (sb->s_feature_incompat &
                 ~cpu_to_be32(JFS_KNOWN_INCOMPAT_FEATURES))) {
            printk (KERN_WARNING
                    "JBD: Unrecognised features on journal\n");
            return -EINVAL;
        }
    }

    /* Let the recovery code check whether it needs to recover any
     * data from the journal. */
    if (journal_recover(journal))
        goto recovery_error;

    /* OK, we've finished with the dynamic journal bits:
     * reinitialise the dynamic contents of the superblock in memory
     * and reset them on disk. */
    if (journal_reset(journal))
        goto recovery_error;

    journal->j_flags &= ~JFS_ABORT;
    journal->j_flags |= JFS_LOADED;
    return 0;

recovery_error:
    printk (KERN_WARNING "JBD: recovery failed\n");
    return -EIO;
}