Skip to content

Commit bded67f

Browse files
MiaoheLinakpm00
authored andcommitted
memory tier: rename destroy_memory_type() to put_memory_type()
It appears that destroy_memory_type() isn't a very good name because we usually will not free the memory_type here. So rename it to a more appropriate name i.e. put_memory_type(). Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Miaohe Lin <[email protected]> Suggested-by: Huang, Ying <[email protected]> Reviewed-by: "Huang, Ying" <[email protected]> Reviewed-by: Xiao Yang <[email protected]> Cc: Dan Williams <[email protected]> Cc: Dave Jiang <[email protected]> Cc: Vishal Verma <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent badbbcd commit bded67f

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

drivers/dax/kmem.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ static int __init dax_kmem_init(void)
264264
return rc;
265265

266266
error_dax_driver:
267-
destroy_memory_type(dax_slowmem_type);
267+
put_memory_type(dax_slowmem_type);
268268
err_dax_slowmem_type:
269269
kfree_const(kmem_name);
270270
return rc;
@@ -275,7 +275,7 @@ static void __exit dax_kmem_exit(void)
275275
dax_driver_unregister(&device_dax_kmem_driver);
276276
if (!any_hotremove_failed)
277277
kfree_const(kmem_name);
278-
destroy_memory_type(dax_slowmem_type);
278+
put_memory_type(dax_slowmem_type);
279279
}
280280

281281
MODULE_AUTHOR("Intel Corporation");

include/linux/memory-tiers.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ struct memory_dev_type {
3333
#ifdef CONFIG_NUMA
3434
extern bool numa_demotion_enabled;
3535
struct memory_dev_type *alloc_memory_type(int adistance);
36-
void destroy_memory_type(struct memory_dev_type *memtype);
36+
void put_memory_type(struct memory_dev_type *memtype);
3737
void init_node_memory_type(int node, struct memory_dev_type *default_type);
3838
void clear_node_memory_type(int node, struct memory_dev_type *memtype);
3939
#ifdef CONFIG_MIGRATION
@@ -68,7 +68,7 @@ static inline struct memory_dev_type *alloc_memory_type(int adistance)
6868
return NULL;
6969
}
7070

71-
static inline void destroy_memory_type(struct memory_dev_type *memtype)
71+
static inline void put_memory_type(struct memory_dev_type *memtype)
7272
{
7373

7474
}

mm/memory-tiers.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -560,11 +560,11 @@ struct memory_dev_type *alloc_memory_type(int adistance)
560560
}
561561
EXPORT_SYMBOL_GPL(alloc_memory_type);
562562

563-
void destroy_memory_type(struct memory_dev_type *memtype)
563+
void put_memory_type(struct memory_dev_type *memtype)
564564
{
565565
kref_put(&memtype->kref, release_memtype);
566566
}
567-
EXPORT_SYMBOL_GPL(destroy_memory_type);
567+
EXPORT_SYMBOL_GPL(put_memory_type);
568568

569569
void init_node_memory_type(int node, struct memory_dev_type *memtype)
570570
{
@@ -586,7 +586,7 @@ void clear_node_memory_type(int node, struct memory_dev_type *memtype)
586586
*/
587587
if (!node_memory_types[node].map_count) {
588588
node_memory_types[node].memtype = NULL;
589-
destroy_memory_type(memtype);
589+
put_memory_type(memtype);
590590
}
591591
mutex_unlock(&memory_tier_lock);
592592
}

0 commit comments

Comments
 (0)