Skip to content
Snippets Groups Projects
Commit 4425c1d9 authored by Seamus Connor's avatar Seamus Connor Committed by Christoph Hellwig
Browse files

configfs: improve item creation performance


As the size of a directory increases item creation slows down.
Optimizing access to s_children removes this bottleneck.

dirents are already pinned into the cache, there is no need to scan the
s_children list looking for duplicate Items. The configfs_dirent_exists
check is moved to a location where it is called only during subsystem
initialization.

d_lookup will only need to call configfs_lookup in the case where the
item in question is not pinned to dcache. The only items not pinned to
dcache are attributes. These are placed at the front of the s_children
list, whilst pinned items are inserted at the back. configfs_lookup
stops scanning when it encounters the first pinned entry in s_children.

The assumption of the above optimizations is that there will be few
attributes, but potentially many Items in a given directory.

Signed-off-by: default avatarSeamus Connor <sconnor@purestorage.com>
Reviewed-by: default avatarJoel Becker <jlbec@evilplan.org>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent 58720809
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment