diff options
author | Theodore Ts'o <tytso@mit.edu> | 2009-12-07 10:36:20 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2009-12-07 10:36:20 -0500 |
commit | d2eecb03936878ec574ade5532fa83df7d75dde7 (patch) | |
tree | f7ef8bd29096ba6c073308cd3b674857be1545d4 /include/linux/jbd2.h | |
parent | f8ec9d6837241865cf99bed97bb99f4399fd5a03 (diff) |
ext4: Use slab allocator for sub-page sized allocations
Now that the SLUB seems to be fixed so that it respects the requested
alignment, use kmem_cache_alloc() to allocator if the block size of
the buffer heads to be allocated is less than the page size.
Previously, we were using 16k page on a Power system for each buffer,
even when the file system was using 1k or 4k block size.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'include/linux/jbd2.h')
-rw-r--r-- | include/linux/jbd2.h | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h index 638ce4554c76..8ada2a129d08 100644 --- a/include/linux/jbd2.h +++ b/include/linux/jbd2.h | |||
@@ -69,15 +69,8 @@ extern u8 jbd2_journal_enable_debug; | |||
69 | #define jbd_debug(f, a...) /**/ | 69 | #define jbd_debug(f, a...) /**/ |
70 | #endif | 70 | #endif |
71 | 71 | ||
72 | static inline void *jbd2_alloc(size_t size, gfp_t flags) | 72 | extern void *jbd2_alloc(size_t size, gfp_t flags); |
73 | { | 73 | extern void jbd2_free(void *ptr, size_t size); |
74 | return (void *)__get_free_pages(flags, get_order(size)); | ||
75 | } | ||
76 | |||
77 | static inline void jbd2_free(void *ptr, size_t size) | ||
78 | { | ||
79 | free_pages((unsigned long)ptr, get_order(size)); | ||
80 | }; | ||
81 | 74 | ||
82 | #define JBD2_MIN_JOURNAL_BLOCKS 1024 | 75 | #define JBD2_MIN_JOURNAL_BLOCKS 1024 |
83 | 76 | ||