summaryrefslogtreecommitdiff
path: root/include/linux/namei.h
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2011-03-11 12:44:53 +0300
committerAl Viro <viro@zeniv.linux.org.uk>2011-03-14 16:15:27 +0300
commit5a18fff2090c3af830d699c8ccb230498a1e37e5 (patch)
tree388675113818a8d14e7cd7dc25185e1be55354f9 /include/linux/namei.h
parent40b39136f07279fdc868a36cba050f4e84ce0ace (diff)
downloadlinux-5a18fff2090c3af830d699c8ccb230498a1e37e5.tar.xz
untangle do_lookup()
That thing has devolved into rats nest of gotos; sane use of unlikely() gets rid of that horror and gives much more readable structure: * make a fast attempt to find a dentry; false negatives are OK. In RCU mode if everything went fine, we are done, otherwise just drop out of RCU. If we'd done (RCU) ->d_revalidate() and it had not refused outright (i.e. didn't give us -ECHILD), remember its result. * now we are not in RCU mode and hopefully have a dentry. If we do not, lock parent, do full d_lookup() and if that has not found anything, allocate and call ->lookup(). If we'd done that ->lookup(), remember that dentry is good and we don't need to revalidate it. * now we have a dentry. If it has ->d_revalidate() and we can't skip it, call it. * hopefully dentry is good; if not, either fail (in case of error) or try to invalidate it. If d_invalidate() has succeeded, drop it and retry everything as if original attempt had not found a dentry. * now we can finish it up - deal with mountpoint crossing and automount. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include/linux/namei.h')
0 files changed, 0 insertions, 0 deletions