What is the difference between Page cache and Buffer cache?
in buffer.c, the following function create the buffer cache
(&alloc_page_buffer() as well):
struct buffer_head *alloc_buffer_head(gfp_t gfp_flags)
{
struct buffer_head *ret = kmem_cache_alloc(bh_cachep,
set_migrateflags(gfp_flags, __GFP_RECLAIMABLE));
if (ret) {
INIT_LIST_HEAD(&ret->b_assoc_buffers);
get_cpu_var(bh_accounting).nr++;
recalc_bh_state();
put_cpu_var(bh_accounting);
}
return ret;
}
In /proc/slabinfo it appeared as "buffer_head".
Tracing for the caller of alloc_buffer_head() and alloc_page_buffer(),
it seemed that it is only used for journalling: jbd2/jbd/gfs:
./jbd2/journal.c:
new_bh = alloc_buffer_head(GFP_NOFS|__GFP_NOFAIL);
./gfs2/log.c:
bh = alloc_buffer_head(GFP_NOFS | __GFP_NOFAIL);
./jbd/journal.c:
new_bh = alloc_buffer_head(GFP_NOFS|__GFP_NOFAIL);
./ntfs/mft.c:
bh = head = alloc_page_buffers(page, blocksize, 1);
./ntfs/aops.c:
bh = head = alloc_page_buffers(page, bh_size, 1);
Don't really understand why it can't use page cache instead?
--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to [EMAIL PROTECTED]
Please read the FAQ at http://kernelnewbies.org/FAQ