hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/sbus/char/oradax.c
....@@ -1,18 +1,6 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * 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/>.
164 */
175
186 /*
....@@ -30,7 +18,7 @@
3018 * the recommended way for applications to use the coprocessor, and
3119 * the driver interface is not intended for general use.
3220 *
33
- * See Documentation/sparc/oradax/oracle-dax.txt for more details.
21
+ * See Documentation/sparc/oradax/oracle-dax.rst for more details.
3422 */
3523
3624 #include <linux/uaccess.h>
....@@ -422,9 +410,7 @@
422410
423411 if (p) {
424412 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);
428414 ctx->pages[i][j] = NULL;
429415 }
430416 }
....@@ -437,13 +423,13 @@
437423
438424 dax_dbg("uva %p", va);
439425
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);
441427 if (ret == 1) {
442428 dax_dbg("locked page %p, for VA %p", *p, va);
443429 return 0;
444430 }
445431
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);
447433 return -1;
448434 }
449435