]> git.baikalelectronics.ru Git - kernel.git/commit
Cache root in nameidata
authorAl Viro <viro@zeniv.linux.org.uk>
Tue, 7 Apr 2009 15:49:53 +0000 (11:49 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Fri, 12 Jun 2009 01:35:59 +0000 (21:35 -0400)
commit5feb2dbb84f7751028ac8517f9e149c51643057d
treed4a8c5d7da4624c4a8973a4c9369af7a915dca05
parentd4250bb3cb9b343fe6553ae942cb07ca035585ab
Cache root in nameidata

New field: nd->root.  When pathname resolution wants to know the root,
check if nd->root.mnt is non-NULL; use nd->root if it is, otherwise
copy current->fs->root there.  After path_walk() is finished, we check
if we'd got a cached value in nd->root and drop it.  Before calling
path_walk() we should either set nd->root.mnt to NULL *or* copy (and
pin down) some path to nd->root.  In the latter case we won't be
looking at current->fs->root at all.

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