From patchwork Sat May 12 06:37:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Souptick Joarder X-Patchwork-Id: 10395821 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 D7B7460390 for ; Sat, 12 May 2018 06:35:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B883228E99 for ; Sat, 12 May 2018 06:35:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AA0C428EB5; Sat, 12 May 2018 06:35: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 3252A28E99 for ; Sat, 12 May 2018 06:35:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3A4DC6B06E3; Sat, 12 May 2018 02:35:40 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 354BB6B06E4; Sat, 12 May 2018 02:35:40 -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 26B336B06E5; Sat, 12 May 2018 02:35:40 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pf0-f197.google.com (mail-pf0-f197.google.com [209.85.192.197]) by kanga.kvack.org (Postfix) with ESMTP id DA0C96B06E3 for ; Sat, 12 May 2018 02:35:39 -0400 (EDT) Received: by mail-pf0-f197.google.com with SMTP id 62-v6so4695752pfw.21 for ; Fri, 11 May 2018 23:35: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=WTdbY0GOb7HhhgDv4lqxX2T7AT9djk1gyJY781u44E0=; b=g5ajJakUCOOci/XRxUpnaQJ2MB4k8OvqdPFxMjqbogNQOsh8l0cRh796WNXX5x1uHt MMB5YguhIDIc+e4Z5sA404ar0Jh/7ntEC5GeJzW+3uhsrQbijTzco92PtDo4qGImJ5/m B7Iy59HRF6d4KMpmQk/7tRAxNuuNVw4jdP0WRqR5M1RDlrPPw6c4ho/VLQSkgtOqnMao I8uPV3+G9Q9fWr7k2kCptuZE+ZJFAxkNNHeg9dayZ0qe7ZWybTj/jJkuL6AtXLSQMri2 5jY1kyNnIq2YCYSD9M1teYn4owML/+LfbUJK+R7bfth8yW/twyXJZllvV8nFClE8Wrmu zh0Q== X-Gm-Message-State: ALKqPwdfu8K6WQIIZ1HxHh4YwEwiuuH5FpwO+4ldarJkn6k/2G1q9kLW LDTD098syMY/NZG7u6Q3t6X5LhJGGE5JU4ctEXIO8rmNMK1iRgAXuFK6yG6MlDtRBbJHIfvDXDu KxyOlItjq3gHG+fhEP+yzOunXNu7TXKhBoWS9w/Ia1tW2SZ39/mzohYZRbdJRY/B7SMDic8bzwl p8dA+AkW7txal+VCEs1bKHnLIUPleBvP96o4mhHPecpFkgaIyQEKyeYmXT+4O/doo+7HttX9tNG uPWZbdGxLuJ32VyHfJcNVWqEv18/yQj6vIoT1NS2EESxmjN0Exb6EBE4MGOmc8gx0mgx0YpYLpa QrrAkjrIoRrdgNx26b20w/kN4KLd9TwKqwxAQX7Ukn8Wyge+22jbEUVMnKmm7Gtwcei2WLNUsLf L X-Received: by 2002:a17:902:5409:: with SMTP id d9-v6mr1260277pli.1.1526106939545; Fri, 11 May 2018 23:35:39 -0700 (PDT) X-Received: by 2002:a17:902:5409:: with SMTP id d9-v6mr1260251pli.1.1526106938930; Fri, 11 May 2018 23:35:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526106938; cv=none; d=google.com; s=arc-20160816; b=FBzuXqpYjIqeCPFlW/qm1u5CpUIpMVauKMmO85lvMsbTuv7yX8aGSk4Bsq2RjWGN+H Dv68c11zskYIP9qnPpLga0lgBdr8lA5Bkmv3GeTkR+geZZjdPEqO/cBGt0lhtIWPAX8C JO/bNXiO0K1KyU66z1M2RBa94U3XkBOl9kZz78K2NVragpqqlvmKUrFxzeJDSMzfmX15 vpG/pAmk/fjJEc5Ox8qSciJcy7+ytMzItgBA9s8LsCt/WnmnpYRLfMHbTvsYQcV2sRdL iS5Zc49iQ34syeoXoVqcoer+JSpYqMDMH6sZXsPL+FH+uEYHEmbFxn9vvGK0ckPpLfK2 0BVw== 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=WTdbY0GOb7HhhgDv4lqxX2T7AT9djk1gyJY781u44E0=; b=HKTCtB/DZCbQXTliruTqpDl//udRSFimTfhHAY5cn7WZchC/B63+4eeSoDqE1fyqya Tw3ZyoSxQykbEBBFaxoJHRsU/zquf0suD/j7BCBoVhEnYs6YwVD44aafNSgyIIL5MN1K hHa4R33mTA0d6+FlnoO0tkKw0NEpIKZiO+sdROGdd5tK2nKgqEUTPgQMpdjcH4d6B2+a jCZXzzswQcoaSvfkS67/dzMlmArCBAj6qtsrgumPK3BGgzFg1TmNRorxkM1cetaTt6CX hJQdXBE6aB/tHdQXCIwYZzRRAKZWY37P4E5NK/HJvRrs8aoGAwQPaRctr/7u0C+Je6QF PuDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LAkIw9tW; 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 e22-v6sor2336267plj.134.2018.05.11.23.35.38 for (Google Transport Security); Fri, 11 May 2018 23:35:38 -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=LAkIw9tW; 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=WTdbY0GOb7HhhgDv4lqxX2T7AT9djk1gyJY781u44E0=; b=LAkIw9tWHqFHWKP5owoPibckYcaZY7PQe2I0kKYVCB2QHAw+goniYytBiF7p4vEmnf vwi0symzXcfhsTMRUALKYyx6dkgSKg9E4oj6IBEucREng/L5a4s/qB6LjOu4t/BxdXcB /fVSHjoE3+KzqmbDUJLXGtLOAA6B9yCY89DYnzdIdbkP5Hn+a+UJw+rPfDcE0fGCz9xO YuDLOOcua8GcU+YcmeREv15fAkZj/09KMPBOFL9fwo2mjSYkAOXoRQ9DrUqy2eUpcnXE n61UMzXFQ++IFl0gEVMcnIdCZmhc6VmrajSasSYmj51ISbdBObNLsTYhkIDqYIccvRfg QNjA== X-Google-Smtp-Source: AB8JxZrXnpCPqAEQMMvefpJy/REAMynDePaXDZ6PtaGZG1T96aS8zex/Ng5I1GLD7VtvU0lQT7DMoA== X-Received: by 2002:a17:902:4545:: with SMTP id m63-v6mr1294157pld.268.1526106938523; Fri, 11 May 2018 23:35:38 -0700 (PDT) Received: from jordon-HP-15-Notebook-PC ([49.205.216.88]) by smtp.gmail.com with ESMTPSA id 67-v6sm8808890pgg.91.2018.05.11.23.35.36 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 11 May 2018 23:35:37 -0700 (PDT) Date: Sat, 12 May 2018 12:07:46 +0530 From: Souptick Joarder To: joe@perches.com, 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 v4] mm: Change return type to vm_fault_t Message-ID: <20180512063745.GA26866@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 --- include/linux/mm_types.h | 6 +++--- mm/hugetlb.c | 2 +- mm/mmap.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 2161234..cde40e6 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -627,9 +627,9 @@ 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, - struct vm_area_struct *vma, - struct vm_fault *vmf); + vm_fault_t (*fault)(const struct vm_special_mapping *sm, + struct vm_area_struct *vma, + struct vm_fault *vmf); int (*mremap)(const struct vm_special_mapping *sm, struct vm_area_struct *new_vma); 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;