diff options
| author | Al Viro <viro@zeniv.linux.org.uk> | 2025-03-03 19:38:04 -0500 |
|---|---|---|
| committer | Al Viro <viro@zeniv.linux.org.uk> | 2025-11-16 01:35:01 -0500 |
| commit | bacdf1d70bbe2027619c7bbbe48b379a806a9678 (patch) | |
| tree | 6f36381b620624ff072af66f7128dcb16ab56698 /drivers/base/devtmpfs.c | |
| parent | 8a210cacf5dc2a6210ee42aeca5cd03b2400876f (diff) | |
primitives for maintaining persisitency
* d_make_persistent(dentry, inode) - bump refcount, mark persistent and
make hashed positive. Return value is a borrowed reference to dentry;
it can be used until something removes persistency (at the very least,
until the parent gets unlocked, but some filesystems may have stronger
exclusion).
* d_make_discardable() - remove persistency mark and drop reference.
d_make_persistent() is similar to combination of d_instantiate(), dget()
and setting flag. The only difference is that unlike d_instantiate()
it accepts hashed and unhashed negatives alike. It is always called in
strong locking environment (parent held exclusive, or, in some cases,
dentry coming from d_alloc_name()); if we ever start using it with parent
held only shared and dentry coming from d_alloc_parallel(), we'll need
to copy the in-lookup logics from __d_add().
d_make_discardable() is eqiuvalent to combination of removing flag and
dput(); since flag removal requires ->d_lock, there's no point trying
to avoid taking that for refcount decrement as fast_dput() does.
The slow path of dput() has been taken into a helper and reused in
d_make_discardable() instead.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers/base/devtmpfs.c')
0 files changed, 0 insertions, 0 deletions