Lines Matching defs:handle
2138 * @handle: Snapshot handle to be used for the reading.
2140 * On the first call, @handle should point to a zeroed snapshot_handle
2150 * pointed to by @handle is not updated and should not be used any more.
2152 int snapshot_read_next(struct snapshot_handle *handle)
2154 if (handle->cur > nr_meta_pages + nr_copy_pages) {
2165 if (!handle->cur) {
2172 handle->buffer = buffer;
2175 } else if (handle->cur <= nr_meta_pages) {
2193 handle->buffer = buffer;
2195 handle->buffer = page_address(page);
2198 handle->cur++;
2655 * @handle: Snapshot handle structure to guide the writing.
2657 * On the first call, @handle should point to a zeroed snapshot_handle
2667 * @handle is not updated and should not be used any more.
2669 int snapshot_write_next(struct snapshot_handle *handle)
2675 if (handle->cur > 1 && handle->cur > nr_meta_pages + nr_copy_pages) {
2679 handle->sync_read = 1;
2681 if (!handle->cur) {
2691 handle->buffer = buffer;
2692 } else if (handle->cur == 1) {
2706 } else if (handle->cur <= nr_meta_pages + 1) {
2712 if (handle->cur == nr_meta_pages + 1) {
2721 handle->buffer = get_buffer(&orig_bm, &ca);
2722 handle->sync_read = 0;
2723 if (IS_ERR(handle->buffer)) {
2724 return PTR_ERR(handle->buffer);
2729 hibernate_restore_protect_page(handle->buffer);
2730 handle->buffer = get_buffer(&orig_bm, &ca);
2731 if (IS_ERR(handle->buffer)) {
2732 return PTR_ERR(handle->buffer);
2734 if (handle->buffer != buffer) {
2735 handle->sync_read = 0;
2738 handle->cur++;
2750 void snapshot_write_finalize(struct snapshot_handle *handle)
2753 hibernate_restore_protect_page(handle->buffer);
2755 if (handle->cur > 1 && handle->cur > nr_meta_pages + nr_copy_pages) {
2761 int snapshot_image_loaded(struct snapshot_handle *handle)
2763 return !(!nr_copy_pages || !last_highmem_page_copied() || handle->cur <= nr_meta_pages + nr_copy_pages);