Lines Matching refs:error

49 	int error = 0;  in vm_swapfile_open()  local
52 …if ((error = vnode_open(path, (O_CREAT | O_TRUNC | FREAD | FWRITE), S_IRUSR | S_IWUSR, 0, vp, ctx)… in vm_swapfile_open()
53 printf("Failed to open swap file %d\n", error); in vm_swapfile_open()
91 int error; in vm_swapfile_close() local
96 error = unlink1(context, NULLVP, CAST_USER_ADDR_T(path_addr), in vm_swapfile_close()
100 if (error) { in vm_swapfile_close()
102 (char *)path_addr, error); in vm_swapfile_close()
110 int error = 0; in vm_swapfile_preallocate() local
119 error = vnode_setsize(vp, *size, IO_NOZEROFILL, ctx); in vm_swapfile_preallocate()
121 if (error) { in vm_swapfile_preallocate()
122 printf("vnode_setsize for swap files failed: %d\n", error); in vm_swapfile_preallocate()
126 error = vnode_size(vp, (off_t*) &file_size, ctx); in vm_swapfile_preallocate()
128 if (error) { in vm_swapfile_preallocate()
129 printf("vnode_size (new file) for swap file failed: %d\n", error); in vm_swapfile_preallocate()
135 error = VNOP_IOCTL(vp, FIOPINSWAP, NULL, 0, ctx); in vm_swapfile_preallocate()
137 if (error) { in vm_swapfile_preallocate()
138 printf("pin for swap files failed: %d, file_size = %lld\n", error, file_size); in vm_swapfile_preallocate()
141 error = 0; in vm_swapfile_preallocate()
152 error = VNOP_SETATTR(vp, &va, ctx); in vm_swapfile_preallocate()
154 if (error) { in vm_swapfile_preallocate()
155 printf("setattr PROTECTION_CLASS_C for swap file failed: %d\n", error); in vm_swapfile_preallocate()
161 return error; in vm_swapfile_preallocate()
168 int error = 0; in vm_record_file_write() local
173 error = vn_rdwr(UIO_WRITE, vp, (caddr_t)buf, size, offset, in vm_record_file_write()
176 return error; in vm_record_file_write()
184 int error = 0; in vm_swapfile_io() local
229 &error); in vm_swapfile_io()
230 if (error) { in vm_swapfile_io()
232 …printf("vm_swapfile_io: vnode_pagein failed with %d (vp: %p, offset: 0x%llx, size:%u)\n", error, v… in vm_swapfile_io()
234 printf("vm_swapfile_io: vnode_pagein failed with %d.\n", error); in vm_swapfile_io()
246 &error); in vm_swapfile_io()
247 if (error) { in vm_swapfile_io()
249 …printf("vm_swapfile_io: vnode_pageout failed with %d (vp: %p, offset: 0x%llx, size:%u)\n", error, … in vm_swapfile_io()
251 printf("vm_swapfile_io: vnode_pageout failed with %d.\n", error); in vm_swapfile_io()
256 return error; in vm_swapfile_io()
262 error = vn_rdwr((flags & SWAP_READ) ? UIO_READ : UIO_WRITE, vp, (caddr_t)start, io_size, offset, in vm_swapfile_io()
265 if (error) { in vm_swapfile_io()
266 printf("vn_rdwr: Swap I/O failed with %d\n", error); in vm_swapfile_io()
268 return error; in vm_swapfile_io()
283 int error = 0; in vnode_trim_list() local
342 error = VNOP_BLOCKMAP(vp, current_offset, remaining_length, in vnode_trim_list()
345 if (error) { in vnode_trim_list()
357 error = VNOP_IOCTL(devvp, _DKIOCCSUNMAP, (caddr_t)&cs_unmap, 0, vfs_context_kernel()); in vnode_trim_list()
360 error = VNOP_IOCTL(devvp, DKIOCUNMAP, (caddr_t)&unmap, 0, vfs_context_kernel()); in vnode_trim_list()
362 if (error) { in vnode_trim_list()
376 error = VNOP_IOCTL(devvp, _DKIOCCSUNMAP, (caddr_t)&cs_unmap, 0, vfs_context_kernel()); in vnode_trim_list()
379 error = VNOP_IOCTL(devvp, DKIOCUNMAP, (caddr_t)&unmap, 0, vfs_context_kernel()); in vnode_trim_list()
385 return error; in vnode_trim_list()
418 int error = 0; in vm_swap_vol_get_capacity() local
421 if ((error = vnode_open(volume_name, FREAD, 0, 0, &vp, ctx))) { in vm_swap_vol_get_capacity()
423 return error; in vm_swap_vol_get_capacity()
427 if ((error = VNOP_IOCTL(devvp, DKIOCGETBLOCKSIZE, (caddr_t)&block_size, 0, ctx))) { in vm_swap_vol_get_capacity()
431 if ((error = VNOP_IOCTL(devvp, DKIOCGETBLOCKCOUNT, (caddr_t)&block_count, 0, ctx))) { in vm_swap_vol_get_capacity()
438 error = vnode_close(vp, 0, ctx); in vm_swap_vol_get_capacity()
439 return error; in vm_swap_vol_get_capacity()