kern_exec.c (63e9755548e4feebf798686ab8bce0cdaaaf7b46) | kern_exec.c (0012f373e43db2341c20329163ed2d5ad3b0f341) |
---|---|
1/*- 2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD 3 * 4 * Copyright (c) 1993, David Greenman 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 --- 965 unchanged lines hidden (view full) --- 974 return (EACCES); 975 VM_OBJECT_WLOCK(object); 976#if VM_NRESERVLEVEL > 0 977 vm_object_color(object, 0); 978#endif 979retry: 980 ma[0] = vm_page_grab(object, 0, VM_ALLOC_NORMAL | VM_ALLOC_NOBUSY | 981 VM_ALLOC_WIRED); | 1/*- 2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD 3 * 4 * Copyright (c) 1993, David Greenman 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 --- 965 unchanged lines hidden (view full) --- 974 return (EACCES); 975 VM_OBJECT_WLOCK(object); 976#if VM_NRESERVLEVEL > 0 977 vm_object_color(object, 0); 978#endif 979retry: 980 ma[0] = vm_page_grab(object, 0, VM_ALLOC_NORMAL | VM_ALLOC_NOBUSY | 981 VM_ALLOC_WIRED); |
982 if (ma[0]->valid != VM_PAGE_BITS_ALL) { | 982 if (!vm_page_all_valid(ma[0])) { |
983 if (vm_page_busy_acquire(ma[0], VM_ALLOC_WAITFAIL) == 0) { 984 vm_page_unwire_noq(ma[0]); 985 goto retry; 986 } | 983 if (vm_page_busy_acquire(ma[0], VM_ALLOC_WAITFAIL) == 0) { 984 vm_page_unwire_noq(ma[0]); 985 goto retry; 986 } |
987 if (vm_page_all_valid(ma[0])) { 988 vm_page_xunbusy(ma[0]); 989 goto out; 990 } |
|
987 if (!vm_pager_has_page(object, 0, NULL, &after)) { 988 if (vm_page_unwire_noq(ma[0])) 989 vm_page_free(ma[0]); 990 else 991 vm_page_xunbusy(ma[0]); 992 VM_OBJECT_WUNLOCK(object); 993 return (EIO); 994 } --- 29 unchanged lines hidden (view full) --- 1024 } 1025 VM_OBJECT_WUNLOCK(object); 1026 return (EIO); 1027 } 1028 vm_page_xunbusy(ma[0]); 1029 for (i = 1; i < initial_pagein; i++) 1030 vm_page_readahead_finish(ma[i]); 1031 } | 991 if (!vm_pager_has_page(object, 0, NULL, &after)) { 992 if (vm_page_unwire_noq(ma[0])) 993 vm_page_free(ma[0]); 994 else 995 vm_page_xunbusy(ma[0]); 996 VM_OBJECT_WUNLOCK(object); 997 return (EIO); 998 } --- 29 unchanged lines hidden (view full) --- 1028 } 1029 VM_OBJECT_WUNLOCK(object); 1030 return (EIO); 1031 } 1032 vm_page_xunbusy(ma[0]); 1033 for (i = 1; i < initial_pagein; i++) 1034 vm_page_readahead_finish(ma[i]); 1035 } |
1036 1037out: |
|
1032 VM_OBJECT_WUNLOCK(object); 1033 1034 imgp->firstpage = sf_buf_alloc(ma[0], 0); 1035 imgp->image_header = (char *)sf_buf_kva(imgp->firstpage); 1036 1037 return (0); 1038} 1039 --- 792 unchanged lines hidden --- | 1038 VM_OBJECT_WUNLOCK(object); 1039 1040 imgp->firstpage = sf_buf_alloc(ma[0], 0); 1041 imgp->image_header = (char *)sf_buf_kva(imgp->firstpage); 1042 1043 return (0); 1044} 1045 --- 792 unchanged lines hidden --- |