Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
0002 /*
0003  * Copyright (c) 2017-2019 Mellanox Technologies. All rights reserved.
0004  */
0005 
0006 #ifndef _RDMA_CORE_RESTRACK_H_
0007 #define _RDMA_CORE_RESTRACK_H_
0008 
0009 #include <linux/mutex.h>
0010 
0011 /**
0012  * struct rdma_restrack_root - main resource tracking management
0013  * entity, per-device
0014  */
0015 struct rdma_restrack_root {
0016     /**
0017      * @xa: Array of XArray structure to hold restrack entries.
0018      */
0019     struct xarray xa;
0020     /**
0021      * @next_id: Next ID to support cyclic allocation
0022      */
0023     u32 next_id;
0024 };
0025 
0026 int rdma_restrack_init(struct ib_device *dev);
0027 void rdma_restrack_clean(struct ib_device *dev);
0028 void rdma_restrack_add(struct rdma_restrack_entry *res);
0029 void rdma_restrack_del(struct rdma_restrack_entry *res);
0030 void rdma_restrack_new(struct rdma_restrack_entry *res,
0031                enum rdma_restrack_type type);
0032 void rdma_restrack_set_name(struct rdma_restrack_entry *res,
0033                 const char *caller);
0034 void rdma_restrack_parent_name(struct rdma_restrack_entry *dst,
0035                    const struct rdma_restrack_entry *parent);
0036 #endif /* _RDMA_CORE_RESTRACK_H_ */