tmpfs_subr.c (63e9755548e4feebf798686ab8bce0cdaaaf7b46) tmpfs_subr.c (0012f373e43db2341c20329163ed2d5ad3b0f341)
1/* $NetBSD: tmpfs_subr.c,v 1.35 2007/07/09 21:10:50 ad Exp $ */
2
3/*-
4 * SPDX-License-Identifier: BSD-2-Clause-NetBSD
5 *
6 * Copyright (c) 2005 The NetBSD Foundation, Inc.
7 * All rights reserved.
8 *

--- 1394 unchanged lines hidden (view full) ---

1403 * Zero the truncated part of the last page.
1404 */
1405 base = newsize & PAGE_MASK;
1406 if (base != 0) {
1407 idx = OFF_TO_IDX(newsize);
1408retry:
1409 m = vm_page_grab(uobj, idx, VM_ALLOC_NOCREAT);
1410 if (m != NULL) {
1/* $NetBSD: tmpfs_subr.c,v 1.35 2007/07/09 21:10:50 ad Exp $ */
2
3/*-
4 * SPDX-License-Identifier: BSD-2-Clause-NetBSD
5 *
6 * Copyright (c) 2005 The NetBSD Foundation, Inc.
7 * All rights reserved.
8 *

--- 1394 unchanged lines hidden (view full) ---

1403 * Zero the truncated part of the last page.
1404 */
1405 base = newsize & PAGE_MASK;
1406 if (base != 0) {
1407 idx = OFF_TO_IDX(newsize);
1408retry:
1409 m = vm_page_grab(uobj, idx, VM_ALLOC_NOCREAT);
1410 if (m != NULL) {
1411 MPASS(m->valid == VM_PAGE_BITS_ALL);
1411 MPASS(vm_page_all_valid(m));
1412 } else if (vm_pager_has_page(uobj, idx, NULL, NULL)) {
1413 m = vm_page_alloc(uobj, idx, VM_ALLOC_NORMAL |
1414 VM_ALLOC_WAITFAIL);
1415 if (m == NULL)
1416 goto retry;
1417 rv = vm_pager_get_pages(uobj, &m, 1, NULL,
1418 NULL);
1419 if (rv == VM_PAGER_OK) {

--- 454 unchanged lines hidden ---
1412 } else if (vm_pager_has_page(uobj, idx, NULL, NULL)) {
1413 m = vm_page_alloc(uobj, idx, VM_ALLOC_NORMAL |
1414 VM_ALLOC_WAITFAIL);
1415 if (m == NULL)
1416 goto retry;
1417 rv = vm_pager_get_pages(uobj, &m, 1, NULL,
1418 NULL);
1419 if (rv == VM_PAGER_OK) {

--- 454 unchanged lines hidden ---