sg_pager.c (fe267a559009cbf34f9341666fe4d88a92c02d5e) | sg_pager.c (10d9120c44480b6ce02f9b37ee8c0724c358ee65) |
---|---|
1/*- 2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD 3 * 4 * Copyright (c) 2009 Hudson River Trading LLC 5 * Written by: John H. Baldwin <jhb@FreeBSD.org> 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 86 unchanged lines hidden (view full) --- 95 npages += sg->sg_segs[i].ss_len / PAGE_SIZE; 96 } 97 98 /* 99 * The scatter/gather list has a fixed size. Refuse requests 100 * to map beyond that. 101 */ 102 size = round_page(size); | 1/*- 2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD 3 * 4 * Copyright (c) 2009 Hudson River Trading LLC 5 * Written by: John H. Baldwin <jhb@FreeBSD.org> 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 86 unchanged lines hidden (view full) --- 95 npages += sg->sg_segs[i].ss_len / PAGE_SIZE; 96 } 97 98 /* 99 * The scatter/gather list has a fixed size. Refuse requests 100 * to map beyond that. 101 */ 102 size = round_page(size); |
103 pindex = UOFF_TO_IDX(foff) + UOFF_TO_IDX(size); 104 if (pindex > npages || pindex < UOFF_TO_IDX(foff) || 105 pindex < UOFF_TO_IDX(size)) | 103 pindex = OFF_TO_IDX(foff) + OFF_TO_IDX(size); 104 if (pindex > npages || pindex < OFF_TO_IDX(foff) || 105 pindex < OFF_TO_IDX(size)) |
106 return (NULL); 107 108 /* 109 * Allocate a new object and associate it with the 110 * scatter/gather list. It is ok for our purposes to have 111 * multiple VM objects associated with the same scatter/gather 112 * list because scatter/gather lists are static. This is also 113 * simpler than ensuring a unique object per scatter/gather --- 116 unchanged lines hidden --- | 106 return (NULL); 107 108 /* 109 * Allocate a new object and associate it with the 110 * scatter/gather list. It is ok for our purposes to have 111 * multiple VM objects associated with the same scatter/gather 112 * list because scatter/gather lists are static. This is also 113 * simpler than ensuring a unique object per scatter/gather --- 116 unchanged lines hidden --- |