File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -1958,7 +1958,7 @@ struct bpf_struct_ops_common_value {
19581958 __register_bpf_struct_ops(st_ops); \
19591959 })
19601960#define BPF_MODULE_OWNER ((void *)((0xeB9FUL << 2) + POISON_POINTER_DELTA))
1961- bool bpf_struct_ops_get (const void * kdata );
1961+ struct bpf_map * bpf_struct_ops_get (const void * kdata );
19621962void bpf_struct_ops_put (const void * kdata );
19631963int bpf_struct_ops_supported (const struct bpf_struct_ops * st_ops , u32 moff );
19641964int bpf_struct_ops_map_sys_lookup_elem (struct bpf_map * map , void * key ,
@@ -1973,7 +1973,7 @@ void bpf_struct_ops_image_free(void *image);
19731973static inline bool bpf_try_module_get (const void * data , struct module * owner )
19741974{
19751975 if (owner == BPF_MODULE_OWNER )
1976- return bpf_struct_ops_get (data );
1976+ return ! IS_ERR ( bpf_struct_ops_get (data ) );
19771977 else
19781978 return try_module_get (owner );
19791979}
Original file line number Diff line number Diff line change @@ -1150,7 +1150,7 @@ const struct bpf_map_ops bpf_struct_ops_map_ops = {
11501150/* "const void *" because some subsystem is
11511151 * passing a const (e.g. const struct tcp_congestion_ops *)
11521152 */
1153- bool bpf_struct_ops_get (const void * kdata )
1153+ struct bpf_map * bpf_struct_ops_get (const void * kdata )
11541154{
11551155 struct bpf_struct_ops_value * kvalue ;
11561156 struct bpf_struct_ops_map * st_map ;
@@ -1159,9 +1159,9 @@ bool bpf_struct_ops_get(const void *kdata)
11591159 kvalue = container_of (kdata , struct bpf_struct_ops_value , data );
11601160 st_map = container_of (kvalue , struct bpf_struct_ops_map , kvalue );
11611161
1162- map = __bpf_map_inc_not_zero (& st_map -> map , false);
1163- return !IS_ERR (map );
1162+ return __bpf_map_inc_not_zero (& st_map -> map , false);
11641163}
1164+ EXPORT_SYMBOL_GPL (bpf_struct_ops_get );
11651165
11661166void bpf_struct_ops_put (const void * kdata )
11671167{
@@ -1173,6 +1173,7 @@ void bpf_struct_ops_put(const void *kdata)
11731173
11741174 bpf_map_put (& st_map -> map );
11751175}
1176+ EXPORT_SYMBOL_GPL (bpf_struct_ops_put );
11761177
11771178static bool bpf_struct_ops_valid_to_reg (struct bpf_map * map )
11781179{
You can’t perform that action at this time.
0 commit comments