| .. | .. |
|---|
| 1028 | 1028 | static void |
|---|
| 1029 | 1029 | ttm_pool_unpopulate_helper(struct ttm_tt *ttm, unsigned mem_count_update) |
|---|
| 1030 | 1030 | { |
|---|
| 1031 | | - struct ttm_mem_global *mem_glob = ttm->bdev->glob->mem_glob; |
|---|
| 1031 | + struct ttm_mem_global *mem_glob = &ttm_mem_glob; |
|---|
| 1032 | 1032 | unsigned i; |
|---|
| 1033 | 1033 | |
|---|
| 1034 | 1034 | if (mem_count_update == 0) |
|---|
| .. | .. |
|---|
| 1044 | 1044 | put_pages: |
|---|
| 1045 | 1045 | ttm_put_pages(ttm->pages, ttm->num_pages, ttm->page_flags, |
|---|
| 1046 | 1046 | ttm->caching_state); |
|---|
| 1047 | | - ttm->state = tt_unpopulated; |
|---|
| 1047 | + ttm_tt_set_unpopulated(ttm); |
|---|
| 1048 | 1048 | } |
|---|
| 1049 | 1049 | |
|---|
| 1050 | 1050 | int ttm_pool_populate(struct ttm_tt *ttm, struct ttm_operation_ctx *ctx) |
|---|
| 1051 | 1051 | { |
|---|
| 1052 | | - struct ttm_mem_global *mem_glob = ttm->bdev->glob->mem_glob; |
|---|
| 1052 | + struct ttm_mem_global *mem_glob = &ttm_mem_glob; |
|---|
| 1053 | 1053 | unsigned i; |
|---|
| 1054 | 1054 | int ret; |
|---|
| 1055 | 1055 | |
|---|
| 1056 | | - if (ttm->state != tt_unpopulated) |
|---|
| 1056 | + if (ttm_tt_is_populated(ttm)) |
|---|
| 1057 | 1057 | return 0; |
|---|
| 1058 | 1058 | |
|---|
| 1059 | 1059 | if (ttm_check_under_lowerlimit(mem_glob, ttm->num_pages, ctx)) |
|---|
| .. | .. |
|---|
| 1083 | 1083 | } |
|---|
| 1084 | 1084 | } |
|---|
| 1085 | 1085 | |
|---|
| 1086 | | - ttm->state = tt_unbound; |
|---|
| 1086 | + ttm_tt_set_populated(ttm); |
|---|
| 1087 | 1087 | return 0; |
|---|
| 1088 | 1088 | } |
|---|
| 1089 | 1089 | EXPORT_SYMBOL(ttm_pool_populate); |
|---|