• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /xnu-2782.1.97/osfmk/default_pager/

Lines Matching refs:vs

91 	vstruct_t vs)
94 queue_enter(&vstruct_list.vsl_queue, vs, vstruct_t, vs_links);
102 vstruct_t vs)
104 queue_remove(&vstruct_list.vsl_queue, vs, vstruct_t, vs_links);
125 vstruct_t vs)
128 ASSERT(vs->vs_async_pending >= 0);
129 while (vs->vs_async_pending > 0) {
130 vs->vs_waiting_async = TRUE;
131 assert_wait(&vs->vs_async_pending, THREAD_UNINT);
132 VS_UNLOCK(vs);
134 VS_LOCK(vs);
136 ASSERT(vs->vs_async_pending == 0);
156 vstruct_t vs)
161 VS_LOCK(vs);
163 seqno = vs->vs_next_seqno++;
165 while (vs->vs_seqno != seqno) {
167 vs->vs_waiting_seqno = TRUE;
168 assert_wait(&vs->vs_seqno, THREAD_UNINT);
169 VS_UNLOCK(vs);
171 VS_LOCK(vs);
179 vs_unlock(vstruct_t vs)
181 vs->vs_seqno++;
182 if (vs->vs_waiting_seqno) {
183 vs->vs_waiting_seqno = FALSE;
184 VS_UNLOCK(vs);
185 thread_wakeup(&vs->vs_seqno);
188 VS_UNLOCK(vs);
196 vstruct_t vs)
198 vs->vs_readers++;
206 vstruct_t vs)
208 while (vs->vs_readers != 0) {
210 vs->vs_waiting_read = TRUE;
211 assert_wait(&vs->vs_readers, THREAD_UNINT);
212 VS_UNLOCK(vs);
214 VS_LOCK(vs);
223 vstruct_t vs)
225 VS_LOCK(vs);
226 if (--vs->vs_readers == 0 && vs->vs_waiting_read) {
227 vs->vs_waiting_read = FALSE;
228 VS_UNLOCK(vs);
229 thread_wakeup(&vs->vs_readers);
232 VS_UNLOCK(vs);
240 vstruct_t vs)
242 vs->vs_writers++;
250 vstruct_t vs)
252 while (vs->vs_writers != 0) {
254 vs->vs_waiting_write = TRUE;
255 assert_wait(&vs->vs_writers, THREAD_UNINT);
256 VS_UNLOCK(vs);
258 VS_LOCK(vs);
260 vs_async_wait(vs);
264 /* The transfer code holds off vs destruction by keeping the */
271 vstruct_t vs)
273 while (vs->vs_writers != 0) {
275 vs->vs_waiting_write = TRUE;
276 assert_wait(&vs->vs_writers, THREAD_UNINT);
277 VS_UNLOCK(vs);
279 VS_LOCK(vs);
289 vstruct_t vs)
291 VS_LOCK(vs);
292 if (--vs->vs_writers == 0 && vs->vs_waiting_write) {
293 vs->vs_waiting_write = FALSE;
294 VS_UNLOCK(vs);
295 thread_wakeup(&vs->vs_writers);
298 VS_UNLOCK(vs);
306 vstruct_t vs;
312 vs = ps_vstruct_create(size);
313 if (vs == VSTRUCT_NULL) {
319 return vs;
327 vstruct_t vs,
330 memory_object_t mem_obj = vs->vs_mem_obj;
382 vstruct_t vs;
388 vs_lookup(mem_obj, vs);
389 vs_lock(vs);
391 if (vs->vs_control != MEMORY_OBJECT_CONTROL_NULL)
394 vs->vs_control = control;
395 vs_unlock(vs);
407 vstruct_t vs;
409 vs_lookup(mem_obj, vs);
410 vs_lock(vs);
411 vs_unlock(vs);
413 memory_object_synchronize_completed(vs->vs_control, offset, length);
440 vstruct_t vs;
443 vs_lookup(mem_obj, vs);
445 vs_lock(vs);
446 vs_async_wait(vs);
447 if (!vs->vs_xfer_pending) {
451 vs->vs_xfer_pending = TRUE;
452 vs_unlock(vs);
454 retval = ps_vstruct_reclaim(vs, TRUE, reclaim_backing_store);
456 vs_lock(vs);
457 vs->vs_xfer_pending = FALSE;
458 vs_unlock(vs);
468 vstruct_t vs;
474 vs_lookup(mem_obj, vs);
475 vs_lock(vs);
481 vs_wait_for_readers(vs);
482 vs_wait_for_writers(vs);
491 control = vs->vs_control;
492 vs->vs_control = MEMORY_OBJECT_CONTROL_NULL;
501 thread_wakeup(&vs->vs_writers);
502 thread_wakeup(&vs->vs_async_pending);
504 vs_unlock(vs);
517 vstruct_t vs;
519 vs_lookup_safe(mem_obj, vs);
520 if (vs == VSTRUCT_NULL)
523 VS_LOCK(vs);
524 assert(vs->vs_references > 0);
525 vs->vs_references++;
526 VS_UNLOCK(vs);
533 vstruct_t vs;
543 vs_lookup_safe(mem_obj, vs);
544 if (vs == VSTRUCT_NULL)
547 VS_LOCK(vs);
548 if (--vs->vs_references > 0) {
549 VS_UNLOCK(vs);
553 seqno = vs->vs_next_seqno++;
554 while (vs->vs_seqno != seqno) {
556 vs->vs_waiting_seqno = TRUE;
557 assert_wait(&vs->vs_seqno, THREAD_UNINT);
558 VS_UNLOCK(vs);
560 VS_LOCK(vs);
563 vs_async_wait(vs); /* wait for pending async IO */
565 /* do not delete the vs structure until the referencing pointers */
570 VS_UNLOCK(vs);
573 VS_LOCK(vs);
574 vs_async_wait(vs); /* wait for pending async IO */
582 if (vs->vs_control != MEMORY_OBJECT_CONTROL_NULL)
589 VS_UNLOCK(vs);
605 vstruct_list_delete(vs);
608 ps_vstruct_dealloc(vs);
626 vstruct_t vs;
635 vs_lookup(mem_obj, vs);
636 vs_lock(vs);
645 if (vs->vs_writers != 0) {
648 vs_unlock(vs); /* bump internal count of seqno */
649 VS_LOCK(vs);
650 while (vs->vs_writers != 0) {
652 vs->vs_waiting_write = TRUE;
653 assert_wait(&vs->vs_writers, THREAD_UNINT);
654 VS_UNLOCK(vs);
656 VS_LOCK(vs);
657 vs_async_wait(vs);
659 if(vs->vs_control == MEMORY_OBJECT_CONTROL_NULL) {
660 VS_UNLOCK(vs);
663 vs_start_read(vs);
664 VS_UNLOCK(vs);
666 vs_start_read(vs);
667 vs_unlock(vs);
677 kr = pvs_cluster_read(vs, (dp_offset_t) offset, length, fault_info);
690 vs_finish_read(vs);
713 vstruct_t vs;
720 vs_lookup(mem_obj, vs);
721 vs_lock(vs);
722 vs_start_write(vs);
723 vs_unlock(vs);
731 vs_cluster_write(vs, 0, (upl_offset_t)offset, size, FALSE, 0);
733 vs_finish_write(vs);
762 vstruct_t vs;
771 /* Therefore the grant of vs lock must be done on a try versus a */
777 vs_lookup(mem_obj, vs);
783 if(!VS_TRY_LOCK(vs)) {
789 memory_object_super_upl_request(vs->vs_control,
801 if ((vs->vs_seqno != vs->vs_next_seqno++)
802 || (vs->vs_readers)
803 || (vs->vs_xfer_pending)) {
807 vs->vs_next_seqno--;
808 VS_UNLOCK(vs);
813 memory_object_super_upl_request(vs->vs_control,
827 vs_start_write(vs);
830 vs->vs_async_pending += 1; /* protect from backing store contraction */
831 vs_unlock(vs);
839 vs_cluster_write(vs, 0, (upl_offset_t) offset, size, FALSE, 0);
841 vs_finish_write(vs);
845 VS_LOCK(vs);
846 vs->vs_async_pending -= 1; /* release vs_async_wait */
847 if (vs->vs_async_pending == 0 && vs->vs_waiting_async) {
848 vs->vs_waiting_async = FALSE;
849 VS_UNLOCK(vs);
850 thread_wakeup(&vs->vs_async_pending);
852 VS_UNLOCK(vs);
875 vstruct_t vs;
884 vs = vs_object_create((dp_size_t) new_size);
885 if (vs == VSTRUCT_NULL)
888 vs->vs_next_seqno = 0;
895 vs->vs_pager_ops = &default_pager_ops;
896 vs->vs_pager_header.io_bits = IKOT_MEMORY_OBJECT;
903 vstruct_list_insert(vs);
904 *new_mem_obj = vs_to_mem_obj(vs);
917 vstruct_t vs;
927 vs = vs_object_create((dp_size_t) size);
928 if (vs == VSTRUCT_NULL)
935 vs->vs_pager_ops = &default_pager_ops;
936 vstruct_list_insert(vs);
937 *mem_objp = vs_to_mem_obj(vs);