Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4338038imm; Mon, 11 Jun 2018 10:35:24 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJAeqCep2soGdWNkyyrLVFyrytmbXNPJIEJHn1n6+oQ2fJ79zSJ4JmdbI8aqJQOkiKxdvCC X-Received: by 2002:a17:902:3a5:: with SMTP id d34-v6mr110932pld.103.1528738524115; Mon, 11 Jun 2018 10:35:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528738524; cv=none; d=google.com; s=arc-20160816; b=I7UkHDAZkG6aEhB/LrdlCL4OWD9r2L7QguxYpGSaTgV52fHDZC/Ws008GFBy+fG3J8 JV2fygtovn8UDGWGObNQGWdiG8TuYvHSouRIwfwjUeqEDU9oK0Hbygq3o1qxwVXMiOg2 tNgdb/nY29mpTM2unQ9NE80cjHDb4Jhyxgd/SQM6s8JU94bqBLAlbVQObeiZqA99FKLb xm4QZr3FoSdSRxBJ14GVM4epOtAdRRxnSD8wd21F5xnaNb9OXDmhTL7Tz/SCCyj8Z4cR hIVjPuWAQOpDHxVunfZhULE1MSvrQRATw/5OrLOpMHJroUf9axmg7xKClfJUxBuxlc4v sCRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=mDm6xOUZBchL3cb4cnWgR1zMwHQo3xdVUPXYZUQ6YUs=; b=Jtaghg2dS+UUBJ5myy4nz1WebcSmdseTWSjmS/8HpQaQKXiOTRPPXWmP/GQjsY6Yyt 5wD/rpN5/OodxhDl0hZ1N87+bAx2Ycpi1s4nOm2LFlE9rnD0YQYNvdFsXXHasbi5SNZ9 wStigeGPS4dkjDgHpTsrubSYXHHE8zVvL/r7H88vD1bU2ugIQ2XF41o2VtMv1sHURpnw q4T9dD0cWE3+wD7EjVs0hfusnZgSzqN1ks49g8MDEAkyymFGAkADfKxRY1P5xRGIbs7m DN1lAfG8lVho2gyoXjUXqTNBFYI2uC572u8UVoZ11eAl4xJkEkROkPaQUecdEefUoMOo LVMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=swlnFVN+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j7-v6si13098612pgp.85.2018.06.11.10.34.39; Mon, 11 Jun 2018 10:35:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=swlnFVN+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934151AbeFKRUA (ORCPT + 99 others); Mon, 11 Jun 2018 13:20:00 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:59018 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934079AbeFKRT7 (ORCPT ); Mon, 11 Jun 2018 13:19:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=mDm6xOUZBchL3cb4cnWgR1zMwHQo3xdVUPXYZUQ6YUs=; b=swlnFVN+iIb54TP4EuEQziGu1 hWYjzm7Dmi4qFfBeLNDo8i0NEvJEuo43oJMdw56Tzak3lyd1FsvpwBR1srE8YFr5wW396S+BwiXVD WS7I2Ez3NaobTUTx9/gE1cBaoOEk+FH9Nw5bW/gaKa1904Ief5HFq76kgIJ3vDLcC5Xwbx91uDwU7 AUCWn1qH7Vc3yzuRgoPuk5DZWQHMS9Ilb2o+FK9QIngH13HGu0UoG4wB0SHFml7kuI7DPYkfQxQmC MCHN7Rgt0c/NOYSqPcn8qWLbh6a4/1UAK+XCVOgpYbZGEDR7PZ/BOQZoTABnGS214adfVXYy0ff+J uzMzz/zQA==; Received: from hch by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1fSQTj-0000h8-3b; Mon, 11 Jun 2018 17:19:39 +0000 Date: Mon, 11 Jun 2018 10:19:38 -0700 From: Christoph Hellwig To: Ming Lei Cc: Jens Axboe , Christoph Hellwig , Alexander Viro , Kent Overstreet , David Sterba , Huang Ying , linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, Theodore Ts'o , "Darrick J . Wong" , Coly Li , Filipe Manana , Randy Dunlap Subject: Re: [PATCH V6 08/30] block: introduce chunk_last_segment() Message-ID: <20180611171938.GA5101@infradead.org> References: <20180609123014.8861-1-ming.lei@redhat.com> <20180609123014.8861-9-ming.lei@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180609123014.8861-9-ming.lei@redhat.com> User-Agent: Mutt/1.9.2 (2017-12-15) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I think both callers would be just as easy to understand by using nth_page() instead of these magic helpers. E.g. for guard_bio_eod: unsigned offset = (bv.bv_offset + bv.bv_len); struct page *page = nth_page(bv.bv_page, offset); zero_user(page, offset & PAGE_MASK, truncated_bytes);