]> git.baikalelectronics.ru Git - kernel.git/commit
vfs: embed struct filename inside of names_cache allocation if possible
authorJeff Layton <jlayton@redhat.com>
Wed, 10 Oct 2012 20:43:13 +0000 (16:43 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Sat, 13 Oct 2012 00:15:10 +0000 (20:15 -0400)
commit62327f5e79ed9d7ccbf6aa38fc6d4725a511a82f
treeb07bcf28bf0fc3bdc610595287250c3c3a3d974a
parentfd676489b3f1dae84e2acf9d891a5ff30d34edc9
vfs: embed struct filename inside of names_cache allocation if possible

In the common case where a name is much smaller than PATH_MAX, an extra
allocation for struct filename is unnecessary. Before allocating a
separate one, try to embed the struct filename inside the buffer first. If
it turns out that that's not long enough, then fall back to allocating a
separate struct filename and redoing the copy.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/namei.c
include/linux/fs.h