Lines Matching refs:wait

541  * filemap_fdatawait_range - wait for writeback to complete
542 * @mapping: address space structure to wait for
547 * in the given range and wait for all of them. Check error status of
565 * filemap_fdatawait_range_keep_errors - wait for writeback to complete
566 * @mapping: address space structure to wait for
571 * given range and wait for all of them. Unlike filemap_fdatawait_range(),
587 * file_fdatawait_range - wait for writeback to complete
588 * @file: file pointing to address space structure to wait for
593 * refers to, in the given range and wait for all of them. Check error
612 * filemap_fdatawait_keep_errors - wait for writeback without clearing errors
613 * @mapping: address space structure to wait for
616 * and wait for all of them. Unlike filemap_fdatawait(), this function
664 * filemap_write_and_wait_range - write out & wait on a file range
669 * Write out and wait upon file offsets lstart->lend, inclusive.
689 * written partially (e.g. -ENOSPC), so we wait for it.
764 * file_write_and_wait_range - write out & wait on a file range
769 * Write out and wait upon file offsets lstart->lend, inclusive.
1052 * In order to wait for pages to become available there must be
1081 * The page wait code treats the "wait->flags" somewhat unusually, because
1091 * and remove it from the wait queue.
1099 * WQ_FLAG_WOKEN bit, wake it up, and remove it from the wait queue.
1101 * This is the traditional exclusive wait.
1107 * cannot be taken, we stop walking the wait queue without waking
1114 static int wake_page_function(wait_queue_entry_t *wait, unsigned mode, int sync, void *arg)
1119 = container_of(wait, struct wait_page_queue, wait);
1125 * If it's a lock handoff wait, we get the bit for it, and
1128 flags = wait->flags;
1140 * We are holding the wait-queue lock, but the waiter that
1148 smp_store_release(&wait->flags, flags | WQ_FLAG_WOKEN);
1149 wake_up_state(wait->private, mode);
1153 * and we can unconditionally remove the wait entry.
1157 * After this list_del_init(&wait->entry) the wait entry
1161 list_del_init_careful(&wait->entry);
1203 DROP, /* Drop ref to page before wait, no check when woken,
1213 struct wait_queue_entry *wait)
1215 if (wait->flags & WQ_FLAG_EXCLUSIVE) {
1221 wait->flags |= WQ_FLAG_WOKEN | WQ_FLAG_DONE;
1234 wait_queue_entry_t *wait = &wait_page.wait;
1246 init_wait(wait);
1247 wait->func = wake_page_function;
1252 wait->flags = 0;
1254 wait->flags = WQ_FLAG_EXCLUSIVE;
1256 wait->flags |= WQ_FLAG_CUSTOM;
1267 * page queue), and add ourselves to the wait
1275 if (!folio_trylock_flag(folio, bit_nr, wait))
1276 __add_wait_queue_entry_tail(q, wait);
1293 * be very careful with the 'wait->flags', because
1302 flags = smp_load_acquire(&wait->flags);
1328 wait->flags |= WQ_FLAG_DONE;
1334 * waiter from the wait-queues, but the folio waiters bit will remain
1338 finish_wait(q, wait);
1346 * NOTE! The wait->flags weren't stable until we've done the
1359 return wait->flags & WQ_FLAG_DONE ? 0 : -EINTR;
1361 return wait->flags & WQ_FLAG_WOKEN ? 0 : -EINTR;
1385 wait_queue_entry_t *wait = &wait_page.wait;
1399 init_wait(wait);
1400 wait->func = wake_page_function;
1403 wait->flags = 0;
1407 if (!folio_trylock_flag(folio, PG_locked, wait))
1408 __add_wait_queue_entry_tail(q, wait);
1424 flags = smp_load_acquire(&wait->flags);
1435 finish_wait(q, wait);
1457 * folio_put_wait_locked - Drop a reference and wait for it to be unlocked
1458 * @folio: The folio to wait for.
1475 * folio_add_wait_queue - Add an arbitrary waiter to a folio's wait queue
1476 * @folio: Folio defining the wait queue of interest
1479 * Add an arbitrary @waiter to the wait queue for the nominated @folio.
1565 * @folio: The folio to wait on.
1578 * @folio: The folio to wait on.
1627 * on truncation to wait for the clearing of PG_writeback.
1657 static int __folio_lock_async(struct folio *folio, struct wait_page_queue *wait)
1662 wait->folio = folio;
1663 wait->bit_nr = PG_locked;
1666 __add_wait_queue_entry_tail(q, &wait->wait);
1676 __remove_wait_queue(q, &wait->wait);