]> git.baikalelectronics.ru Git - kernel.git/commit
IB/uverbs: Add helper to get array size from ptr attribute
authorMoni Shoua <monis@mellanox.com>
Tue, 11 Dec 2018 11:37:51 +0000 (13:37 +0200)
committerJason Gunthorpe <jgg@mellanox.com>
Tue, 18 Dec 2018 22:19:45 +0000 (15:19 -0700)
commitdf6d2cd43619e5ec2cacef992d975f36f52a7e91
treebb71aec3b5960f8ab4ad74b1a77c1819b8ddc7dc
parent553436d18c6be3c33d0fafb149e15439d368bb06
IB/uverbs: Add helper to get array size from ptr attribute

When the parser of an ioctl command has the knowledge that a ptr attribute
in a bundle represents an array of structures, it is useful for it to know
the number of elements in the array. This is done by dividing the
attribute length with the element size.

Signed-off-by: Moni Shoua <monis@mellanox.com>
Reviewed-by: Guy Levi <guyle@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/mlx5/flow.c
include/rdma/uverbs_ioctl.h