From patchwork Mon May 21 20:24:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Souptick Joarder X-Patchwork-Id: 10416313 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 142456053B for ; Mon, 21 May 2018 20:22:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 026B628A25 for ; Mon, 21 May 2018 20:22:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EB23828A29; Mon, 21 May 2018 20:22:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 56D6428A25 for ; Mon, 21 May 2018 20:22:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 44D2A6B0008; Mon, 21 May 2018 16:22:01 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 3FAC96B000A; Mon, 21 May 2018 16:22:01 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3121F6B000C; Mon, 21 May 2018 16:22:01 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pf0-f200.google.com (mail-pf0-f200.google.com [209.85.192.200]) by kanga.kvack.org (Postfix) with ESMTP id E2E626B0008 for ; Mon, 21 May 2018 16:22:00 -0400 (EDT) Received: by mail-pf0-f200.google.com with SMTP id e3-v6so9834527pfe.15 for ; Mon, 21 May 2018 13:22:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:date:from:to:cc:subject :message-id:mime-version:content-disposition:user-agent; bh=+aPuesvm1DvjacIZ3KVjjxzwwcaEezmwdi1QPGRyGSs=; b=WAN1sYxJ40iV85cBOgoX0GZRubgb66W3EYrCpmmdxUqv/RInp8qJJAPHRUHpWDizIy SAYNc+bqwUt0ViE3t+MxpwyYbFyXBxobVE0QfgjwMrp0butFfgdeCyT6N8+6yoLBirHW 27vxHYVYBc2ai6xhq09E65qYH+ySYKxBonblbKGCthe667OGa2nVG/Vd5f3fSDGZg3TI JRMwIXgW2Yf30LXOTHmunQQjAVDPAd1N9wRplkBvfjQbE8M5pODKYgGKAZIsonj6qM6y pxkw0BC2pWCdUGptQKkIDlFX7CPaJL4vAevzj95/E6c/0TgPuqY/F8FOvmgF+Qh5iAPL E++A== X-Gm-Message-State: ALKqPwepOoVaOoYxu/y3HJLvPfk0qUqEj4+ll2lLURdXcAJfrV2dV82M EKZOhXVQWEMQk8pkZntAAQ72gxKD2gtRXklfygGZ5wv3Kac0LNsLEwM3Z3GXzbDo4R6ezJwTiHc 0xL1Dw+Sb8bFMhLnYLrFKTiEXpWxgV/6oO3f2V3N4Cpp9vQ+9G8piOvvtLyWj/rGx91zd0va7Mx KbjBdFQGN4EjKq0tu8pFtiWQNwDjHUkjABK3sZqN75mHSJyS07j9EMBcIkcMCioM3eqaJC+Haoh uYpjixIFA8SSGupEWunrzeLgaprGmtGDIjtwm4wlfLOFMBOT4O9PsSciMdVRZTbyaDhn6zdo1va gXaFY7IzE69sgKLxcA1mKiCAUq6wP9Bjukm6eSLKjdFNSkdMA0wQuPr2aWT4CzUcpKAkW3983uW 7 X-Received: by 2002:a17:902:8602:: with SMTP id f2-v6mr21593551plo.5.1526934120593; Mon, 21 May 2018 13:22:00 -0700 (PDT) X-Received: by 2002:a17:902:8602:: with SMTP id f2-v6mr21593519plo.5.1526934119826; Mon, 21 May 2018 13:21:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526934119; cv=none; d=google.com; s=arc-20160816; b=dhnYYJDCvx/LVytPApe2g2rHbG4fdxx98NkUr/ssHUgwhPSnxtiGBbpA9eG5tqFC77 DTIMwZzzza6lI4Mz9ak/GSoqOy1QfWKqcNfoYzXAf+zoSO21cEfFS07ZRd1TdQ7CiJW7 tuhG5s6zR3U/XEtQ/qiU1RSIaeSFTlXDhWtAHultFVwuFVPZyTbR6Tbes4hm7xvSMqEG tpzwlDX5ZEdbTdlbQenc5//lk4gSIKGlIxikBlHOEew5mef4Yv6EoaAOf/K+dsSySWZH LufqCPPqnlwUVbW2G7xJGvaXOcABSpXzDJ/n5vf1Cf1WJAHg//ZEn0qWOS/o2QiXWeYJ svRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:content-disposition:mime-version:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=+aPuesvm1DvjacIZ3KVjjxzwwcaEezmwdi1QPGRyGSs=; b=GUnhBqZnwBZPFVo6l8TgI8AOvemQh2G33SstBvNZEc4XfsQqg+afe9H+N57WlL7ZF0 5vfAZhNCTNyFhlK3FoXCBeCDFXAu22DIHa2i8XmWvE57WNU2CuNA0K2JnYWkvwX7N6k3 pMXqL6VSFKZ8it6o5Bi2w1TD9yMAbYZKj/aU2w1FiwkfJ5pIxf8I2IBOva4Ez/KH8AK0 13TynxWjbTcGFZml/6asMCQGk9h/PJtoVJj9O+U36Y3ki1HrK/0MnrLt72q30NtjbIgJ 8hXKd06CHp7ntMYFjaLSGtHIrw9S4Mcg0LxbvB38zscQzufXBiFgDBpUQwjzdeOS/wTs Tj2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=qc0NvjeT; spf=pass (google.com: domain of jrdr.linux@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jrdr.linux@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id w17-v6sor5552367pfa.61.2018.05.21.13.21.59 for (Google Transport Security); Mon, 21 May 2018 13:21:59 -0700 (PDT) Received-SPF: pass (google.com: domain of jrdr.linux@gmail.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=qc0NvjeT; spf=pass (google.com: domain of jrdr.linux@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jrdr.linux@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=+aPuesvm1DvjacIZ3KVjjxzwwcaEezmwdi1QPGRyGSs=; b=qc0NvjeTdLSCHZM9hIo/Jd4qYLErgZ1qi7B432nr+0vRupNSo/RznrkrUscYcOFf6x wpkjjYrUWWDZJicBAWcVUC3d8xsU63as8fqyn5EzYJimQEJPR6VII6wLB56Z6zv+RSZ+ i2cgW5dbqITP02lFErI9+apz48dibCLJroZP6wGnhDX8JR+/YRzsd3bSKP42V3L6+adD ncj+3P1v/y0flocnV06yVKMgS5peRR0vlpxu+9sTyRWBRoLJC7dDAe/lh8hliolTsr1S Ot1AKCzHH9ccAo+Qs2apR7lylaaErCBE3QeqV19V8YSqR3NGDfBLTXI1N3r+XIU9Eh2O L11A== X-Google-Smtp-Source: AB8JxZp5MhOXm3RQcmQj7CUfde/bUqD7DSysxPFKD/Ae8GZU/8+JtjndvvvYu/Dqv0LXGZyiB7yvnw== X-Received: by 2002:a62:3cd1:: with SMTP id b78-v6mr21056231pfk.44.1526934118983; Mon, 21 May 2018 13:21:58 -0700 (PDT) Received: from jordon-HP-15-Notebook-PC ([49.205.216.54]) by smtp.gmail.com with ESMTPSA id y23-v6sm7196689pge.21.2018.05.21.13.21.56 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 21 May 2018 13:21:57 -0700 (PDT) Date: Tue, 22 May 2018 01:54:10 +0530 From: Souptick Joarder To: hughd@google.com, willy@infradead.org, akpm@linux-foundation.org Cc: linux-mm@kvack.org Subject: [PATCH] mm: shmem: Adding new return type vm_fault_t Message-ID: <20180521202410.GA17912@jordon-HP-15-Notebook-PC> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP Use new return type vm_fault_t for fault handler. For now, this is just documenting that the function returns a VM_FAULT value rather than an errno. Once all instances are converted, vm_fault_t will become a distinct type. Ref-> commit 1c8f422059ae ("mm: change return type to vm_fault_t") vmf_error() is the newly introduce inline function in 4.17-rc6. Signed-off-by: Souptick Joarder Reviewed-by: Matthew Wilcox --- mm/shmem.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mm/shmem.c b/mm/shmem.c index 9d6c7e5..6207c82 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -1931,14 +1931,14 @@ static int synchronous_wake_function(wait_queue_entry_t *wait, unsigned mode, in return ret; } -static int shmem_fault(struct vm_fault *vmf) +static vm_fault_t shmem_fault(struct vm_fault *vmf) { struct vm_area_struct *vma = vmf->vma; struct inode *inode = file_inode(vma->vm_file); gfp_t gfp = mapping_gfp_mask(inode->i_mapping); enum sgp_type sgp; - int error; - int ret = VM_FAULT_LOCKED; + int err; + vm_fault_t ret = VM_FAULT_LOCKED; /* * Trinity finds that probing a hole which tmpfs is punching can @@ -2006,10 +2006,10 @@ static int shmem_fault(struct vm_fault *vmf) else if (vma->vm_flags & VM_HUGEPAGE) sgp = SGP_HUGE; - error = shmem_getpage_gfp(inode, vmf->pgoff, &vmf->page, sgp, + err = shmem_getpage_gfp(inode, vmf->pgoff, &vmf->page, sgp, gfp, vma, vmf, &ret); - if (error) - return ((error == -ENOMEM) ? VM_FAULT_OOM : VM_FAULT_SIGBUS); + if (err) + return vmf_error(err); return ret; }