hw/9pfs: avoid 'path' copy in v9fs_walk()
authorChristian Schoenebeck <qemu_oss@crudebyte.com>
Tue, 17 Aug 2021 12:38:24 +0000 (14:38 +0200)
committerChristian Schoenebeck <qemu_oss@crudebyte.com>
Thu, 2 Sep 2021 11:26:22 +0000 (13:26 +0200)
commit97b1d8fdf6c923203968f44805e25dc92b11a317
treeacbce5a9c88e471202570be16eae66421ae07560
parent59a89510b62ec23dbeab8b02fa4e3526e353d8b6
hw/9pfs: avoid 'path' copy in v9fs_walk()

The v9fs_walk() function resolves all client submitted path nodes to the
local 'pathes' array. Using a separate string scalar variable 'path'
inside the background worker thread loop and copying that local 'path'
string scalar variable subsequently to the 'pathes' array (at the end of
each loop iteration) is not necessary.

Instead simply resolve each path directly to the 'pathes' array and
don't use the string scalar variable 'path' inside the fs worker thread
loop at all.

The only advantage of the 'path' scalar was that in case of an error
the respective 'pathes' element would not be filled. Right now this is
not an issue as the v9fs_walk() function returns as soon as any error
occurs.

Suggested-by: Greg Kurz <groug@kaod.org>
Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
Message-Id: <7dacbecf25b2c9b4a0ce12d689a8a535f09a31e3.1629208359.git.qemu_oss@crudebyte.com>
hw/9pfs/9p.c