diff options
author | Jason Gunthorpe <[email protected]> | 2022-09-23 11:26:52 +0200 |
---|---|---|
committer | Alex Williamson <[email protected]> | 2022-10-04 12:06:58 -0600 |
commit | 9c799c224d6ebc5be51065bd3217a2d7eea23b8f (patch) | |
tree | d09166f170afc9fc32ecfe8205964a6257b81990 /tools/testing/selftests/bpf/prog_tests/prog_array_init.c | |
parent | 685a1537f4c603cfcaf4b9be56ff6a571f7ddd08 (diff) |
vfio/mdev: add mdev available instance checking to the core
Many of the mdev drivers use a simple counter for keeping track of the
available instances. Move this code to the core code and store the counter
in the mdev_parent. Implement it using correct locking, fixing mdpy.
Drivers just provide the value in the mdev_driver at registration time
and the core code takes care of maintaining it and exposing the value in
sysfs.
[hch: count instances per-parent instead of per-type, use an atomic_t
to avoid taking mdev_list_lock in the show method]
Signed-off-by: Jason Gunthorpe <[email protected]>
Signed-off-by: Christoph Hellwig <[email protected]>
Reviewed-by: Kevin Tian <[email protected]>
Reviewed-by: Kirti Wankhede <[email protected]>
Reviewed-by: Eric Farman <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alex Williamson <[email protected]>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/prog_array_init.c')
0 files changed, 0 insertions, 0 deletions