summaryrefslogtreecommitdiffstats
path: root/fs/ext4/ioctl.c
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@redhat.com>2013-10-17 21:34:21 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2013-11-09 00:16:38 -0500
commitf27c9298fd717e1f7e63e314a7a85a3a7e77139d (patch)
treeba217e7745e5c0d7e0279a5d7ddb79cb1a03662b /fs/ext4/ioctl.c
parentefbf201f7a0be7ffc6532e672fbccb0eed4f5de0 (diff)
downloadlinux-f27c9298fd717e1f7e63e314a7a85a3a7e77139d.tar.bz2
exportfs: fix quadratic behavior in filehandle lookup
Suppose we're given the filehandle for a directory whose closest ancestor in the dcache is its Nth ancestor. The main loop in reconnect_path searches for an IS_ROOT ancestor of target_dir, reconnects that ancestor to its parent, then recommences the search for an IS_ROOT ancestor from target_dir. This behavior is quadratic in N. And there's really no need to restart the search from target_dir each time: once a directory has been looked up, it won't become IS_ROOT again. So instead of starting from target_dir each time, we can continue where we left off. This simplifies the code and improves performance on very deep directory heirachies. (I can't think of any reason anyone should need heirarchies a hundred or more deep, but the performance improvement may be valuable if only to limit damage in case of abuse.) Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: J. Bruce Fields <bfields@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/ext4/ioctl.c')
0 files changed, 0 insertions, 0 deletions