diff options
Diffstat (limited to 'drivers/xen/balloon.c')
-rw-r--r-- | drivers/xen/balloon.c | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c index d46839f51e73..e4db19e88ab1 100644 --- a/drivers/xen/balloon.c +++ b/drivers/xen/balloon.c | |||
@@ -151,8 +151,6 @@ static DECLARE_WAIT_QUEUE_HEAD(balloon_wq); | |||
151 | static void balloon_process(struct work_struct *work); | 151 | static void balloon_process(struct work_struct *work); |
152 | static DECLARE_DELAYED_WORK(balloon_worker, balloon_process); | 152 | static DECLARE_DELAYED_WORK(balloon_worker, balloon_process); |
153 | 153 | ||
154 | static void release_memory_resource(struct resource *resource); | ||
155 | |||
156 | /* When ballooning out (allocating memory to return to Xen) we don't really | 154 | /* When ballooning out (allocating memory to return to Xen) we don't really |
157 | want the kernel to try too hard since that can trigger the oom killer. */ | 155 | want the kernel to try too hard since that can trigger the oom killer. */ |
158 | #define GFP_BALLOON \ | 156 | #define GFP_BALLOON \ |
@@ -248,6 +246,19 @@ static enum bp_state update_schedule(enum bp_state state) | |||
248 | } | 246 | } |
249 | 247 | ||
250 | #ifdef CONFIG_XEN_BALLOON_MEMORY_HOTPLUG | 248 | #ifdef CONFIG_XEN_BALLOON_MEMORY_HOTPLUG |
249 | static void release_memory_resource(struct resource *resource) | ||
250 | { | ||
251 | if (!resource) | ||
252 | return; | ||
253 | |||
254 | /* | ||
255 | * No need to reset region to identity mapped since we now | ||
256 | * know that no I/O can be in this region | ||
257 | */ | ||
258 | release_resource(resource); | ||
259 | kfree(resource); | ||
260 | } | ||
261 | |||
251 | static struct resource *additional_memory_resource(phys_addr_t size) | 262 | static struct resource *additional_memory_resource(phys_addr_t size) |
252 | { | 263 | { |
253 | struct resource *res; | 264 | struct resource *res; |
@@ -286,19 +297,6 @@ static struct resource *additional_memory_resource(phys_addr_t size) | |||
286 | return res; | 297 | return res; |
287 | } | 298 | } |
288 | 299 | ||
289 | static void release_memory_resource(struct resource *resource) | ||
290 | { | ||
291 | if (!resource) | ||
292 | return; | ||
293 | |||
294 | /* | ||
295 | * No need to reset region to identity mapped since we now | ||
296 | * know that no I/O can be in this region | ||
297 | */ | ||
298 | release_resource(resource); | ||
299 | kfree(resource); | ||
300 | } | ||
301 | |||
302 | static enum bp_state reserve_additional_memory(void) | 300 | static enum bp_state reserve_additional_memory(void) |
303 | { | 301 | { |
304 | long credit; | 302 | long credit; |