From patchwork Thu Jun 15 22:01:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 9790325 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 266AB60325 for ; Thu, 15 Jun 2017 22:01:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 18E2128417 for ; Thu, 15 Jun 2017 22:01:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0D654284E4; Thu, 15 Jun 2017 22:01:05 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 95556284A8 for ; Thu, 15 Jun 2017 22:01:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751888AbdFOWBC (ORCPT ); Thu, 15 Jun 2017 18:01:02 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:44136 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751882AbdFOWBB (ORCPT ); Thu, 15 Jun 2017 18:01:01 -0400 Received: from akpm3.svl.corp.google.com (unknown [104.133.9.92]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id AFB2AB6E; Thu, 15 Jun 2017 22:01:00 +0000 (UTC) Date: Thu, 15 Jun 2017 15:01:00 -0700 From: Andrew Morton To: Goldwyn Rodrigues Cc: linux-fsdevel@vger.kernel.org, jack@suse.com, hch@infradead.org, linux-block@vger.kernel.org, axboe@kernel.dk, linux-api@vger.kernel.org, viro@zeniv.linux.org.uk Subject: Re: [PATCH 0/10 v12] No wait AIO Message-Id: <20170615150100.52c0387406e6ce5167dc098e@linux-foundation.org> In-Reply-To: <1003b3e8-a775-e8ac-d1ca-11055d941a98@suse.de> References: <20170615160002.17233-1-rgoldwyn@suse.de> <20170615112528.7cbdfd6cdf26a5c13450acdf@linux-foundation.org> <1003b3e8-a775-e8ac-d1ca-11055d941a98@suse.de> X-Mailer: Sylpheed 3.4.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) Mime-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Thu, 15 Jun 2017 16:51:41 -0500 Goldwyn Rodrigues wrote: > > I have only minor quibbles - I'll grab the patch series for some -next > > testing (at least). > > > > I agree to the quibbles you have on patch 02/10. Should I send the > entire fixed series, just the 02/10 patch, or would you prefer to fix it? This? --- a/include/linux/fs.h~fs-introduce-filemap_range_has_page-fix +++ a/include/linux/fs.h @@ -2517,8 +2517,8 @@ extern int filemap_fdatawait(struct addr extern void filemap_fdatawait_keep_errors(struct address_space *); extern int filemap_fdatawait_range(struct address_space *, loff_t lstart, loff_t lend); -extern int filemap_range_has_page(struct address_space *, loff_t lstart, - loff_t lend); +extern bool filemap_range_has_page(struct address_space *, loff_t lstart, + loff_t lend); extern int filemap_write_and_wait(struct address_space *mapping); extern int filemap_write_and_wait_range(struct address_space *mapping, loff_t lstart, loff_t lend); diff -puN mm/filemap.c~fs-introduce-filemap_range_has_page-fix mm/filemap.c --- a/mm/filemap.c~fs-introduce-filemap_range_has_page-fix +++ a/mm/filemap.c @@ -378,31 +378,30 @@ EXPORT_SYMBOL(filemap_flush); /** * filemap_range_has_page - check if a page exists in range. - * @mapping: address space structure to wait for + * @mapping: address space within which to check * @start_byte: offset in bytes where the range starts * @end_byte: offset in bytes where the range ends (inclusive) * * Find at least one page in the range supplied, usually used to check if * direct writing in this range will trigger a writeback. */ -int filemap_range_has_page(struct address_space *mapping, - loff_t start_byte, loff_t end_byte) +bool filemap_range_has_page(struct address_space *mapping, + loff_t start_byte, loff_t end_byte) { pgoff_t index = start_byte >> PAGE_SHIFT; pgoff_t end = end_byte >> PAGE_SHIFT; struct pagevec pvec; - int ret; + bool ret; if (end_byte < start_byte) - return 0; + return false; if (mapping->nrpages == 0) - return 0; + return false; pagevec_init(&pvec, 0); - ret = pagevec_lookup(&pvec, mapping, index, 1); - if (!ret) - return 0; + if (!pagevec_lookup(&pvec, mapping, index, 1)) + return false; ret = (pvec.pages[0]->index <= end); pagevec_release(&pvec); return ret;