0001
0002
0003
0004
0005
0006 #ifndef _MLX5_IB_FS_H
0007 #define _MLX5_IB_FS_H
0008
0009 #include "mlx5_ib.h"
0010
0011 #if IS_ENABLED(CONFIG_INFINIBAND_USER_ACCESS)
0012 int mlx5_ib_fs_init(struct mlx5_ib_dev *dev);
0013 #else
0014 static inline int mlx5_ib_fs_init(struct mlx5_ib_dev *dev)
0015 {
0016 dev->flow_db = kzalloc(sizeof(*dev->flow_db), GFP_KERNEL);
0017
0018 if (!dev->flow_db)
0019 return -ENOMEM;
0020
0021 mutex_init(&dev->flow_db->lock);
0022 return 0;
0023 }
0024 #endif
0025 static inline void mlx5_ib_fs_cleanup(struct mlx5_ib_dev *dev)
0026 {
0027 kfree(dev->flow_db);
0028 }
0029 #endif