journal_t *journal;
errcode_t retval;
- jbd2_journal_init_revoke_caches();
+ retval = jbd2_journal_init_revoke_record_cache();
+ if (retval)
+ return retval;
+
+ retval = jbd2_journal_init_revoke_table_cache();
+ if (retval)
+ return retval;
+
retval = ext2fs_get_journal(fs, &journal);
if (retval)
return retval;
errout:
jbd2_journal_destroy_revoke(journal);
- jbd2_journal_destroy_revoke_caches();
+ jbd2_journal_destroy_revoke_record_cache();
+ jbd2_journal_destroy_revoke_table_cache();
ext2fs_journal_release(fs, journal, 1, 0);
return retval;
}
journal_t *journal;
errcode_t retval;
- jbd2_journal_init_revoke_caches();
+ retval = jbd2_journal_init_revoke_record_cache();
+ if (retval)
+ return retval;
+
+ retval = jbd2_journal_init_revoke_table_cache();
+ if (retval)
+ return retval;
+
retval = ext2fs_get_journal(fs, &journal);
if (retval)
return retval;
errout:
jbd2_journal_destroy_revoke(journal);
- jbd2_journal_destroy_revoke_caches();
+ jbd2_journal_destroy_revoke_record_cache();
+ jbd2_journal_destroy_revoke_table_cache();
ext2fs_journal_release(fs, journal, 1, 0);
return retval;
}
journal_t *journal = *j;
jbd2_journal_destroy_revoke(journal);
- jbd2_journal_destroy_revoke_caches();
+ jbd2_journal_destroy_revoke_record_cache();
+ jbd2_journal_destroy_revoke_table_cache();
ext2fs_journal_release(fs, journal, 0, 0);
*j = NULL;
/* revoke.c */
extern int jbd2_journal_init_revoke(journal_t *, int);
extern void jbd2_journal_destroy_revoke(journal_t *);
-extern void jbd2_journal_destroy_revoke_caches(void);
-extern int jbd2_journal_init_revoke_caches(void);
+extern void jbd2_journal_destroy_revoke_record_cache(void);
+extern void jbd2_journal_destroy_revoke_table_cache(void);
+extern int jbd2_journal_init_revoke_record_cache(void);
+extern int jbd2_journal_init_revoke_table_cache(void);
+
extern int jbd2_journal_set_revoke(journal_t *, unsigned long long, tid_t);
extern int jbd2_journal_test_revoke(journal_t *, unsigned long long, tid_t);
clear_problem_context(&pctx);
- jbd2_journal_init_revoke_caches();
+ retval = jbd2_journal_init_revoke_record_cache();
+ if (retval)
+ return retval;
+
+ retval = jbd2_journal_init_revoke_table_cache();
+ if (retval)
+ return retval;
+
retval = e2fsck_get_journal(ctx, &journal);
if (retval)
return retval;
errout:
jbd2_journal_destroy_revoke(journal);
- jbd2_journal_destroy_revoke_caches();
+ jbd2_journal_destroy_revoke_record_cache();
+ jbd2_journal_destroy_revoke_table_cache();
e2fsck_journal_release(ctx, journal, 1, 0);
return retval;
}
return NULL;
}
-void jbd2_journal_destroy_revoke_caches(void)
+void jbd2_journal_destroy_revoke_record_cache(void)
{
kmem_cache_destroy(jbd2_revoke_record_cache);
jbd2_revoke_record_cache = NULL;
+}
+
+void jbd2_journal_destroy_revoke_table_cache(void)
+{
kmem_cache_destroy(jbd2_revoke_table_cache);
jbd2_revoke_table_cache = NULL;
}
-int __init jbd2_journal_init_revoke_caches(void)
+int __init jbd2_journal_init_revoke_record_cache(void)
{
J_ASSERT(!jbd2_revoke_record_cache);
- J_ASSERT(!jbd2_revoke_table_cache);
-
jbd2_revoke_record_cache = KMEM_CACHE(jbd2_revoke_record_s,
SLAB_HWCACHE_ALIGN|SLAB_TEMPORARY);
- if (!jbd2_revoke_record_cache)
- goto record_cache_failure;
+ if (!jbd2_revoke_record_cache) {
+ pr_emerg("JBD2: failed to create revoke_record cache\n");
+ return -ENOMEM;
+ }
+ return 0;
+}
+
+int __init jbd2_journal_init_revoke_table_cache(void)
+{
+ J_ASSERT(!jbd2_revoke_table_cache);
jbd2_revoke_table_cache = KMEM_CACHE(jbd2_revoke_table_s,
SLAB_TEMPORARY);
- if (!jbd2_revoke_table_cache)
- goto table_cache_failure;
- return 0;
-table_cache_failure:
- jbd2_journal_destroy_revoke_caches();
-record_cache_failure:
+ if (!jbd2_revoke_table_cache) {
+ pr_emerg("JBD2: failed to create revoke_table cache\n");
return -ENOMEM;
+ }
+ return 0;
}
static struct jbd2_revoke_table_s *jbd2_journal_init_revoke_table(int hash_size)
#define blkdev_issue_flush(kdev, a, b) sync_blockdev(kdev)
#define is_power_of_2(x) ((x) != 0 && (((x) & ((x) - 1)) == 0))
+#define pr_emerg(fmt)
struct journal_s
{