From patchwork Sat May 12 06:17:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Souptick Joarder X-Patchwork-Id: 10395813 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 A0487602B1 for ; Sat, 12 May 2018 06:15:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 886B928D32 for ; Sat, 12 May 2018 06:15:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7A71C28D2A; Sat, 12 May 2018 06:15:10 +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 06A6C28D2A for ; Sat, 12 May 2018 06:15:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4C4E86B06DB; Sat, 12 May 2018 02:15:08 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 4740C6B06DC; Sat, 12 May 2018 02:15:08 -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 33D586B06DD; Sat, 12 May 2018 02:15:08 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pg0-f72.google.com (mail-pg0-f72.google.com [74.125.83.72]) by kanga.kvack.org (Postfix) with ESMTP id E65B76B06DB for ; Sat, 12 May 2018 02:15:07 -0400 (EDT) Received: by mail-pg0-f72.google.com with SMTP id s7-v6so3010618pgp.15 for ; Fri, 11 May 2018 23:15:07 -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=mf/sLJA/A3JMapLEE/NsXFKtWKkoJ1jj5G0868vwQ0s=; b=e/M48aXMc08kcg9HDqmr2xEnn/Y/66qpY97Gg6H105eIdSJrtAzJcYCFl+jPAUmlL6 9gwnXRMOnE4ofUD0N8zY/EjHwrIey2a6R1oDr9VbRg3H8c41HS2rCKYnwl+b3aCm3JLk yy7wqz7zdWrUGK9yCAhc3EoDuz4cH/kLCUjR6Foh9uLRe6OA+bgh9+C5jYv2ZrxVESrK Dm9ktJvpdSlywVVJwuo7IH1n83nHYRq9b6l0Fy823TtwIqxb4QmMaXmSpfeLM7LFCGwo UDYV0lR0qInBOA+b484pGwAIeu2w8aX5jSNJAv9mfZhYZRGvzfn1BSWb1TUwCN9JG3cN BXqQ== X-Gm-Message-State: ALKqPwduhyizope4Z35+Xx16ez1AxveL3+B1eGz3H7lgg10FznKZU20k 2lRYpCc8PA5WYhi5goaSB8QZWcNu9ybFt9SR4wFNf+YG5bCWMaznQlW4LLNIdtKKxvxGmPyLKnm CgU9wBR2kWQ06GWP2LqOVGcO6wfdsTBk03ag85XLdEfVPUB/TBuwAyVaNW+bQalLaxGL5Lb2a4y UAAcoXRQ/zWKPH0V6XiJUMKTxLiQI/WCHFS/NhASBrVArHIn6VH1XVhRWmj/hM1EQvW1WNYHyGb cU9sme55SNm9dTM/aievFRVXO/LQrLx/NGwAoiauZw0TVBaJEWkQo0MUjEbmWYOmhbsrCdkljF5 pSzXPUlqQR6ks26sac385JKckqQV60fOAR4+K+s91loCkmrVMjhnagNI+6jOU2ZEtquX+cSv3qO L X-Received: by 2002:a63:790e:: with SMTP id u14-v6mr1707639pgc.445.1526105707563; Fri, 11 May 2018 23:15:07 -0700 (PDT) X-Received: by 2002:a63:790e:: with SMTP id u14-v6mr1707599pgc.445.1526105706507; Fri, 11 May 2018 23:15:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526105706; cv=none; d=google.com; s=arc-20160816; b=cSy5YVHP9a5JR7RvKhjXxwXF/BqggwGAXs9z+gGgfzZcyuzzmFP/gjzWZFpzmqRzRy FjvDpGyY+80gpgWGJdPb4iBN1Pb9aR8VBfl0/Rd/ljshxFjNFNAAY56O79uIf/jyOVNF g4qQEM0Ef7C0bIDbWVeMi+HRFyBswZBKKhJk1REcrFAHPAcSDsUyeJv0uFWI+/uejxXc WO0twiZT3x8whyjrKL1nEajXVlo8Hf5vuvJVrON65K8FO1I5dsUZlI5rpFTXBpT/nJUk Iz+7iIlIzcuqryRiCAXw3q533V+7Dr26NlXkGcfurvbaHh3ajIpl0zWsekwO+M7GMOtW upqQ== 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=mf/sLJA/A3JMapLEE/NsXFKtWKkoJ1jj5G0868vwQ0s=; b=0B+2vqcaRUwjOfOwJhTbgHpxv3us+rIoUtbAD9i1BPzKhKFI/f1FklFqP6WQ+yUVvu rYqO93VPklo/ILpy95bo0pdDj7fN24/xswMEf3FYpC8OnssPlDqh89dRiX10mewIQkhK saE33K5Ye7tNRwtlpDPJQTfFI5HxUhXw0olzR5yzq956n/rsOj549/wa3bygQSwfhJyB n0ytEZJ1JrC6vmTxCRZscZK9iuzYqHuD9uhUqXV6KCexqi8adu9kdH4opKCQnOsROduS U6C7FUrj7gMtlgBwTFNNt9A6KQK7wUP/wY53lbKepnsC54Yw2odHe/ML817I93Q5Lgg+ ru5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Ux3yavXY; 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 u196-v6sor1738993pgc.38.2018.05.11.23.15.06 for (Google Transport Security); Fri, 11 May 2018 23:15:06 -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=Ux3yavXY; 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=mf/sLJA/A3JMapLEE/NsXFKtWKkoJ1jj5G0868vwQ0s=; b=Ux3yavXY8rF1kbxd7anFfoYNUMIBC7e8cKjXTDQ0IBD3x+zs2gqgS0Z0fGEhMbPfZa TwD8WC4P3054xcYcOMMHwJjhHXS8eQBZNcymLLi4oY9/JGub2Z4Rmt+OYqcDRBdPHV0n Px0lBT6d0/ZAL0xJdiIU4AunNq/gEi9L+avkXwgkuklow3m4V6R3rbtfF0mrMthlvQAZ cqD8y6lpF+H6ag/uJi26V6VltUqzQWbEb3ApEgdpw14VnKrTB6G+N70XG/uAErLRugnj W7jqvNk5HaDAhFnitk4xLMid02qMkQlxOAR6+i9eyDvMgaWKeSLPrebxVu6c+msCxwSi AOlQ== X-Google-Smtp-Source: AB8JxZrt3cCZAwXzqiPpdD0BlhleJPA4ckDzpGr8aYIIXXZMrdUCnk6kcb206bgFz4mGqxlxaB7mEw== X-Received: by 2002:a63:a41a:: with SMTP id c26-v6mr1728540pgf.311.1526105706035; Fri, 11 May 2018 23:15:06 -0700 (PDT) Received: from jordon-HP-15-Notebook-PC ([49.205.216.88]) by smtp.gmail.com with ESMTPSA id i72-v6sm11768437pgd.60.2018.05.11.23.15.03 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 11 May 2018 23:15:04 -0700 (PDT) Date: Sat, 12 May 2018 11:47:12 +0530 From: Souptick Joarder To: akpm@linux-foundation.org, mhocko@suse.com, hughd@google.com, dan.j.williams@intel.com, rientjes@google.com, mike.kravetz@oracle.com, n-horiguchi@ah.jp.nec.com, aneesh.kumar@linux.vnet.ibm.com Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, willy@infradead.org Subject: [PATCH v3] mm: Change return type to vm_fault_t Message-ID: <20180512061712.GA26660@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 in struct vm_operations_struct. 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. commit 1c8f422059ae ("mm: change return type to vm_fault_t") Signed-off-by: Souptick Joarder Reviewed-by: Matthew Wilcox --- v2: updated the change log v3: added changes into the same patch include/linux/mm_types.h | 2 +- mm/hugetlb.c | 2 +- mm/mmap.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 2161234..11acfdb 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -627,7 +627,7 @@ struct vm_special_mapping { * If non-NULL, then this is called to resolve page faults * on the special mapping. If used, .pages is not checked. */ - int (*fault)(const struct vm_special_mapping *sm, + vm_fault_t (*fault)(const struct vm_special_mapping *sm, struct vm_area_struct *vma, struct vm_fault *vmf); diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 2186791..7e00bd3 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -3159,7 +3159,7 @@ static unsigned long hugetlb_vm_op_pagesize(struct vm_area_struct *vma) * hugegpage VMA. do_page_fault() is supposed to trap this, so BUG is we get * this far. */ -static int hugetlb_vm_op_fault(struct vm_fault *vmf) +static vm_fault_t hugetlb_vm_op_fault(struct vm_fault *vmf) { BUG(); return 0; diff --git a/mm/mmap.c b/mm/mmap.c index 188f195..bdd4ba9a 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -3228,7 +3228,7 @@ void vm_stat_account(struct mm_struct *mm, vm_flags_t flags, long npages) mm->data_vm += npages; } -static int special_mapping_fault(struct vm_fault *vmf); +static vm_fault_t special_mapping_fault(struct vm_fault *vmf); /* * Having a close hook prevents vma merging regardless of flags. @@ -3267,7 +3267,7 @@ static int special_mapping_mremap(struct vm_area_struct *new_vma) .fault = special_mapping_fault, }; -static int special_mapping_fault(struct vm_fault *vmf) +static vm_fault_t special_mapping_fault(struct vm_fault *vmf) { struct vm_area_struct *vma = vmf->vma; pgoff_t pgoff;