diff options
| author | NeilBrown <neil@brown.name> | 2026-02-25 09:16:54 +1100 |
|---|---|---|
| committer | Christian Brauner <brauner@kernel.org> | 2026-03-06 10:24:12 +0100 |
| commit | 2c3a9eb1b4f711c00c4358c16a036a2390d9e57c (patch) | |
| tree | 48f67bbd2acb9ade546e824d07980079b433f034 /rust/kernel/gpu/git@git.tavy.me:linux-stable.git | |
| parent | 336faf5d9115ca6982b82cf122e68738ea8c4173 (diff) | |
ovl: Simplify ovl_lookup_real_one()
The primary purpose of this patch is to remove the locking from
ovl_lookup_real_one() as part of centralising all locking of directories
for name operations.
The locking here isn't needed. By performing consistency tests after
the lookup we can be sure that the result of the lookup was valid at
least for a moment, which is all the original code promised.
lookup_noperm_unlocked() is used for the lookup and it will take the
lock if needed only where it is needed.
Also:
- don't take a reference to real->d_parent. The parent is
only use for a pointer comparison, and no reference is needed for
that.
- Several "if" statements have a "goto" followed by "else" - the
else isn't needed: the following statement can directly follow
the "if" as a new statement
- Use a consistent pattern of setting "err" before performing a test
and possibly going to "fail".
- remove the "out" label (now that we don't need to dput(parent) or
unlock) and simply return from fail:.
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: NeilBrown <neil@brown.name>
Link: https://patch.msgid.link/20260224222542.3458677-10-neilb@ownmail.net
Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'rust/kernel/gpu/git@git.tavy.me:linux-stable.git')
0 files changed, 0 insertions, 0 deletions
