diff options
author | Tejun Heo <tj@kernel.org> | 2019-11-04 15:54:30 -0800 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2019-11-12 08:18:04 -0800 |
commit | 40430452fd5da1509177ac597b394614cd3a121f (patch) | |
tree | 0d1b300c769f24ac59de54981bb9e785b90a111b /kernel/cgroup | |
parent | 33c5ac9175195c36a0b7005aaf503a2e81f117a1 (diff) | |
download | linux-40430452fd5da1509177ac597b394614cd3a121f.tar.bz2 |
kernfs: use 64bit inos if ino_t is 64bit
Each kernfs_node is identified with a 64bit ID. The low 32bit is
exposed as ino and the high gen. While this already allows using inos
as keys by looking up with wildcard generation number of 0, it's
adding unnecessary complications for 64bit ino archs which can
directly use kernfs_node IDs as inos to uniquely identify each cgroup
instance.
This patch exposes IDs directly as inos on 64bit ino archs. The
conversion is mostly straight-forward.
* 32bit ino archs behave the same as before. 64bit ino archs now use
the whole 64bit ID as ino and the generation number is fixed at 1.
* 64bit inos still use the same idr allocator which gurantees that the
lower 32bits identify the current live instance uniquely and the
high 32bits are incremented whenever the low bits wrap. As the
upper 32bits are no longer used as gen and we don't wanna start ino
allocation with 33rd bit set, the initial value for highbits
allocation is changed to 0 on 64bit ino archs.
* blktrace exposes two 32bit numbers - (INO,GEN) pair - to identify
the issuing cgroup. Userland builds FILEID_INO32_GEN fids from
these numbers to look up the cgroups. To remain compatible with the
behavior, always output (LOW32,HIGH32) which will be constructed
back to the original 64bit ID by __kernfs_fh_to_dentry().
Signed-off-by: Tejun Heo <tj@kernel.org>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Diffstat (limited to 'kernel/cgroup')
0 files changed, 0 insertions, 0 deletions