Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 82917
b: refs/heads/master
c: 151c602
h: refs/heads/master
i:
  82915: 75f893a
v: v3
  • Loading branch information
Christoph Lameter committed Feb 4, 2008
1 parent 3d1e5ed commit a855511
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 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: e374d4835668a8c6aec7cefc0a44df69f9679017
refs/heads/master: 151c602f79cb9154c3f3d83223cae355af463d6f
15 changes: 13 additions & 2 deletions trunk/mm/slub.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,10 @@ static void sysfs_slab_remove(struct kmem_cache *);
static inline int sysfs_slab_add(struct kmem_cache *s) { return 0; }
static inline int sysfs_slab_alias(struct kmem_cache *s, const char *p)
{ return 0; }
static inline void sysfs_slab_remove(struct kmem_cache *s) {}
static inline void sysfs_slab_remove(struct kmem_cache *s)
{
kfree(s);
}
#endif

/********************************************************************
Expand Down Expand Up @@ -2322,7 +2325,6 @@ void kmem_cache_destroy(struct kmem_cache *s)
if (kmem_cache_close(s))
WARN_ON(1);
sysfs_slab_remove(s);
kfree(s);
} else
up_write(&slub_lock);
}
Expand Down Expand Up @@ -3937,13 +3939,21 @@ static ssize_t slab_attr_store(struct kobject *kobj,
return err;
}

static void kmem_cache_release(struct kobject *kobj)
{
struct kmem_cache *s = to_slab(kobj);

kfree(s);
}

static struct sysfs_ops slab_sysfs_ops = {
.show = slab_attr_show,
.store = slab_attr_store,
};

static struct kobj_type slab_ktype = {
.sysfs_ops = &slab_sysfs_ops,
.release = kmem_cache_release
};

static int uevent_filter(struct kset *kset, struct kobject *kobj)
Expand Down Expand Up @@ -4045,6 +4055,7 @@ static void sysfs_slab_remove(struct kmem_cache *s)
{
kobject_uevent(&s->kobj, KOBJ_REMOVE);
kobject_del(&s->kobj);
kobject_put(&s->kobj);
}

/*
Expand Down

0 comments on commit a855511

Please sign in to comment.