fs: proc: store PDE()->data into inode->i_private
authorMuchun Song <songmuchun@bytedance.com>
Thu, 30 Dec 2021 09:29:46 +0000 (20:29 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 18 Jan 2022 01:50:15 +0000 (12:50 +1100)
commit2c05e9eabc52a33ce2d053f1b3a74a00d92d56e5
tree1bd2d8305bb64cba2ee8526246841b9c4c736ce8
parent2dc0d87f605f10641088c3db26dabb089933770a
fs: proc: store PDE()->data into inode->i_private

PDE_DATA(inode) is introduced to get user private data and hide the layout
of struct proc_dir_entry.  The inode->i_private is used to do the same
thing as well.  Save a copy of user private data to inode-> i_private when
proc inode is allocated.  This means the user also can get their private
data by inode->i_private.

Introduce pde_data() to wrap inode->i_private so that we can remove
PDE_DATA() from fs/proc/generic.c and make PTE_DATE() as a wrapper of
pde_data().  It will be easier if we decide to remove PDE_DATE() in the
future.

Link: https://lkml.kernel.org/r/20211124081956.87711-1-songmuchun@bytedance.com
Signed-off-by: Muchun Song <songmuchun@bytedance.com>
Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Alexey Gladkov <gladkov.alexey@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
fs/proc/generic.c
fs/proc/inode.c
fs/proc/internal.h
include/linux/proc_fs.h