Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 105844
b: refs/heads/master
c: 1984bb7
h: refs/heads/master
v: v3
  • Loading branch information
Duane Griffin authored and Linus Torvalds committed Jul 25, 2008
1 parent 15658fe commit 08bd335
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f4d79ca2fa211cffc07306eeed7013448e77d7ec
refs/heads/master: 1984bb763c2e50d0ebfb0cf56d1b319bd7afe63a
36 changes: 23 additions & 13 deletions trunk/fs/jbd/revoke.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,33 +166,43 @@ static struct jbd_revoke_record_s *find_revoke_record(journal_t *journal,
return NULL;
}

void journal_destroy_revoke_caches(void)
{
if (revoke_record_cache) {
kmem_cache_destroy(revoke_record_cache);
revoke_record_cache = NULL;
}
if (revoke_table_cache) {
kmem_cache_destroy(revoke_table_cache);
revoke_table_cache = NULL;
}
}

int __init journal_init_revoke_caches(void)
{
J_ASSERT(!revoke_record_cache);
J_ASSERT(!revoke_table_cache);

revoke_record_cache = kmem_cache_create("revoke_record",
sizeof(struct jbd_revoke_record_s),
0,
SLAB_HWCACHE_ALIGN|SLAB_TEMPORARY,
NULL);
if (!revoke_record_cache)
return -ENOMEM;
goto record_cache_failure;

revoke_table_cache = kmem_cache_create("revoke_table",
sizeof(struct jbd_revoke_table_s),
0, SLAB_TEMPORARY, NULL);
if (!revoke_table_cache) {
kmem_cache_destroy(revoke_record_cache);
revoke_record_cache = NULL;
return -ENOMEM;
}
if (!revoke_table_cache)
goto table_cache_failure;

return 0;
}

void journal_destroy_revoke_caches(void)
{
kmem_cache_destroy(revoke_record_cache);
revoke_record_cache = NULL;
kmem_cache_destroy(revoke_table_cache);
revoke_table_cache = NULL;
table_cache_failure:
journal_destroy_revoke_caches();
record_cache_failure:
return -ENOMEM;
}

static struct jbd_revoke_table_s *journal_init_revoke_table(int hash_size)
Expand Down

0 comments on commit 08bd335

Please sign in to comment.