| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. |
|---|
| 3 | | - * |
|---|
| 4 | | - * This program is free software: you can redistribute it and/or modify |
|---|
| 5 | | - * it under the terms of the GNU General Public License as published by |
|---|
| 6 | | - * the Free Software Foundation, either version 2 of the License, or |
|---|
| 7 | | - * (at your option) any later version. |
|---|
| 8 | | - * |
|---|
| 9 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 10 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 11 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 12 | | - * GNU General Public License for more details. |
|---|
| 13 | | - * |
|---|
| 14 | | - * You should have received a copy of the GNU General Public License |
|---|
| 15 | | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
|---|
| 16 | 4 | */ |
|---|
| 17 | 5 | |
|---|
| 18 | 6 | /* |
|---|
| .. | .. |
|---|
| 30 | 18 | * the recommended way for applications to use the coprocessor, and |
|---|
| 31 | 19 | * the driver interface is not intended for general use. |
|---|
| 32 | 20 | * |
|---|
| 33 | | - * See Documentation/sparc/oradax/oracle-dax.txt for more details. |
|---|
| 21 | + * See Documentation/sparc/oradax/oracle-dax.rst for more details. |
|---|
| 34 | 22 | */ |
|---|
| 35 | 23 | |
|---|
| 36 | 24 | #include <linux/uaccess.h> |
|---|
| .. | .. |
|---|
| 422 | 410 | |
|---|
| 423 | 411 | if (p) { |
|---|
| 424 | 412 | dax_dbg("freeing page %p", p); |
|---|
| 425 | | - if (j == OUT) |
|---|
| 426 | | - set_page_dirty(p); |
|---|
| 427 | | - put_page(p); |
|---|
| 413 | + unpin_user_pages_dirty_lock(&p, 1, j == OUT); |
|---|
| 428 | 414 | ctx->pages[i][j] = NULL; |
|---|
| 429 | 415 | } |
|---|
| 430 | 416 | } |
|---|
| .. | .. |
|---|
| 437 | 423 | |
|---|
| 438 | 424 | dax_dbg("uva %p", va); |
|---|
| 439 | 425 | |
|---|
| 440 | | - ret = get_user_pages_fast((unsigned long)va, 1, 1, p); |
|---|
| 426 | + ret = pin_user_pages_fast((unsigned long)va, 1, FOLL_WRITE, p); |
|---|
| 441 | 427 | if (ret == 1) { |
|---|
| 442 | 428 | dax_dbg("locked page %p, for VA %p", *p, va); |
|---|
| 443 | 429 | return 0; |
|---|
| 444 | 430 | } |
|---|
| 445 | 431 | |
|---|
| 446 | | - dax_dbg("get_user_pages failed, va=%p, ret=%d", va, ret); |
|---|
| 432 | + dax_dbg("pin_user_pages failed, va=%p, ret=%d", va, ret); |
|---|
| 447 | 433 | return -1; |
|---|
| 448 | 434 | } |
|---|
| 449 | 435 | |
|---|