提交 2d9f69bc 编写于 作者: L Laurent Dufour 提交者: Michael Ellerman

cxl: don't manipulate the mm.mm_users field directly

It is better to rely on the API provided by the MM layer instead of
directly manipulating the mm_users field.
Signed-off-by: NLaurent Dufour <ldufour@linux.ibm.com>
Acked-by: NFrederic Barrat <fbarrat@linux.ibm.com>
Acked-by: NAndrew Donnellan <ajd@linux.ibm.com>
Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210310174405.51044-1-ldufour@linux.ibm.com
上级 d943bc74
...@@ -200,7 +200,7 @@ static struct mm_struct *get_mem_context(struct cxl_context *ctx) ...@@ -200,7 +200,7 @@ static struct mm_struct *get_mem_context(struct cxl_context *ctx)
if (ctx->mm == NULL) if (ctx->mm == NULL)
return NULL; return NULL;
if (!atomic_inc_not_zero(&ctx->mm->mm_users)) if (!mmget_not_zero(ctx->mm))
return NULL; return NULL;
return ctx->mm; return ctx->mm;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册