From patchwork Thu Jul 18 21:26:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 13736734 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6C1E3C3DA61 for ; Thu, 18 Jul 2024 21:26:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B543E6B0082; Thu, 18 Jul 2024 17:26:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B04586B0083; Thu, 18 Jul 2024 17:26:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9CD2E6B0088; Thu, 18 Jul 2024 17:26:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 81DB66B0082 for ; Thu, 18 Jul 2024 17:26:26 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 3A566C0176 for ; Thu, 18 Jul 2024 21:26:26 +0000 (UTC) X-FDA: 82354157172.20.A1D3302 Received: from mail-yw1-f170.google.com (mail-yw1-f170.google.com [209.85.128.170]) by imf30.hostedemail.com (Postfix) with ESMTP id 765BB80003 for ; Thu, 18 Jul 2024 21:26:24 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=toxicpanda-com.20230601.gappssmtp.com header.s=20230601 header.b=ka5dXIwB; spf=none (imf30.hostedemail.com: domain of josef@toxicpanda.com has no SPF policy when checking 209.85.128.170) smtp.mailfrom=josef@toxicpanda.com; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1721337963; a=rsa-sha256; cv=none; b=eVhl1LOeWsmltVL5dUf4Xa5jnTZzj29gsdJYtnIk/rYj/14fQLLNmJAknDn3M2jAgvQTtV 9Xt2YY2b43jyMnsxHMisz0f/+pcTzTfDqQ+IzSLRTUIJ7cLwdcy+kmBZXhZvYvMBw788F4 k2w4SdM3qq916ydTz+oIDjyfywfs4og= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=toxicpanda-com.20230601.gappssmtp.com header.s=20230601 header.b=ka5dXIwB; spf=none (imf30.hostedemail.com: domain of josef@toxicpanda.com has no SPF policy when checking 209.85.128.170) smtp.mailfrom=josef@toxicpanda.com; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1721337963; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=VeLCrtUWDOmZ/Zjcy+zwponNnjpz5v7iXp/4IVH7M8c=; b=7zK8Fo61CL8Kd1u/3XpvgnlB7seeHHEauoTxehtOYmoVQ/freSSC0AXfSW+nlgpHU8W0Lj gkZImJfY00Y/VbsyDLB2Ls0DDQXVhiHb7RFYJqU3xPeZpLi+qGH1KY6NX94AFkWQDI/grS vFdjNw0VaDFnK+IH/jeHpQXcBeQkE9k= Received: by mail-yw1-f170.google.com with SMTP id 00721157ae682-6694b50a937so1337547b3.0 for ; Thu, 18 Jul 2024 14:26:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toxicpanda-com.20230601.gappssmtp.com; s=20230601; t=1721337983; x=1721942783; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=VeLCrtUWDOmZ/Zjcy+zwponNnjpz5v7iXp/4IVH7M8c=; b=ka5dXIwBLBvFw950x8GN41jffX8sHTAiTG0hYKUalL/E9k1W9ahEYVknSl4SYy5q7x sF38ZGpYlEMgobPGvBdAwfj2wDorsrjfefif0k24sJmnSRGQbRDdVFpc4LddIZDdZBFL HXC6TGB5jmKksVgXAEE35fCRxhpzIdRPMReNctBUk6jt9Ph0DL26E0yhWo/CKhRfAHi8 HS9jFKIYf7FTSOiJGKFkXUawVN6S6sePRFUj/EdnfOQ8eaK5k5U5PPdGfPc9i85nTqhS 2SGC5KVvLGzEdSH09W/wSqOFlgiTDOJpx6ls/FceVn29jwluCBhzvG5Ygr5+EsJ8UwB6 7DbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721337983; x=1721942783; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VeLCrtUWDOmZ/Zjcy+zwponNnjpz5v7iXp/4IVH7M8c=; b=EvcyTL019fnMvmiMrLX16jZvdnRbIhVYJDvmxPG5AL+nobg7qqK034B1aGvPorK6JD jaYZ+iDxs91oWq+avgdN93TlmrYujY9VCTravu6RFqeZDpbyvlsve/emLUj4fz82YqDK T51X8dLfOChcpBKbo7afQqLi7usO459Zshs4Wjr6qM0K/uxClfEbECQ/OfqTfUyFkTS8 mMj9PJXTHgmG+MeibTFHv/sharHrLIQg2u5735Ipg7RG/edoTZ+nMyMJvQ85g/hbANpE JtvR2HvKmQ9ZmKSWVhJK9yQ+3HAgkYu4VpMhCazPaZ4I6Card1JrB5bkF+QsZ1N96Vmb hCyw== X-Forwarded-Encrypted: i=1; AJvYcCUuB6M261DtrMKczu5VQSGBPGS3tehNqhOZU0g6yBAAaW3fA2IVPoeruyj5knONRO1NhjZsySPOLx6E/xBlUN+ooiY= X-Gm-Message-State: AOJu0Yxz8jjPp0L2YZ3EReuPs0wxiE8xig6lukLGUxyogAyjR8zH+flM h4M2OtHoe8EXMRNoW0BhoTGte6dOsslph72RNXnoW2/EEWhrGgqnw8ijnlrjxRtPHEkEwjwveqJ r X-Google-Smtp-Source: AGHT+IFc2dwQh+rfisu4HFiIreoKl5iW23W7I0gxhIn1J2qvF/ve0hTAxKJGkkpddPjGQ4KoMTvslw== X-Received: by 2002:a05:690c:2a89:b0:667:e5fa:5d4f with SMTP id 00721157ae682-667e5fa6363mr27633667b3.46.1721337983511; Thu, 18 Jul 2024 14:26:23 -0700 (PDT) Received: from localhost (syn-076-182-020-124.res.spectrum.com. [76.182.20.124]) by smtp.gmail.com with ESMTPSA id 00721157ae682-66951f72228sm377637b3.10.2024.07.18.14.26.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jul 2024 14:26:23 -0700 (PDT) From: Josef Bacik To: akpm@linux-foundation.org, linux-mm@kvack.org, kernel-team@fb.com Subject: [PATCH 1/2] mm: cleanup flags usage in faultin_page Date: Thu, 18 Jul 2024 17:26:06 -0400 Message-ID: <2df51a54c06bdf93e1cb09a19a9ef1df6557b59e.1721337845.git.josef@toxicpanda.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 X-Stat-Signature: r8opsixpj5j53fwqiehi8sg1myufxj9d X-Rspamd-Queue-Id: 765BB80003 X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1721337984-793992 X-HE-Meta: U2FsdGVkX1+m3LCnedWzxTXcYZzINrSIyQmUNCU/6/Kyf49mgxGeI2nA9HBNjuzTUX8eD1WDVo4zdPFMCNiHalXjsXkoOx8gEaX0m9yI93ofFq9CWkNiJOnb88P6aT2FIW/9MnFc9fHpbQ6zNh6Sh69NT9gec/qGVGL5G+RwVDc8o4EmlcI1uMvMvabkhaX39lTT8NVgJG8QpQDBoj1lVmjIJODE8aHjjPuvCoX4ZGHPc18dIyinZWEN1kYAzazlgbElQOhHGgZFNGUrqP7B6Fjrt0MIqj66Cd57LatWwpFAIPhqceB4UBw7aBowbskXvU/4gp0gCvqBrMOld8oGQapAoqtBqgM6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2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: We're passing a pointer to the foll_flags for faultin_page, however we never modify the flags in this call. Change this to just take the flags value instead. Signed-off-by: Josef Bacik Acked-by: David Hildenbrand --- mm/gup.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/mm/gup.c b/mm/gup.c index 54d0dc3831fb..985d5141592f 100644 --- a/mm/gup.c +++ b/mm/gup.c @@ -1153,19 +1153,19 @@ static int get_gate_page(struct mm_struct *mm, unsigned long address, * to 0 and -EBUSY returned. */ static int faultin_page(struct vm_area_struct *vma, - unsigned long address, unsigned int *flags, bool unshare, + unsigned long address, unsigned int flags, bool unshare, int *locked) { unsigned int fault_flags = 0; vm_fault_t ret; - if (*flags & FOLL_NOFAULT) + if (flags & FOLL_NOFAULT) return -EFAULT; - if (*flags & FOLL_WRITE) + if (flags & FOLL_WRITE) fault_flags |= FAULT_FLAG_WRITE; - if (*flags & FOLL_REMOTE) + if (flags & FOLL_REMOTE) fault_flags |= FAULT_FLAG_REMOTE; - if (*flags & FOLL_UNLOCKABLE) { + if (flags & FOLL_UNLOCKABLE) { fault_flags |= FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE; /* * FAULT_FLAG_INTERRUPTIBLE is opt-in. GUP callers must set @@ -1173,12 +1173,12 @@ static int faultin_page(struct vm_area_struct *vma, * That's because some callers may not be prepared to * handle early exits caused by non-fatal signals. */ - if (*flags & FOLL_INTERRUPTIBLE) + if (flags & FOLL_INTERRUPTIBLE) fault_flags |= FAULT_FLAG_INTERRUPTIBLE; } - if (*flags & FOLL_NOWAIT) + if (flags & FOLL_NOWAIT) fault_flags |= FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_RETRY_NOWAIT; - if (*flags & FOLL_TRIED) { + if (flags & FOLL_TRIED) { /* * Note: FAULT_FLAG_ALLOW_RETRY and FAULT_FLAG_TRIED * can co-exist @@ -1212,7 +1212,7 @@ static int faultin_page(struct vm_area_struct *vma, } if (ret & VM_FAULT_ERROR) { - int err = vm_fault_to_errno(ret, *flags); + int err = vm_fault_to_errno(ret, flags); if (err) return err; @@ -1490,7 +1490,7 @@ static long __get_user_pages(struct mm_struct *mm, page = follow_page_mask(vma, start, foll_flags, &ctx); if (!page || PTR_ERR(page) == -EMLINK) { - ret = faultin_page(vma, start, &foll_flags, + ret = faultin_page(vma, start, foll_flags, PTR_ERR(page) == -EMLINK, locked); switch (ret) { case 0: From patchwork Thu Jul 18 21:26:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 13736735 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 98837C3DA49 for ; Thu, 18 Jul 2024 21:26:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D9E626B0083; Thu, 18 Jul 2024 17:26:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D81A66B0088; Thu, 18 Jul 2024 17:26:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BA1956B0089; Thu, 18 Jul 2024 17:26:27 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 9B4516B0083 for ; Thu, 18 Jul 2024 17:26:27 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 51106C0245 for ; Thu, 18 Jul 2024 21:26:27 +0000 (UTC) X-FDA: 82354157214.14.1D02FC9 Received: from mail-yb1-f177.google.com (mail-yb1-f177.google.com [209.85.219.177]) by imf01.hostedemail.com (Postfix) with ESMTP id 834134002B for ; Thu, 18 Jul 2024 21:26:25 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=toxicpanda-com.20230601.gappssmtp.com header.s=20230601 header.b=chDaZlN1; spf=none (imf01.hostedemail.com: domain of josef@toxicpanda.com has no SPF policy when checking 209.85.219.177) smtp.mailfrom=josef@toxicpanda.com; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1721337953; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=v7PBVSx5ziDZwaVY9t5GrY4NmBJYpcAQRHUzVDOo2BU=; b=piQOuOC6t4JnhudXA8S+js1IsObK5OankZnAiZ0AxV7t3VMQN6Uz/kC4QxoBh+gWbGpoT2 uib77TlLTGBUqdSTy0gJULwHXrxMB9MMJGuG3h/qhPQ0AA+vPjeRdybYOmUtyZ2g89Ruvu aFS3KdSX1bqnXjEkPYj4GPQbUglByMY= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=toxicpanda-com.20230601.gappssmtp.com header.s=20230601 header.b=chDaZlN1; spf=none (imf01.hostedemail.com: domain of josef@toxicpanda.com has no SPF policy when checking 209.85.219.177) smtp.mailfrom=josef@toxicpanda.com; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1721337953; a=rsa-sha256; cv=none; b=gyYuyFhRrVJ+SO7pZs8akZ9p7kAVDRVTWtNyVISsxKJA11cZM53MXMVJU0mhjjtenzOtuP z4ZsVYyDibq1OI3ViHkdEEXagI2ziiwXBaomG7QsI8H7M4RU+SXFGj4qfg0Vd4/h222WZJ gOZCoPh9wMkobF4Ka0BBooDHnGlfgFQ= Received: by mail-yb1-f177.google.com with SMTP id 3f1490d57ef6-dfdb6122992so1153658276.3 for ; Thu, 18 Jul 2024 14:26:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toxicpanda-com.20230601.gappssmtp.com; s=20230601; t=1721337984; x=1721942784; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=v7PBVSx5ziDZwaVY9t5GrY4NmBJYpcAQRHUzVDOo2BU=; b=chDaZlN1Ox9O75jZYMIExT0PaxY5+VAVdA6Akbld3oz2iQnQ6t2QUwaO31iht5grJ7 KmpsQVv4D1HA3AmLKo1VXMskLuZ84Y1uXWHOgy15aFbIpcqHsGIBExd1ssNbeJvn4Gsf 5DmbwzPAEfWPsd0j0mqZyuLX38KCxLQLG7QQekKG0FzdnIsAH04hnWdbuiFj/mlRFrp6 xHzRiDGc4KtCH975EKpQgpQOG0oSMZx+W8YP515e+4P/NoIezn7tzGtpmXcxhr+MwpmL I6rNsKNtOCuLBaRFblyQ+riX5+Af2WuDYOij59+iKe9FEH1VjDgCukMAzxFpa0kPBRu9 DmTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721337984; x=1721942784; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=v7PBVSx5ziDZwaVY9t5GrY4NmBJYpcAQRHUzVDOo2BU=; b=WoGMU2HcYu6OvLaNhUJ5YIUG5t6pI0q23crDUAHIvq9U8/XhiQGFWy5e66OXneOqb9 ac4ZbBnpgbTMH03Eg382uZQU0eJM/C/KtZBvdESMlixmDwvs0excTOTdQqXSwqs8AB5Y poD3KpKQiXCtlYnqrcLovm4nyovEg28wSDON3dEPhWrtSqye9ZHdHaMyamGUHlrZlpfS PWeixuqrHKYdP5IpTkjgf/WlILP2ErutDwlFnKik4D1FQeVYiWwkoeLD6Vjfe8KHzXRH oNUfz6hG56c9DHK9Ek75Aawh6n7196sN8zTKXnQWPxD2ArJST+lxBtgEqjoaJJt4eodG oshg== X-Forwarded-Encrypted: i=1; AJvYcCWNbiR664xnfb1vWSHMFkN7OvBb/Iv72NUKvaWOIh4AYX6da5J007N5WP4876q+qUrc+mHWEU/swfTMX5gFGo8wugA= X-Gm-Message-State: AOJu0Yxc2ZexvVMuimymAEOOY/1BaZS2BhRkOR4qwcvms75ZPcoLjHnM T34augMpiqNHwQI4h/q5Z0SkC0vXSyFY2pT0vbf+F2XPse7BQwz3us76tLNFBWGZ3644zd3y6JB s X-Google-Smtp-Source: AGHT+IEnhJ0CLvoaY+kk8HWf+SUqKrEaAogw+0SymN/AiUjlOYsjPJzFv/oxl0O4Yz2SiQIP4/3GZA== X-Received: by 2002:a05:6902:1603:b0:e03:aa52:d804 with SMTP id 3f1490d57ef6-e0640dbf6dfmr4109342276.29.1721337984531; Thu, 18 Jul 2024 14:26:24 -0700 (PDT) Received: from localhost (syn-076-182-020-124.res.spectrum.com. [76.182.20.124]) by smtp.gmail.com with ESMTPSA id 3f1490d57ef6-e08609f4afbsm23174276.32.2024.07.18.14.26.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jul 2024 14:26:24 -0700 (PDT) From: Josef Bacik To: akpm@linux-foundation.org, linux-mm@kvack.org, kernel-team@fb.com Subject: [PATCH 2/2] mm: remove foll_flags in __get_user_pages Date: Thu, 18 Jul 2024 17:26:07 -0400 Message-ID: <1e79b84bd30287cc9847f2aeb002374e6e60a10f.1721337845.git.josef@toxicpanda.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 X-Stat-Signature: 9mu1odud1k33hkan9dozsfcc8xkdnur6 X-Rspam-User: X-Rspamd-Queue-Id: 834134002B X-Rspamd-Server: rspam02 X-HE-Tag: 1721337985-157332 X-HE-Meta: U2FsdGVkX193soWAVO6nSESUyMYd3gYp7XoQ4olFjFGx2DC1G+F1VKy5p+e9IZK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RlA3ERtt0Fy9Ra+wbwNl3++h0dSHD3fvHPjMwDjokXfNcyhANgSNeBv0deAHvG+hsesi9TFpPdIXyCam8pY42OnTLc7iJ0SvmK+QM530FY3WLAmhvXSlWvoGcaa8xru8QmBVov3b0FJce5tdJ/+q6KBI0HtLJtvtbZc3RKTpv28uAex3lSEvyBo95jHKz3Ialilp5v3evf1U+QLNezzegbyNnyk58dVlMtY3gYbfjSpRWW/004TUJG+5/AeSup0UU= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000231, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Now that we're not passing around a pointer to the flags, there's no reason to have an extra variable for the gup_flags, simply pass the gup_flags directly everywhere. Signed-off-by: Josef Bacik Acked-by: David Hildenbrand --- mm/gup.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/mm/gup.c b/mm/gup.c index 985d5141592f..120740cf5a34 100644 --- a/mm/gup.c +++ b/mm/gup.c @@ -1437,7 +1437,6 @@ static long __get_user_pages(struct mm_struct *mm, do { struct page *page; - unsigned int foll_flags = gup_flags; unsigned int page_increm; /* first iteration or cross vma bound */ @@ -1488,9 +1487,9 @@ static long __get_user_pages(struct mm_struct *mm, } cond_resched(); - page = follow_page_mask(vma, start, foll_flags, &ctx); + page = follow_page_mask(vma, start, gup_flags, &ctx); if (!page || PTR_ERR(page) == -EMLINK) { - ret = faultin_page(vma, start, foll_flags, + ret = faultin_page(vma, start, gup_flags, PTR_ERR(page) == -EMLINK, locked); switch (ret) { case 0: @@ -1547,13 +1546,12 @@ static long __get_user_pages(struct mm_struct *mm, * large folio, this should never fail. */ if (try_grab_folio(folio, page_increm - 1, - foll_flags)) { + gup_flags)) { /* * Release the 1st page ref if the * folio is problematic, fail hard. */ - gup_put_folio(folio, 1, - foll_flags); + gup_put_folio(folio, 1, gup_flags); ret = -EFAULT; goto out; }