History

mm/memory_hotplug: move and simplify walk_memory_blocks()

Let's move walk_memory_blocks() to the place where memory block logic resides and simplify it. While at it, add a type for the callback function.

David Hildenbrand committed 7 years ago

Commit ea884641 parent fbcf73c4 files · +45 −57Browse files

Showing the changes to include/linux (2 of 4 files). Show all

Unified · Split

2 files
  1. include/linux/memory.h +3 −0
  2. include/linux/memory_hotplug.h +0 −2
include/linux/memory.h+3−0
@@ -119,6 +119,9 @@ extern int memory_isolate_notify(unsigned long val, void *v); · 118 unmodified lines
119119 extern struct memory_block *find_memory_block_hinted(struct mem_section *,
120120 struct memory_block *);
121121 extern struct memory_block *find_memory_block(struct mem_section *);
122+typedef int (*walk_memory_blocks_func_t)(struct memory_block *, void *);
123+extern int walk_memory_blocks(unsigned long start, unsigned long size,
124+ void *arg, walk_memory_blocks_func_t func);
122125 #define CONFIG_MEM_BLOCK_SIZE (PAGES_PER_SECTION<<PAGE_SHIFT)
123126 #endif /* CONFIG_MEMORY_HOTPLUG_SPARSE */
124127
include/linux/memory_hotplug.h+0−2
@@ -340,8 +340,6 @@ static inline void __remove_memory(int nid, u64 start, u64 size) {} · 339 unmodified lines
340340 #endif /* CONFIG_MEMORY_HOTREMOVE */
341341
342342 extern void __ref free_area_init_core_hotplug(int nid);
343−extern int walk_memory_blocks(unsigned long start, unsigned long size,
344− void *arg, int (*func)(struct memory_block *, void *));
345343 extern int __add_memory(int nid, u64 start, u64 size);
346344 extern int add_memory(int nid, u64 start, u64 size);
347345 extern int add_memory_resource(int nid, struct resource *resource);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t