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.

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>

-39
-39
fs/pidfs.c
··· 27 27 28 28 #define PIDFS_PID_DEAD ERR_PTR(-ESRCH) 29 29 30 - static struct kmem_cache *pidfs_cachep __ro_after_init; 31 30 static struct kmem_cache *pidfs_attr_cachep __ro_after_init; 32 31 33 32 /* ··· 43 44 struct pidfs_exit_info __pei; 44 45 struct pidfs_exit_info *exit_info; 45 46 }; 46 - 47 - struct pidfs_inode { 48 - struct inode vfs_inode; 49 - }; 50 - 51 - static inline struct pidfs_inode *pidfs_i(struct inode *inode) 52 - { 53 - return container_of(inode, struct pidfs_inode, vfs_inode); 54 - } 55 47 56 48 static struct rb_root pidfs_ino_tree = RB_ROOT; 57 49 ··· 676 686 put_pid(pid); 677 687 } 678 688 679 - static struct inode *pidfs_alloc_inode(struct super_block *sb) 680 - { 681 - struct pidfs_inode *pi; 682 - 683 - pi = alloc_inode_sb(sb, pidfs_cachep, GFP_KERNEL); 684 - if (!pi) 685 - return NULL; 686 - 687 - return &pi->vfs_inode; 688 - } 689 - 690 - static void pidfs_free_inode(struct inode *inode) 691 - { 692 - kfree(pidfs_i(inode)); 693 - } 694 - 695 689 static const struct super_operations pidfs_sops = { 696 - .alloc_inode = pidfs_alloc_inode, 697 690 .drop_inode = generic_delete_inode, 698 691 .evict_inode = pidfs_evict_inode, 699 - .free_inode = pidfs_free_inode, 700 692 .statfs = simple_statfs, 701 693 }; 702 694 ··· 1039 1067 dput(pid->stashed); 1040 1068 } 1041 1069 1042 - static void pidfs_inode_init_once(void *data) 1043 - { 1044 - struct pidfs_inode *pi = data; 1045 - 1046 - inode_init_once(&pi->vfs_inode); 1047 - } 1048 - 1049 1070 void __init pidfs_init(void) 1050 1071 { 1051 - pidfs_cachep = kmem_cache_create("pidfs_cache", sizeof(struct pidfs_inode), 0, 1052 - (SLAB_HWCACHE_ALIGN | SLAB_RECLAIM_ACCOUNT | 1053 - SLAB_ACCOUNT | SLAB_PANIC), 1054 - pidfs_inode_init_once); 1055 1072 pidfs_attr_cachep = kmem_cache_create("pidfs_attr_cache", sizeof(struct pidfs_attr), 0, 1056 1073 (SLAB_HWCACHE_ALIGN | SLAB_RECLAIM_ACCOUNT | 1057 1074 SLAB_ACCOUNT | SLAB_PANIC), NULL);