--- initial
+++ final
@@ -1,84 +1,85 @@
 int ttm_bo_init_reserved(struct ttm_bo_device *bdev, struct ttm_buffer_object *bo, unsigned long size, enum ttm_bo_type type, struct ttm_placement *placement, uint32_t page_alignment, bool interruptible, struct file *persistent_swap_storage, size_t acc_size, struct sg_table *sg, struct reservation_object *resv, void (*destroy)(struct ttm_buffer_object *)) {
+  struct ttm_operation_ctx ctx = {interruptible, false};
   int ret = 0;
   unsigned long num_pages;
   struct ttm_mem_global *mem_glob = bdev->glob->mem_glob;
   bool locked;
   ret = ttm_mem_global_alloc(mem_glob, acc_size, false, false);
   if (ret) {
     pr_err("Out of kernel memory\n");
     if (destroy)
       (*destroy)(bo);
     else
       kfree(bo);
     return -ENOMEM;
   }
   num_pages = (size + PAGE_SIZE - 1) >> PAGE_SHIFT;
   if (num_pages == 0) {
     pr_err("Illegal buffer object size\n");
     if (destroy)
       (*destroy)(bo);
     else
       kfree(bo);
     ttm_mem_global_free(mem_glob, acc_size);
     return -EINVAL;
   }
   bo->destroy = destroy;
   kref_init(&bo->kref);
   kref_init(&bo->list_kref);
   atomic_set(&bo->cpu_writers, 0);
   INIT_LIST_HEAD(&bo->lru);
   INIT_LIST_HEAD(&bo->ddestroy);
   INIT_LIST_HEAD(&bo->swap);
   INIT_LIST_HEAD(&bo->io_reserve_lru);
   mutex_init(&bo->wu_mutex);
   bo->bdev = bdev;
   bo->glob = bdev->glob;
   bo->type = type;
   bo->num_pages = num_pages;
   bo->mem.size = num_pages << PAGE_SHIFT;
   bo->mem.mem_type = TTM_PL_SYSTEM;
   bo->mem.num_pages = bo->num_pages;
   bo->mem.mm_node = NULL;
   bo->mem.page_alignment = page_alignment;
   bo->mem.bus.io_reserved_vm = false;
   bo->mem.bus.io_reserved_count = 0;
   bo->moving = NULL;
   bo->mem.placement = (TTM_PL_FLAG_SYSTEM | TTM_PL_FLAG_CACHED);
   bo->persistent_swap_storage = persistent_swap_storage;
   bo->acc_size = acc_size;
   bo->sg = sg;
   if (resv) {
     bo->resv = resv;
     lockdep_assert_held(&bo->resv->lock.base);
   } else {
     bo->resv = &bo->ttm_resv;
   }
   reservation_object_init(&bo->ttm_resv);
   atomic_inc(&bo->glob->bo_count);
   drm_vma_node_reset(&bo->vma_node);
   bo->priority = 0;
   /*
    * For ttm_bo_type_device buffers, allocate
    * address space from the device.
    */
   if (bo->type == ttm_bo_type_device || bo->type == ttm_bo_type_sg) ret = drm_vma_offset_add(&bdev->vma_manager, &bo->vma_node, bo->mem.num_pages);
   /* passed reservation objects should already be locked,
    * since otherwise lockdep will be angered in radeon.
    */
   if (!resv) {
     locked = ww_mutex_trylock(&bo->resv->lock);
     WARN_ON(!locked);
   }
-  if (likely(!ret)) ret = ttm_bo_validate(bo, placement, interruptible, false);
+  if (likely(!ret)) ret = ttm_bo_validate(bo, placement, &ctx);
   if (unlikely(ret)) {
     if (!resv) ttm_bo_unreserve(bo);
     ttm_bo_unref(&bo);
     return ret;
   }
   if (resv && !(bo->mem.placement & TTM_PL_FLAG_NO_EVICT)) {
     spin_lock(&bo->glob->lru_lock);
     ttm_bo_add_to_lru(bo);
     spin_unlock(&bo->glob->lru_lock);
   }
   return ret;
 }<sep>@@
identifier f;
expression e1,e2,x,y;
symbol ctx;
@@

f(...) {
++ struct ttm_operation_ctx ctx = { e1,e2 };
<+...
               ttm_bo_validate(x,y,
-                               e1,e2
+              			&ctx
			      )
...+> }