Skip to contentSkip to conversation

maple_tree: export symbol mas_preallocate()

PATCH Applied Danilo Krummrich 5 participants 8 messages Mar 2, 2023 – Mar 8, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 maple_tree: export symbol mas_preallocate()

Fix missing EXPORT_SYMBOL_GPL() statement for mas_preallocate().

---
 lib/maple_tree.c | 1 +
 1 file changed, 1 insertion(+)
lib/maple_tree.c +1 -0
index 26e2045d3cda..3bfb8a6f3f6d 100644
@@ -5733,6 +5733,7 @@ int mas_preallocate(struct ma_state *mas, void *entry, gfp_t gfp)
 	mas_reset(mas);
 	return ret;
 }
+EXPORT_SYMBOL_GPL(mas_preallocate);
 
 /*
  * mas_destroy() - destroy a maple state.
Signature · 1 line
2.39.2
Reviewed-by on v1 1/1
#1 lore raw

Thanks for the patch. This should indeed be exported.

Quoted 22 lines · Danilo Krummrich

Fix missing EXPORT_SYMBOL_GPL() statement for mas_preallocate().

---
 lib/maple_tree.c | 1 +
 1 file changed, 1 insertion(+)
lib/maple_tree.c +1 -0
index 26e2045d3cda..3bfb8a6f3f6d 100644
@@ -5733,6 +5733,7 @@ int mas_preallocate(struct ma_state *mas, void *entry, gfp_t gfp)
 	mas_reset(mas);
 	return ret;
 }
+EXPORT_SYMBOL_GPL(mas_preallocate);
 
 /*
  * mas_destroy() - destroy a maple state.
Signature · 1 line
2.39.2
#2 lore raw
Quoted 3 lines · Liam R. Howlett

Thanks for the patch. This should indeed be exported.

What uses it? Don't we export only things used by in-kernel modules?

Quoted 24 lines · Danilo Krummrich
Quoted 22 lines

Fix missing EXPORT_SYMBOL_GPL() statement for mas_preallocate().

---
 lib/maple_tree.c | 1 +
 1 file changed, 1 insertion(+)
lib/maple_tree.c +1 -0
index 26e2045d3cda..3bfb8a6f3f6d 100644
@@ -5733,6 +5733,7 @@ int mas_preallocate(struct ma_state *mas, void *entry, gfp_t gfp)
 	mas_reset(mas);
 	return ret;
 }
+EXPORT_SYMBOL_GPL(mas_preallocate);
 
 /*
  * mas_destroy() - destroy a maple state.
Signature · 1 line
2.39.2
#3 lore raw
Quoted 6 lines · Vlastimil Babka
Quoted 3 lines · Liam R. Howlett

Thanks for the patch. This should indeed be exported.

What uses it? Don't we export only things used by in-kernel modules?

mas_preallocate() is part of the maple tree's 'Advanced API'. All other functions of this API are exported already.

More specifically, e.g. mas_store_prealloc() is exported which doesn't make a lot of sense without mas_preallocate() being available too.

I don't think it is used outside of mm yet, but as a generic tree implementation maple tree is pretty likely to be used in code built as module, e.g. drivers.

Quoted 26 lines
Quoted 25 lines · Danilo Krummrich
Quoted 22 lines

Fix missing EXPORT_SYMBOL_GPL() statement for mas_preallocate().

---
  lib/maple_tree.c | 1 +
  1 file changed, 1 insertion(+)
lib/maple_tree.c +1 -0
index 26e2045d3cda..3bfb8a6f3f6d 100644
@@ -5733,6 +5733,7 @@ int mas_preallocate(struct ma_state *mas, void *entry, gfp_t gfp)
  	mas_reset(mas);
  	return ret;
  }
+EXPORT_SYMBOL_GPL(mas_preallocate);
 
  /*
   * mas_destroy() - destroy a maple state.
Signature · 1 line
2.39.2
#4 lore raw
Quoted 11 lines · Danilo Krummrich
Quoted 6 lines · Vlastimil Babka
Quoted 3 lines · Liam R. Howlett

Thanks for the patch. This should indeed be exported.

What uses it? Don't we export only things used by in-kernel modules?

mas_preallocate() is part of the maple tree's 'Advanced API'. All other functions of this API are exported already.

Quoted 6 lines

More specifically, e.g. mas_store_prealloc() is exported which doesn't make a lot of sense without mas_preallocate() being available too.

I don't think it is used outside of mm yet, but as a generic tree implementation maple tree is pretty likely to be used in code built as module, e.g. drivers.

If anyone wants to use they can add the export as needed.

#5 lore raw
Quoted 12 lines · Christoph Hellwig
Quoted 11 lines · Danilo Krummrich
Quoted 6 lines · Vlastimil Babka
Quoted 3 lines · Liam R. Howlett

Thanks for the patch. This should indeed be exported.

What uses it? Don't we export only things used by in-kernel modules?

mas_preallocate() is part of the maple tree's 'Advanced API'. All other functions of this API are exported already.

Quoted 9 lines
Quoted 6 lines

More specifically, e.g. mas_store_prealloc() is exported which doesn't make a lot of sense without mas_preallocate() being available too.

I don't think it is used outside of mm yet, but as a generic tree implementation maple tree is pretty likely to be used in code built as module, e.g. drivers.

If anyone wants to use they can add the export as needed.

Valid perception, though personally I wouldn't share it in this specific case.

Anyway, it's just that all other functions of the 'Advanced API' are exported already without them having other users than mm either, e.g. mas_store_prealloc() can't be used without mas_preallocate(), hence exporting one, but not the other doesn't really make sense.

Consistency wise I think we should either also export mas_preallocate() or don't export the other ones either.

#6 lore raw
Quoted 2 lines · Danilo Krummrich

Consistency wise I think we should either also export mas_preallocate() or don't export the other ones either.

Please send a patch to drop all unused exports.

#7 lore raw
Quoted 5 lines · Christoph Hellwig
Quoted 2 lines · Danilo Krummrich

Consistency wise I think we should either also export mas_preallocate() or don't export the other ones either.

Please send a patch to drop all unused exports.

While that's usually a good rule, it just creates unnecessary friction in this kind of case -- a set of library functions which have only been introduced in the last few months. If they're still unused in a year, sure, let's get rid of the exports.