Dominique Martinet | 024b7d6 | 2021-11-02 22:12:01 +0900 | [diff] [blame] | 1 | // SPDX-License-Identifier: LGPL-2.1 |
Venkateswararao Jujjuri (JV) | 022cae36 | 2011-01-28 14:11:13 -0800 | [diff] [blame] | 2 | /* |
| 3 | * Copyright IBM Corporation, 2010 |
| 4 | * Author Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com> |
Venkateswararao Jujjuri (JV) | 022cae36 | 2011-01-28 14:11:13 -0800 | [diff] [blame] | 5 | */ |
| 6 | |
Al Viro | dcdbd7b | 2015-04-02 23:11:36 -0400 | [diff] [blame] | 7 | #include <linux/mm.h> |
Venkateswararao Jujjuri (JV) | 022cae36 | 2011-01-28 14:11:13 -0800 | [diff] [blame] | 8 | #include <linux/module.h> |
Adeodato Simó | 52ad259 | 2018-11-13 03:28:53 -0300 | [diff] [blame] | 9 | #include "trans_common.h" |
Venkateswararao Jujjuri (JV) | 022cae36 | 2011-01-28 14:11:13 -0800 | [diff] [blame] | 10 | |
| 11 | /** |
Andrew Lunn | 760b3d6 | 2020-10-31 19:26:55 +0100 | [diff] [blame] | 12 | * p9_release_pages - Release pages after the transaction. |
| 13 | * @pages: array of pages to be put |
| 14 | * @nr_pages: size of array |
Venkateswararao Jujjuri (JV) | 022cae36 | 2011-01-28 14:11:13 -0800 | [diff] [blame] | 15 | */ |
Aneesh Kumar K.V | abfa034 | 2011-08-16 10:50:10 +0530 | [diff] [blame] | 16 | void p9_release_pages(struct page **pages, int nr_pages) |
Venkateswararao Jujjuri (JV) | 022cae36 | 2011-01-28 14:11:13 -0800 | [diff] [blame] | 17 | { |
Sasha Levin | 110ecd6 | 2013-07-11 13:16:54 -0400 | [diff] [blame] | 18 | int i; |
| 19 | |
| 20 | for (i = 0; i < nr_pages; i++) |
| 21 | if (pages[i]) |
| 22 | put_page(pages[i]); |
Venkateswararao Jujjuri (JV) | 022cae36 | 2011-01-28 14:11:13 -0800 | [diff] [blame] | 23 | } |
Aneesh Kumar K.V | abfa034 | 2011-08-16 10:50:10 +0530 | [diff] [blame] | 24 | EXPORT_SYMBOL(p9_release_pages); |