Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 36135
b: refs/heads/master
c: 133d205
h: refs/heads/master
i:
  36133: 6708c89
  36131: 0e8b891
  36127: 1019c0e
v: v3
  • Loading branch information
Alexey Dobriyan authored and Linus Torvalds committed Sep 27, 2006
1 parent 8ff1a8a commit 262b874
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 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: 1a1d92c10dd24bbdc28b3d6e2d03ec199dd3a65b
refs/heads/master: 133d205a18b7a4d8cb52959c5310f6664277cf61
4 changes: 2 additions & 2 deletions trunk/include/linux/slab.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ extern void __init kmem_cache_init(void);
extern kmem_cache_t *kmem_cache_create(const char *, size_t, size_t, unsigned long,
void (*)(void *, kmem_cache_t *, unsigned long),
void (*)(void *, kmem_cache_t *, unsigned long));
extern int kmem_cache_destroy(kmem_cache_t *);
extern void kmem_cache_destroy(kmem_cache_t *);
extern int kmem_cache_shrink(kmem_cache_t *);
extern void *kmem_cache_alloc(kmem_cache_t *, gfp_t);
extern void *kmem_cache_zalloc(struct kmem_cache *, gfp_t);
Expand Down Expand Up @@ -249,7 +249,7 @@ struct kmem_cache *kmem_cache_create(const char *c, size_t, size_t,
unsigned long,
void (*)(void *, struct kmem_cache *, unsigned long),
void (*)(void *, struct kmem_cache *, unsigned long));
int kmem_cache_destroy(struct kmem_cache *c);
void kmem_cache_destroy(struct kmem_cache *c);
void *kmem_cache_alloc(struct kmem_cache *c, gfp_t flags);
void *kmem_cache_zalloc(struct kmem_cache *, gfp_t);
void kmem_cache_free(struct kmem_cache *c, void *b);
Expand Down
6 changes: 2 additions & 4 deletions trunk/mm/slab.c
Original file line number Diff line number Diff line change
Expand Up @@ -2442,7 +2442,6 @@ EXPORT_SYMBOL(kmem_cache_shrink);
* @cachep: the cache to destroy
*
* Remove a struct kmem_cache object from the slab cache.
* Returns 0 on success.
*
* It is expected this function will be called by a module when it is
* unloaded. This will remove the cache completely, and avoid a duplicate
Expand All @@ -2454,7 +2453,7 @@ EXPORT_SYMBOL(kmem_cache_shrink);
* The caller must guarantee that noone will allocate memory from the cache
* during the kmem_cache_destroy().
*/
int kmem_cache_destroy(struct kmem_cache *cachep)
void kmem_cache_destroy(struct kmem_cache *cachep)
{
BUG_ON(!cachep || in_interrupt());

Expand All @@ -2475,15 +2474,14 @@ int kmem_cache_destroy(struct kmem_cache *cachep)
list_add(&cachep->next, &cache_chain);
mutex_unlock(&cache_chain_mutex);
unlock_cpu_hotplug();
return 1;
return;
}

if (unlikely(cachep->flags & SLAB_DESTROY_BY_RCU))
synchronize_rcu();

__kmem_cache_destroy(cachep);
unlock_cpu_hotplug();
return 0;
}
EXPORT_SYMBOL(kmem_cache_destroy);

Expand Down
3 changes: 1 addition & 2 deletions trunk/mm/slob.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,10 +270,9 @@ struct kmem_cache *kmem_cache_create(const char *name, size_t size,
}
EXPORT_SYMBOL(kmem_cache_create);

int kmem_cache_destroy(struct kmem_cache *c)
void kmem_cache_destroy(struct kmem_cache *c)
{
slob_free(c, sizeof(struct kmem_cache));
return 0;
}
EXPORT_SYMBOL(kmem_cache_destroy);

Expand Down

0 comments on commit 262b874

Please sign in to comment.