Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

fs: touch up predicts in putname()

1. we already expect the refcount is 1.
2. path creation predicts name == iname

I verified this straightens out the asm, no functional changes.

Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
Link: https://patch.msgid.link/20251029134952.658450-1-mjguzik@gmail.com
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christian Brauner <brauner@kernel.org>

authored by

Mateusz Guzik and committed by
Christian Brauner
20052f2e 0bbb838f

+2 -2
+2 -2
fs/namei.c
··· 282 282 return; 283 283 284 284 refcnt = atomic_read(&name->refcnt); 285 - if (refcnt != 1) { 285 + if (unlikely(refcnt != 1)) { 286 286 if (WARN_ON_ONCE(!refcnt)) 287 287 return; 288 288 ··· 290 290 return; 291 291 } 292 292 293 - if (name->name != name->iname) { 293 + if (unlikely(name->name != name->iname)) { 294 294 __putname(name->name); 295 295 kfree(name); 296 296 } else