Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 83045
b: refs/heads/master
c: b98938c
h: refs/heads/master
i:
  83043: d2b05e4
v: v3
  • Loading branch information
Christoph Lameter authored and Linus Torvalds committed Feb 5, 2008
1 parent d87e2d6 commit 2eb1200
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 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: aec2c3ed01ed54d0cdf7f6b7c4be217c045ac5ea
refs/heads/master: b98938c373117043598002f197200d7ed08acd49
18 changes: 15 additions & 3 deletions trunk/fs/buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -3153,7 +3153,7 @@ static void recalc_bh_state(void)

struct buffer_head *alloc_buffer_head(gfp_t gfp_flags)
{
struct buffer_head *ret = kmem_cache_zalloc(bh_cachep,
struct buffer_head *ret = kmem_cache_alloc(bh_cachep,
set_migrateflags(gfp_flags, __GFP_RECLAIMABLE));
if (ret) {
INIT_LIST_HEAD(&ret->b_assoc_buffers);
Expand Down Expand Up @@ -3241,12 +3241,24 @@ int bh_submit_read(struct buffer_head *bh)
}
EXPORT_SYMBOL(bh_submit_read);

static void
init_buffer_head(struct kmem_cache *cachep, void *data)
{
struct buffer_head *bh = data;

memset(bh, 0, sizeof(*bh));
INIT_LIST_HEAD(&bh->b_assoc_buffers);
}

void __init buffer_init(void)
{
int nrpages;

bh_cachep = KMEM_CACHE(buffer_head,
SLAB_RECLAIM_ACCOUNT|SLAB_PANIC|SLAB_MEM_SPREAD);
bh_cachep = kmem_cache_create("buffer_head",
sizeof(struct buffer_head), 0,
(SLAB_RECLAIM_ACCOUNT|SLAB_PANIC|
SLAB_MEM_SPREAD),
init_buffer_head);

/*
* Limit the bh occupancy to 10% of ZONE_NORMAL
Expand Down

0 comments on commit 2eb1200

Please sign in to comment.