vnode_pager.c (eb00b276ab2a5a549620ec3fe92c22fd0ddf948e) | vnode_pager.c (03679e233408833452145f89f49c5929842140d0) |
---|---|
1/*- 2 * Copyright (c) 1990 University of Utah. 3 * Copyright (c) 1991 The Regents of the University of California. 4 * All rights reserved. 5 * Copyright (c) 1993, 1994 John S. Dyson 6 * Copyright (c) 1995, David Greenman 7 * 8 * This code is derived from software contributed to Berkeley by --- 934 unchanged lines hidden (view full) --- 943 944 VM_OBJECT_LOCK(object); 945 for (i = 0, tfoff = foff; i < count; i++, tfoff = nextoff) { 946 vm_page_t mt; 947 948 nextoff = tfoff + PAGE_SIZE; 949 mt = m[i]; 950 | 1/*- 2 * Copyright (c) 1990 University of Utah. 3 * Copyright (c) 1991 The Regents of the University of California. 4 * All rights reserved. 5 * Copyright (c) 1993, 1994 John S. Dyson 6 * Copyright (c) 1995, David Greenman 7 * 8 * This code is derived from software contributed to Berkeley by --- 934 unchanged lines hidden (view full) --- 943 944 VM_OBJECT_LOCK(object); 945 for (i = 0, tfoff = foff; i < count; i++, tfoff = nextoff) { 946 vm_page_t mt; 947 948 nextoff = tfoff + PAGE_SIZE; 949 mt = m[i]; 950 |
951 vm_page_lock(mt); 952 vm_page_lock_queues(); | |
953 if (nextoff <= object->un_pager.vnp.vnp_size) { 954 /* 955 * Read filled up entire page. 956 */ 957 mt->valid = VM_PAGE_BITS_ALL; 958 KASSERT(mt->dirty == 0, 959 ("vnode_pager_generic_getpages: page %p is dirty", 960 mt)); --- 26 unchanged lines hidden (view full) --- 987 * deactivating pages is best. 988 */ 989 990 /* 991 * just in case someone was asking for this page we 992 * now tell them that it is ok to use 993 */ 994 if (!error) { | 951 if (nextoff <= object->un_pager.vnp.vnp_size) { 952 /* 953 * Read filled up entire page. 954 */ 955 mt->valid = VM_PAGE_BITS_ALL; 956 KASSERT(mt->dirty == 0, 957 ("vnode_pager_generic_getpages: page %p is dirty", 958 mt)); --- 26 unchanged lines hidden (view full) --- 985 * deactivating pages is best. 986 */ 987 988 /* 989 * just in case someone was asking for this page we 990 * now tell them that it is ok to use 991 */ 992 if (!error) { |
995 if (mt->oflags & VPO_WANTED) | 993 if (mt->oflags & VPO_WANTED) { 994 vm_page_lock(mt); |
996 vm_page_activate(mt); | 995 vm_page_activate(mt); |
997 else | 996 vm_page_unlock(mt); 997 } else { 998 vm_page_lock(mt); |
998 vm_page_deactivate(mt); | 999 vm_page_deactivate(mt); |
1000 vm_page_unlock(mt); 1001 } |
|
999 vm_page_wakeup(mt); 1000 } else { | 1002 vm_page_wakeup(mt); 1003 } else { |
1004 vm_page_lock(mt); |
|
1001 vm_page_free(mt); | 1005 vm_page_free(mt); |
1006 vm_page_unlock(mt); |
|
1002 } 1003 } | 1007 } 1008 } |
1004 vm_page_unlock_queues(); 1005 vm_page_unlock(mt); | |
1006 } 1007 VM_OBJECT_UNLOCK(object); 1008 if (error) { 1009 printf("vnode_pager_getpages: I/O read error\n"); 1010 } 1011 return (error ? VM_PAGER_ERROR : VM_PAGER_OK); 1012} 1013 --- 175 unchanged lines hidden --- | 1009 } 1010 VM_OBJECT_UNLOCK(object); 1011 if (error) { 1012 printf("vnode_pager_getpages: I/O read error\n"); 1013 } 1014 return (error ? VM_PAGER_ERROR : VM_PAGER_OK); 1015} 1016 --- 175 unchanged lines hidden --- |