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
119extern struct memory_block *find_memory_block_hinted(struct mem_section *,119extern struct memory_block *find_memory_block_hinted(struct mem_section *,
120 struct memory_block *);120 struct memory_block *);
121extern struct memory_block *find_memory_block(struct mem_section *);121extern struct memory_block *find_memory_block(struct mem_section *);
122typedef int (*walk_memory_blocks_func_t)(struct memory_block *, void *);
123extern int walk_memory_blocks(unsigned long start, unsigned long size,
124 void *arg, walk_memory_blocks_func_t func);
122#define CONFIG_MEM_BLOCK_SIZE (PAGES_PER_SECTION<<PAGE_SHIFT)125#define CONFIG_MEM_BLOCK_SIZE (PAGES_PER_SECTION<<PAGE_SHIFT)
123#endif /* CONFIG_MEMORY_HOTPLUG_SPARSE */126#endif /* CONFIG_MEMORY_HOTPLUG_SPARSE */
124 127
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
340#endif /* CONFIG_MEMORY_HOTREMOVE */340#endif /* CONFIG_MEMORY_HOTREMOVE */
341 341
342extern void __ref free_area_init_core_hotplug(int nid);342extern void __ref free_area_init_core_hotplug(int nid);
343extern int walk_memory_blocks(unsigned long start, unsigned long size,
344 void *arg, int (*func)(struct memory_block *, void *));
345extern int __add_memory(int nid, u64 start, u64 size);343extern int __add_memory(int nid, u64 start, u64 size);
346extern int add_memory(int nid, u64 start, u64 size);344extern int add_memory(int nid, u64 start, u64 size);
347extern int add_memory_resource(int nid, struct resource *resource);345extern 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