aboutsummaryrefslogtreecommitdiffstats
path: root/fs/buffer.c
diff options
context:
space:
mode:
authorChristoph Lameter <clameter@sgi.com>2007-05-17 01:10:57 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-17 08:23:04 -0400
commita35afb830f8d71ec211531aeb9a621b09a2efb39 (patch)
tree198280081e1f8b2f6c450742a5075cc7904a3d58 /fs/buffer.c
parent5577bd8a85c8b7643a241789b14fafa9c8a6c7db (diff)
Remove SLAB_CTOR_CONSTRUCTOR
SLAB_CTOR_CONSTRUCTOR is always specified. No point in checking it. Signed-off-by: Christoph Lameter <clameter@sgi.com> Cc: David Howells <dhowells@redhat.com> Cc: Jens Axboe <jens.axboe@oracle.com> Cc: Steven French <sfrench@us.ibm.com> Cc: Michael Halcrow <mhalcrow@us.ibm.com> Cc: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> Cc: Miklos Szeredi <miklos@szeredi.hu> Cc: Steven Whitehouse <swhiteho@redhat.com> Cc: Roman Zippel <zippel@linux-m68k.org> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Dave Kleikamp <shaggy@austin.ibm.com> Cc: Trond Myklebust <trond.myklebust@fys.uio.no> Cc: "J. Bruce Fields" <bfields@fieldses.org> Cc: Anton Altaparmakov <aia21@cantab.net> Cc: Mark Fasheh <mark.fasheh@oracle.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Christoph Hellwig <hch@lst.de> Cc: Jan Kara <jack@ucw.cz> Cc: David Chinner <dgc@sgi.com> Cc: "David S. Miller" <davem@davemloft.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/buffer.c')
-rw-r--r--fs/buffer.c22
1 files changed, 4 insertions, 18 deletions
diff --git a/fs/buffer.c b/fs/buffer.c
index aecd057cd0e0..3deeb886f6e6 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -2898,8 +2898,9 @@ static void recalc_bh_state(void)
2898 2898
2899struct buffer_head *alloc_buffer_head(gfp_t gfp_flags) 2899struct buffer_head *alloc_buffer_head(gfp_t gfp_flags)
2900{ 2900{
2901 struct buffer_head *ret = kmem_cache_alloc(bh_cachep, gfp_flags); 2901 struct buffer_head *ret = kmem_cache_zalloc(bh_cachep, gfp_flags);
2902 if (ret) { 2902 if (ret) {
2903 INIT_LIST_HEAD(&ret->b_assoc_buffers);
2903 get_cpu_var(bh_accounting).nr++; 2904 get_cpu_var(bh_accounting).nr++;
2904 recalc_bh_state(); 2905 recalc_bh_state();
2905 put_cpu_var(bh_accounting); 2906 put_cpu_var(bh_accounting);
@@ -2918,17 +2919,6 @@ void free_buffer_head(struct buffer_head *bh)
2918} 2919}
2919EXPORT_SYMBOL(free_buffer_head); 2920EXPORT_SYMBOL(free_buffer_head);
2920 2921
2921static void
2922init_buffer_head(void *data, struct kmem_cache *cachep, unsigned long flags)
2923{
2924 if (flags & SLAB_CTOR_CONSTRUCTOR) {
2925 struct buffer_head * bh = (struct buffer_head *)data;
2926
2927 memset(bh, 0, sizeof(*bh));
2928 INIT_LIST_HEAD(&bh->b_assoc_buffers);
2929 }
2930}
2931
2932static void buffer_exit_cpu(int cpu) 2922static void buffer_exit_cpu(int cpu)
2933{ 2923{
2934 int i; 2924 int i;
@@ -2955,12 +2945,8 @@ void __init buffer_init(void)
2955{ 2945{
2956 int nrpages; 2946 int nrpages;
2957 2947
2958 bh_cachep = kmem_cache_create("buffer_head", 2948 bh_cachep = KMEM_CACHE(buffer_head,
2959 sizeof(struct buffer_head), 0, 2949 SLAB_RECLAIM_ACCOUNT|SLAB_PANIC|SLAB_MEM_SPREAD);
2960 (SLAB_RECLAIM_ACCOUNT|SLAB_PANIC|
2961 SLAB_MEM_SPREAD),
2962 init_buffer_head,
2963 NULL);
2964 2950
2965 /* 2951 /*
2966 * Limit the bh occupancy to 10% of ZONE_NORMAL 2952 * Limit the bh occupancy to 10% of ZONE_NORMAL