Re: [PATCH bpf-next v7 5/7] bpf: Implement bpf_local_storage for inodes

2020-08-03 Thread KP Singh
On 31.07.20 21:02, Martin KaFai Lau wrote: > On Fri, Jul 31, 2020 at 02:08:55PM +0200, KP Singh wrote: > [ ... ] +const struct bpf_map_ops inode_storage_map_ops = { [...] >> >> btf dump file /sys/kernel/btf/vmlinux | grep "STRUCT 'inode'" >> "[915] STRUCT 'inode' size=984 vlen=48 >> >>

Re: [PATCH bpf-next v7 5/7] bpf: Implement bpf_local_storage for inodes

2020-07-31 Thread Martin KaFai Lau
On Fri, Jul 31, 2020 at 02:08:55PM +0200, KP Singh wrote: [ ... ] > >> +const struct bpf_map_ops inode_storage_map_ops = { > >> + .map_alloc_check = bpf_local_storage_map_alloc_check, > >> + .map_alloc = inode_storage_map_alloc, > >> + .map_free = inode_storage_map_free, > >> +

Re: [PATCH bpf-next v7 5/7] bpf: Implement bpf_local_storage for inodes

2020-07-31 Thread KP Singh
On 31.07.20 03:08, Martin KaFai Lau wrote: > On Thu, Jul 30, 2020 at 04:07:14PM +0200, KP Singh wrote: >> From: KP Singh >> >> Similar to bpf_local_storage for sockets, add local storage for inodes. >> The life-cycle of storage is managed with the life-cycle of the inode. >> i.e. the storage

Re: [PATCH bpf-next v7 5/7] bpf: Implement bpf_local_storage for inodes

2020-07-30 Thread Martin KaFai Lau
On Thu, Jul 30, 2020 at 04:07:14PM +0200, KP Singh wrote: > From: KP Singh > > Similar to bpf_local_storage for sockets, add local storage for inodes. > The life-cycle of storage is managed with the life-cycle of the inode. > i.e. the storage is destroyed along with the owning inode. > > The

[PATCH bpf-next v7 5/7] bpf: Implement bpf_local_storage for inodes

2020-07-30 Thread KP Singh
From: KP Singh Similar to bpf_local_storage for sockets, add local storage for inodes. The life-cycle of storage is managed with the life-cycle of the inode. i.e. the storage is destroyed along with the owning inode. The BPF LSM allocates an __rcu pointer to the bpf_local_storage in the