vnode_pager.c (6e4b282039e6f0ac815e17ca13f76cd2688d126f) | vnode_pager.c (ed4fe4f4f5dd2ae7ef62e004a3e1bdd071b8fee6) |
---|---|
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 --- 217 unchanged lines hidden (view full) --- 226 /* 227 * And an object of the appropriate size 228 */ 229 object = vm_object_allocate(OBJT_VNODE, OFF_TO_IDX(round_page(size))); 230 231 object->un_pager.vnp.vnp_size = size; 232 233 object->handle = handle; | 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 --- 217 unchanged lines hidden (view full) --- 226 /* 227 * And an object of the appropriate size 228 */ 229 object = vm_object_allocate(OBJT_VNODE, OFF_TO_IDX(round_page(size))); 230 231 object->un_pager.vnp.vnp_size = size; 232 233 object->handle = handle; |
234 if (VFS_NEEDSGIANT(vp->v_mount)) 235 vm_object_set_flag(object, OBJ_NEEDGIANT); |
|
234 vp->v_object = object; 235 } else { 236 object->ref_count++; 237 VM_OBJECT_UNLOCK(object); 238 } 239 vref(vp); 240 return (object); 241} --- 941 unchanged lines hidden (view full) --- 1183 VM_OBJECT_UNLOCK(object); 1184 return NULL; 1185 } 1186 vp = object->handle; 1187 VI_LOCK(vp); 1188 VM_OBJECT_UNLOCK(object); 1189 if (first_object != object) 1190 VM_OBJECT_UNLOCK(first_object); | 236 vp->v_object = object; 237 } else { 238 object->ref_count++; 239 VM_OBJECT_UNLOCK(object); 240 } 241 vref(vp); 242 return (object); 243} --- 941 unchanged lines hidden (view full) --- 1185 VM_OBJECT_UNLOCK(object); 1186 return NULL; 1187 } 1188 vp = object->handle; 1189 VI_LOCK(vp); 1190 VM_OBJECT_UNLOCK(object); 1191 if (first_object != object) 1192 VM_OBJECT_UNLOCK(first_object); |
1193 VFS_ASSERT_GIANT(vp->v_mount); |
|
1191 if (vget(vp, LK_CANRECURSE | LK_INTERLOCK | 1192 LK_RETRY | LK_SHARED, curthread)) { 1193 VM_OBJECT_LOCK(first_object); 1194 if (object != first_object) 1195 VM_OBJECT_LOCK(object); 1196 if (object->type != OBJT_VNODE) { 1197 if (object != first_object) 1198 VM_OBJECT_UNLOCK(object); 1199 return NULL; 1200 } 1201 printf("vnode_pager_lock: retrying\n"); 1202 goto retry; 1203 } 1204 VM_OBJECT_LOCK(first_object); 1205 return (vp); 1206 } 1207 return NULL; 1208} | 1194 if (vget(vp, LK_CANRECURSE | LK_INTERLOCK | 1195 LK_RETRY | LK_SHARED, curthread)) { 1196 VM_OBJECT_LOCK(first_object); 1197 if (object != first_object) 1198 VM_OBJECT_LOCK(object); 1199 if (object->type != OBJT_VNODE) { 1200 if (object != first_object) 1201 VM_OBJECT_UNLOCK(object); 1202 return NULL; 1203 } 1204 printf("vnode_pager_lock: retrying\n"); 1205 goto retry; 1206 } 1207 VM_OBJECT_LOCK(first_object); 1208 return (vp); 1209 } 1210 return NULL; 1211} |