From patchwork Fri May 11 19:05:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Souptick Joarder X-Patchwork-Id: 10394813 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 7E64760348 for ; Fri, 11 May 2018 19:03:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 593E728F8E for ; Fri, 11 May 2018 19:03:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4DCEF28F95; Fri, 11 May 2018 19:03:41 +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 D1E9D28F8E for ; Fri, 11 May 2018 19:03:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 909086B067D; Fri, 11 May 2018 15:03:39 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 8B89B6B067E; Fri, 11 May 2018 15:03:39 -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 7AA4F6B067F; Fri, 11 May 2018 15:03:39 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pg0-f69.google.com (mail-pg0-f69.google.com [74.125.83.69]) by kanga.kvack.org (Postfix) with ESMTP id 35B556B067D for ; Fri, 11 May 2018 15:03:39 -0400 (EDT) Received: by mail-pg0-f69.google.com with SMTP id z16-v6so2187607pgv.16 for ; Fri, 11 May 2018 12:03:39 -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=Y8ZTEqu8+1S4wuuYoR2/EF0zTl//uHANnQsBmSObgWU=; b=GDexoUONOyWpWCvxW+jF2kV95oN2Vln1g3TQ219fpB8zYfq8yvgzSLgrtplk/hw41V lHAuRth9JnWiPFXzkgTeSNBH5ZqK2s315DZ33tw4uY/np1xBzsXNVpdC+c4Tes4i/xW9 1HuMsS/fvnAlGQ0ZwMBmoHE7gOEPq+bdaMLUbiarquRlF1z9tttbkKiJjO2ZwVXmW8jy LF+sagNtvXEH64lt5amvZbgBx6+xXR53bYmZlNALoMVkHfDv6E6FPefv6nOQh6qN2yxh OvK76vmFrcbMFKj8TQ89fHz2K1qxTgBevnLlfaduYtGtwUvLZvtQdGryPxdLzj+7OVb4 toog== X-Gm-Message-State: ALKqPwdNF73XOdamVlYw1DbF8vfBVfpxfb+H4DTb8Tii5QDiHh6r971z oclshBR8ARLawAZo+ekdXDAZVsTNw5AoHjQLfn0iUyohZxoiCKZmTmW3me0dL7BcrQz09gqJkM9 cXOYvt49ATATreyvR4zR6sfSXzYGPL57XfpVgD7q8CIrg7thFfP9dS95b8RkONaFLUd/n+jWxnw 6iB3plOFpQs/8BrR3JUrux/zAMS6YMtg0pehLs3GPuiodbk7Zuzwlko4Xc3+YZx1SHRR1snEdm9 nsOteiYjzKoyMtLZdzad3rt5U1gsFyJ7Ook6xPXCirk38kGY1zy8Dr6eWmAvFf6aT11uuN7ULgi 3PMZFA71kaw13oiwrJ9BtDJ3xDge4IRq59SiMfhDcOWpJJSz1c0ZEsEzc7H/IjOcf/vqeJGOu1q T X-Received: by 2002:a62:6756:: with SMTP id b83-v6mr27769pfc.76.1526065418832; Fri, 11 May 2018 12:03:38 -0700 (PDT) X-Received: by 2002:a62:6756:: with SMTP id b83-v6mr27681pfc.76.1526065417314; Fri, 11 May 2018 12:03:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526065417; cv=none; d=google.com; s=arc-20160816; b=wCuVdGbEZH+2EquzL8aCllLZXHvvbWOX0DI4C2Z7kDb+thyc2DuyWB4N3MLCXXwm7x PbCbBeUaOts+l4pz2GFLGMlqMNdqbKsbwL7f3IsGkLaZBJbZUIC130ZnD/29G8ukijJZ zmYZQ5NopQ9ZCCVZe1k8pBDAvwCtXHiojYp5UpBSjdPb9uLuTbu7gAcjk5PzDMEpqVKZ 4Prfm/iekJnkImnAmckEPlob1uGKNrAr7XsWQceZLx1exQiDrEoqQdIEb1W/x/19EKtN vQvZoSOcwJq0G434g/jRKyRYrCNAef9Rn58dLcdLGl4c2/g3yjdNOC0V33JNAQ4i1Q/u gi4g== 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=Y8ZTEqu8+1S4wuuYoR2/EF0zTl//uHANnQsBmSObgWU=; b=XKTGpFt7M0UYB2/vTKevsaSNXp24CZAlhiAqVTAdw8xJVsCtoibEpfzq1fcwGViMIi ejyF0pmGuCI/EdB1OqaOs/jZKrFYTGTUNDUZnY/YgkBgNPsvbbVVWYW7TjJOjsFFBsPG lU3uSpJrUwopLW3dQr6AaO/Lv6o6jgvAhHziSK8eXyZwn8nROoTxGFlhJftCPUOfJJn7 7VOf0vMrmRKOVyoznGjVp15ubwbFq9LsOtCpSayXK0ZoZf39NgPwNjWsKxbKuOlawvj2 SKFn29jB4VNvmeIonCfh8BVbw2rZD0N/wSaUEeOS7P8URyhlK3ZkPfYOq4syJuB1j2NO p6mA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=a1gzeC6J; 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 7-v6sor1232270pft.128.2018.05.11.12.03.36 for (Google Transport Security); Fri, 11 May 2018 12:03:37 -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=a1gzeC6J; 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=Y8ZTEqu8+1S4wuuYoR2/EF0zTl//uHANnQsBmSObgWU=; b=a1gzeC6JCee0ybloXhkbKC+CoppXY5Hl68BycXw4wUtv+12kgtH3EShsHWcJs6FxFY hXrNuQCUhSbN/QT7nkf56ZIQ2KXX+nvajBfc7jCPwhInF17/eSouwSpeQQURiC1Zkcm8 sYzpUFf+YLm481mALADbEaN69O7A1P0b/Mbd0u68NHJOmlRbBD0cpOmxTP78COhEMeI+ nWfLfQJfjEGs5c2VTVipAU8YUEGUdBpn6+4GbnWyEeXPShtdRpr1k0TLJ1HTE1JIQYSx 5rzd9WZfHBkxm3pXxHkP2EBm32uY1gYEzrY9SGLj5cR0tv5DE0lFoNGIqY+X8ib/pMRc SdIg== X-Google-Smtp-Source: AB8JxZqYjL+lCxgKRahUVwYZxVtMokImrBwdVFN6ZX4rIFk24cD/1kW0fFY1iV/wzfhsRjZPQQ6osA== X-Received: by 2002:a62:3745:: with SMTP id e66-v6mr6320pfa.43.1526065416616; Fri, 11 May 2018 12:03:36 -0700 (PDT) Received: from jordon-HP-15-Notebook-PC ([183.82.18.121]) by smtp.gmail.com with ESMTPSA id n67-v6sm9925040pfh.188.2018.05.11.12.03.33 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 11 May 2018 12:03:34 -0700 (PDT) Date: Sat, 12 May 2018 00:35:42 +0530 From: Souptick Joarder To: akpm@linux-foundation.org, dan.j.williams@intel.com, jack@suse.cz, ross.zwisler@linux.intel.com, riel@redhat.com, willy@infradead.org, hughd@google.com, pasha.tatashin@oracle.com, mhocko@suse.com Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] mm: Adding new return type vm_fault_t Message-ID: <20180511190542.GA2412@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 include/linux/mm.h | 4 ++-- mm/filemap.c | 8 ++++---- mm/nommu.c | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) -- 1.9.1 diff --git a/include/linux/mm.h b/include/linux/mm.h index ad06d42..7fc4baf 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -2281,10 +2281,10 @@ extern void truncate_inode_pages_range(struct address_space *, extern void truncate_inode_pages_final(struct address_space *); /* generic vm_area_ops exported for stackable file systems */ -extern int filemap_fault(struct vm_fault *vmf); +extern vm_fault_t filemap_fault(struct vm_fault *vmf); extern void filemap_map_pages(struct vm_fault *vmf, pgoff_t start_pgoff, pgoff_t end_pgoff); -extern int filemap_page_mkwrite(struct vm_fault *vmf); +extern vm_fault_t filemap_page_mkwrite(struct vm_fault *vmf); /* mm/page-writeback.c */ int __must_check write_one_page(struct page *page); diff --git a/mm/filemap.c b/mm/filemap.c index 693f622..cae7e4f 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -2491,7 +2491,7 @@ static void do_async_mmap_readahead(struct vm_area_struct *vma, * * We never return with VM_FAULT_RETRY and a bit from VM_FAULT_ERROR set. */ -int filemap_fault(struct vm_fault *vmf) +vm_fault_t filemap_fault(struct vm_fault *vmf) { int error; struct file *file = vmf->vma->vm_file; @@ -2501,7 +2501,7 @@ int filemap_fault(struct vm_fault *vmf) pgoff_t offset = vmf->pgoff; pgoff_t max_off; struct page *page; - int ret = 0; + vm_fault_t ret = 0; max_off = DIV_ROUND_UP(i_size_read(inode), PAGE_SIZE); if (unlikely(offset >= max_off)) @@ -2696,11 +2696,11 @@ void filemap_map_pages(struct vm_fault *vmf, } EXPORT_SYMBOL(filemap_map_pages); -int filemap_page_mkwrite(struct vm_fault *vmf) +vm_fault_t filemap_page_mkwrite(struct vm_fault *vmf) { struct page *page = vmf->page; struct inode *inode = file_inode(vmf->vma->vm_file); - int ret = VM_FAULT_LOCKED; + vm_fault_t ret = VM_FAULT_LOCKED; sb_start_pagefault(inode->i_sb); file_update_time(vmf->vma->vm_file); diff --git a/mm/nommu.c b/mm/nommu.c index ebb6e61..90456a6 100644 --- a/mm/nommu.c +++ b/mm/nommu.c @@ -1788,7 +1788,7 @@ unsigned long arch_get_unmapped_area(struct file *file, unsigned long addr, return -ENOMEM; } -int filemap_fault(struct vm_fault *vmf) +vm_fault_t filemap_fault(struct vm_fault *vmf) { BUG(); return 0;