]> git.michaelhowe.org Git - packages/o/openafs.git/commit
namei: Limit traversal when removing data dirs
authorAndrew Deason <adeason@sinenomine.net>
Thu, 2 Sep 2010 20:05:21 +0000 (15:05 -0500)
committerDerrick Brashear <shadow@dementia.org>
Wed, 8 Sep 2010 17:47:14 +0000 (10:47 -0700)
commit1ca0a24775794ba2e645854a3bbaa656f2fc8086
tree798ad2d24b39f92f33104f5ebaa50b3be2a5e319
parent41acfb91fa7fefae1f9a69aadc187a1403ec5827
namei: Limit traversal when removing data dirs

namei_RemoveDataDirectories currently calls delTree with 'tree'
pointing to the part of the path immediately following n_base (i.e.
starting at the beginning of n_voldir1). This causes delTree to
traverse all of n_voldir1, trying to delete every directory it finds.

Since we are typically only trying to remove a single volume when
calling namei_RemoveDataDirectories, instead call delTree with 'tree'
pointing to immediately after n_voldir1, and beginning at n_voldir2
and try to just rmdir n_voldir1 afterwards. This way, we do not
traverse a large fraction of the entire partition when just trying to
delete a single volume, and so can significantly speed up volume
removals.

Change-Id: I79d69e7f3d1b691ec1d55e02ee5e93c0a927cffe
Reviewed-on: http://gerrit.openafs.org/2651
Tested-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
src/vol/namei_ops.c