vfs_bio.c (49535) | vfs_bio.c (50275) |
---|---|
1/* 2 * Copyright (c) 1994,1997 John S. Dyson 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright 9 * notice immediately at the beginning of the file, without modification, 10 * this list of conditions, and the following disclaimer. 11 * 2. Absolutely no warranty of function or purpose is made by the author 12 * John S. Dyson. 13 * | 1/* 2 * Copyright (c) 1994,1997 John S. Dyson 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright 9 * notice immediately at the beginning of the file, without modification, 10 * this list of conditions, and the following disclaimer. 11 * 2. Absolutely no warranty of function or purpose is made by the author 12 * John S. Dyson. 13 * |
14 * $Id: vfs_bio.c,v 1.224 1999/07/26 06:25:16 alc Exp $ | 14 * $Id: vfs_bio.c,v 1.225 1999/08/08 18:42:48 phk Exp $ |
15 */ 16 17/* 18 * this file contains a new buffer I/O scheme implementing a coherent 19 * VM object and buffer cache scheme. Pains have been taken to make 20 * sure that the performance degradation associated with schemes such 21 * as this is not realized. 22 * --- 2944 unchanged lines hidden (view full) --- 2967 bzero(bp->b_data, bp->b_bufsize); 2968 } 2969 bp->b_pages[0]->valid |= mask; 2970 bp->b_resid = 0; 2971 return; 2972 } 2973 ea = sa = bp->b_data; 2974 for(i=0;i<bp->b_npages;i++,sa=ea) { | 15 */ 16 17/* 18 * this file contains a new buffer I/O scheme implementing a coherent 19 * VM object and buffer cache scheme. Pains have been taken to make 20 * sure that the performance degradation associated with schemes such 21 * as this is not realized. 22 * --- 2944 unchanged lines hidden (view full) --- 2967 bzero(bp->b_data, bp->b_bufsize); 2968 } 2969 bp->b_pages[0]->valid |= mask; 2970 bp->b_resid = 0; 2971 return; 2972 } 2973 ea = sa = bp->b_data; 2974 for(i=0;i<bp->b_npages;i++,sa=ea) { |
2975 int j = ((u_long)sa & PAGE_MASK) / DEV_BSIZE; | 2975 int j = ((vm_offset_t)sa & PAGE_MASK) / DEV_BSIZE; |
2976 ea = (caddr_t)trunc_page((vm_offset_t)sa + PAGE_SIZE); | 2976 ea = (caddr_t)trunc_page((vm_offset_t)sa + PAGE_SIZE); |
2977 ea = (caddr_t)ulmin((u_long)ea, 2978 (u_long)bp->b_data + bp->b_bufsize); | 2977 ea = (caddr_t)(vm_offset_t)ulmin( 2978 (u_long)(vm_offset_t)ea, 2979 (u_long)(vm_offset_t)bp->b_data + bp->b_bufsize); |
2979 mask = ((1 << ((ea - sa) / DEV_BSIZE)) - 1) << j; 2980 if ((bp->b_pages[i]->valid & mask) == mask) 2981 continue; 2982 if ((bp->b_pages[i]->valid & mask) == 0) { 2983 if ((bp->b_pages[i]->flags & PG_ZERO) == 0) { 2984 bzero(sa, ea - sa); 2985 } 2986 } else { --- 120 unchanged lines hidden --- | 2980 mask = ((1 << ((ea - sa) / DEV_BSIZE)) - 1) << j; 2981 if ((bp->b_pages[i]->valid & mask) == mask) 2982 continue; 2983 if ((bp->b_pages[i]->valid & mask) == 0) { 2984 if ((bp->b_pages[i]->flags & PG_ZERO) == 0) { 2985 bzero(sa, ea - sa); 2986 } 2987 } else { --- 120 unchanged lines hidden --- |