lookup_one_p...ive_killable(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… lookup_one_positive_killable β€” Kernel API Manual ✨

okay so bestie, buckle up, because we're looking at lookup_one_positive_killable(9) from the Kernel API Manual. yes the title is a whole mouthful, i know, but it's iconic and we're gonna get through it together 🫢


🌸 NAME 🌸

lookup_one_positive_killable β€” lookup single pathname component. that's it. that's the whole vibe. one component, no cap πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

struct dentry * lookup_one_positive_killable (struct mnt_idmap *idmap ,
struct qstr *name , struct dentry *base );

look at her go. three args, one struct dentry * return, main character energy fr fr πŸ‘‘


πŸ¦‹ ARGUMENTS πŸ¦‹

  • idmap β€” the idmap of the mount that the lookup is being performed from. like, which mount are we even doing this from, bestie? this tells you 🌈
  • name β€” the qstr olding pathname component to lookup. literally just the one component, not the whole path, we're being specific here πŸ’–
  • base β€” the base directory to lookup from. your starting point, your home base, your safe space 🏠

⭐ DESCRIPTION ⭐

so here's the tea 🍡: this helper will yield ERR_PTR(-ENOENT) on negatives. yep. it returns known positive or ERR_PTR. and honestly? that's what most of the users want. it's giving "no surprises" and we love that for us ✨

⚠️ okay important one: a pinned negative with an unlocked parent _can_ become positive at any time 😭 so callers of lookup_one_unlocked need to be very careful. meanwhile pinned positives have >d_inode stable, so this one avoids such problems. she said "not me having that bug" and honestly? slay πŸ™ˆ

this can be used for in-kernel filesystem clients such as file servers. very much "in the kernel, doing kernel things" energy 🧚

it should be called without the parent i_rwsem held, and it will take the i_rwsem itself if necessary β€” she's independent like that πŸ’… and if a fatal signal is pending or delivered, it will return -EINTR if the lock is needed. periodt.


πŸ”₯ RETURN πŸ”₯

a dentry, possibly negative, OR:

  • same errors as lookup_one_unlocked, or
  • ERR_PTR(-EINTR) if a fatal signal is pending.

so yeah, you get a dentry or you get an error pointer. no in-between, no crumbs πŸ’€


πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./fs/namei.c β€” and the whole entire friend group, because this function knows literally everyone:

like i said. the whole group chat πŸ«ΆπŸ’œ


and that's the page!! sign-off time: this came from ./fs, dated October 2026, and it's lookup_one_p...ive_killable(9) in case you need to find her again. bye bestie, go look up exactly one pathname component πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from