mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 04:04:43 +01:00
pidfs: remove custom inode allocation
We don't need it anymore as persistent information is allocated lazily and stashed in struct pid. Link: https://lore.kernel.org/20250618-work-pidfs-persistent-v2-7-98f3456fd552@kernel.org Reviewed-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com> Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
parent
5ee83f8d1a
commit
0f93d71b9d
1 changed files with 0 additions and 39 deletions
39
fs/pidfs.c
39
fs/pidfs.c
|
|
@ -27,7 +27,6 @@
|
|||
|
||||
#define PIDFS_PID_DEAD ERR_PTR(-ESRCH)
|
||||
|
||||
static struct kmem_cache *pidfs_cachep __ro_after_init;
|
||||
static struct kmem_cache *pidfs_attr_cachep __ro_after_init;
|
||||
|
||||
/*
|
||||
|
|
@ -45,15 +44,6 @@ struct pidfs_attr {
|
|||
struct pidfs_exit_info *exit_info;
|
||||
};
|
||||
|
||||
struct pidfs_inode {
|
||||
struct inode vfs_inode;
|
||||
};
|
||||
|
||||
static inline struct pidfs_inode *pidfs_i(struct inode *inode)
|
||||
{
|
||||
return container_of(inode, struct pidfs_inode, vfs_inode);
|
||||
}
|
||||
|
||||
static struct rb_root pidfs_ino_tree = RB_ROOT;
|
||||
|
||||
#if BITS_PER_LONG == 32
|
||||
|
|
@ -686,27 +676,9 @@ static void pidfs_evict_inode(struct inode *inode)
|
|||
put_pid(pid);
|
||||
}
|
||||
|
||||
static struct inode *pidfs_alloc_inode(struct super_block *sb)
|
||||
{
|
||||
struct pidfs_inode *pi;
|
||||
|
||||
pi = alloc_inode_sb(sb, pidfs_cachep, GFP_KERNEL);
|
||||
if (!pi)
|
||||
return NULL;
|
||||
|
||||
return &pi->vfs_inode;
|
||||
}
|
||||
|
||||
static void pidfs_free_inode(struct inode *inode)
|
||||
{
|
||||
kfree(pidfs_i(inode));
|
||||
}
|
||||
|
||||
static const struct super_operations pidfs_sops = {
|
||||
.alloc_inode = pidfs_alloc_inode,
|
||||
.drop_inode = generic_delete_inode,
|
||||
.evict_inode = pidfs_evict_inode,
|
||||
.free_inode = pidfs_free_inode,
|
||||
.statfs = simple_statfs,
|
||||
};
|
||||
|
||||
|
|
@ -1067,19 +1039,8 @@ void pidfs_put_pid(struct pid *pid)
|
|||
dput(pid->stashed);
|
||||
}
|
||||
|
||||
static void pidfs_inode_init_once(void *data)
|
||||
{
|
||||
struct pidfs_inode *pi = data;
|
||||
|
||||
inode_init_once(&pi->vfs_inode);
|
||||
}
|
||||
|
||||
void __init pidfs_init(void)
|
||||
{
|
||||
pidfs_cachep = kmem_cache_create("pidfs_cache", sizeof(struct pidfs_inode), 0,
|
||||
(SLAB_HWCACHE_ALIGN | SLAB_RECLAIM_ACCOUNT |
|
||||
SLAB_ACCOUNT | SLAB_PANIC),
|
||||
pidfs_inode_init_once);
|
||||
pidfs_attr_cachep = kmem_cache_create("pidfs_attr_cache", sizeof(struct pidfs_attr), 0,
|
||||
(SLAB_HWCACHE_ALIGN | SLAB_RECLAIM_ACCOUNT |
|
||||
SLAB_ACCOUNT | SLAB_PANIC), NULL);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue