]> git.baikalelectronics.ru Git - kernel.git/commit
GFS2: Use kmalloc when possible for ->readdir()
authorSteven Whitehouse <swhiteho@redhat.com>
Wed, 28 Jul 2010 16:56:23 +0000 (17:56 +0100)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 28 Jul 2010 18:10:03 +0000 (11:10 -0700)
commita491e7ee67345a108f3a1da137d97317bbe5191e
treef9ac90f438bb3221a6e383e7f1c9c817e95ad44b
parent778fb3c0904925de0d79d149c8348158672b7006
GFS2: Use kmalloc when possible for ->readdir()

If we don't need a huge amount of memory in ->readdir() then
we can use kmalloc rather than vmalloc to allocate it. This
should cut down on the greater overheads associated with
vmalloc for smaller directories.

We may be able to eliminate vmalloc entirely at some stage,
but this is easy to do right away.

Also using GFP_NOFS to avoid any issues wrt to deleting inodes
while under a glock, and suggestion from Linus to factor out
the alloc/dealloc.

I've given this a test with a variety of different sized
directories and it seems to work ok.

Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Nick Piggin <npiggin@suse.de>
Cc: Prarit Bhargava <prarit@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/gfs2/dir.c