smbfs_io.c (7f49ce7a0b5f0d501d233308d73ccb1bf191a68b) | smbfs_io.c (0012f373e43db2341c20329163ed2d5ad3b0f341) |
---|---|
1/*- 2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD 3 * 4 * Copyright (c) 2000-2001 Boris Popov 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 443 unchanged lines hidden (view full) --- 452 /* 453 * If the requested page is partially valid, just return it and 454 * allow the pager to zero-out the blanks. Partially valid pages 455 * can only occur at the file EOF. 456 * 457 * XXXGL: is that true for SMB filesystem? 458 */ 459 VM_OBJECT_WLOCK(object); | 1/*- 2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD 3 * 4 * Copyright (c) 2000-2001 Boris Popov 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 443 unchanged lines hidden (view full) --- 452 /* 453 * If the requested page is partially valid, just return it and 454 * allow the pager to zero-out the blanks. Partially valid pages 455 * can only occur at the file EOF. 456 * 457 * XXXGL: is that true for SMB filesystem? 458 */ 459 VM_OBJECT_WLOCK(object); |
460 if (pages[npages - 1]->valid != 0 && --npages == 0) | 460 if (!vm_page_none_valid(pages[npages - 1]) && --npages == 0) |
461 goto out; 462 VM_OBJECT_WUNLOCK(object); 463 464 scred = smbfs_malloc_scred(); 465 smb_makescred(scred, td, cred); 466 467 bp = uma_zalloc(smbfs_pbuf_zone, M_WAITOK); 468 --- 31 unchanged lines hidden (view full) --- 500 vm_page_t m; 501 nextoff = toff + PAGE_SIZE; 502 m = pages[i]; 503 504 if (nextoff <= size) { 505 /* 506 * Read operation filled an entire page 507 */ | 461 goto out; 462 VM_OBJECT_WUNLOCK(object); 463 464 scred = smbfs_malloc_scred(); 465 smb_makescred(scred, td, cred); 466 467 bp = uma_zalloc(smbfs_pbuf_zone, M_WAITOK); 468 --- 31 unchanged lines hidden (view full) --- 500 vm_page_t m; 501 nextoff = toff + PAGE_SIZE; 502 m = pages[i]; 503 504 if (nextoff <= size) { 505 /* 506 * Read operation filled an entire page 507 */ |
508 m->valid = VM_PAGE_BITS_ALL; | 508 vm_page_valid(m); |
509 KASSERT(m->dirty == 0, 510 ("smbfs_getpages: page %p is dirty", m)); 511 } else if (size > toff) { 512 /* 513 * Read operation filled a partial page. 514 */ | 509 KASSERT(m->dirty == 0, 510 ("smbfs_getpages: page %p is dirty", m)); 511 } else if (size > toff) { 512 /* 513 * Read operation filled a partial page. 514 */ |
515 m->valid = 0; | 515 vm_page_invalid(m); |
516 vm_page_set_valid_range(m, 0, size - toff); 517 KASSERT(m->dirty == 0, 518 ("smbfs_getpages: page %p is dirty", m)); 519 } else { 520 /* 521 * Read operation was short. If no error occurred 522 * we may have hit a zero-fill section. We simply 523 * leave valid set to 0. --- 153 unchanged lines hidden --- | 516 vm_page_set_valid_range(m, 0, size - toff); 517 KASSERT(m->dirty == 0, 518 ("smbfs_getpages: page %p is dirty", m)); 519 } else { 520 /* 521 * Read operation was short. If no error occurred 522 * we may have hit a zero-fill section. We simply 523 * leave valid set to 0. --- 153 unchanged lines hidden --- |