]> git.baikalelectronics.ru Git - kernel.git/commit
kernfs: convert kernfs_node->id from union kernfs_node_id to u64
authorTejun Heo <tj@kernel.org>
Mon, 4 Nov 2019 23:54:30 +0000 (15:54 -0800)
committerTejun Heo <tj@kernel.org>
Tue, 12 Nov 2019 16:18:03 +0000 (08:18 -0800)
commit083ebd4a681e67cebf8ceb64bb964a8e8e06bfac
tree6932e986bdd7786fa8f18d4e7f832ef259d5c219
parent7915f8a155940cdb48cceb00339b36a21e4ffc5c
kernfs: convert kernfs_node->id from union kernfs_node_id to u64

kernfs_node->id is currently a union kernfs_node_id which represents
either a 32bit (ino, gen) pair or u64 value.  I can't see much value
in the usage of the union - all that's needed is a 64bit ID which the
current code is already limited to.  Using a union makes the code
unnecessarily complicated and prevents using 64bit ino without adding
practical benefits.

This patch drops union kernfs_node_id and makes kernfs_node->id a u64.
ino is stored in the lower 32bits and gen upper.  Accessors -
kernfs[_id]_ino() and kernfs[_id]_gen() - are added to retrieve the
ino and gen.  This simplifies ID handling less cumbersome and will
allow using 64bit inos on supported archs.

This patch doesn't make any functional changes.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Alexei Starovoitov <ast@kernel.org>
12 files changed:
fs/kernfs/dir.c
fs/kernfs/file.c
fs/kernfs/inode.c
fs/kernfs/mount.c
include/linux/cgroup.h
include/linux/kernfs.h
include/trace/events/writeback.h
kernel/bpf/helpers.c
kernel/bpf/local_storage.c
kernel/cgroup/cgroup.c
kernel/trace/blktrace.c
net/core/filter.c