Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2190950ybl; Thu, 29 Aug 2019 05:01:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqwERMEnj2JRuVzvOKfOBrGhRrNdD4zDeRLn6bEdWX0Q+4gu5HtPiQJt1p6HpGSwT0oMOPgd X-Received: by 2002:aa7:97aa:: with SMTP id d10mr10964865pfq.176.1567080092319; Thu, 29 Aug 2019 05:01:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567080092; cv=none; d=google.com; s=arc-20160816; b=vh/HSpCmWB+6Wqa+8S9ucLZGpjQ5pshMSrqDhKDaqTCuctiw4wgK1ZRke1dLR9a8Aa +cvyM0QjeKyilOcVjNHPZta/xiBpOXcLkZBlBJNN2teX2EyD55D8PMlIn95z9XGtqnEW F0jh/BFjEghXZVAmmk8uREPkkzXn7kCVEbWX6UkAPDm0iPzP7Cr0qdJw09LQuZgAAx2v 2Nj0PhjDd8i3wQzuTLPEjWWqT+pLbG+TrzOqOtwAaU+R2EnxvhM96YeYPZky5ihmZKrx ehcRYR6V9fjJpNzsWsaRc53A9OOOK6bLU3rJ0aNuguq28GigVmqJMIwAShwE1aiqsKAf 3n9Q== 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; bh=gYYTlEGjbO9vk/fLNNNn5ejqQ0NtK/7GJRZbWxYq6x0=; b=IH6BIl0N4VYmnDry0Xjzk6kNy5MhgrTA1n4EgSXAEyvbqOMGrY34DGpM6g86/zWSCJ yGsqdy7PxfuZ3RomaA0YOBa6GH2c1sTNlNoGkYyoHCzye1DGRkSOZC92AKd0ZXGlL0uZ +834jmbUbA1KTrhaSoz1F4CLwHUm/Yy8zAHIYG5PPdtH97TBgmBV5XTbT3akb5LKBU9r woHgkHg0Z+QN+wiVP+uRpKHu6DeQru0BgZEbNz0Ma7/rZb/I/JHToVFPGAuEpyo0qK+e 4m69SKWBkOzkla7K2MMskwS1ZG7QlsBZthU8jaBOa1vHh5Wyzn6hDWiHj/9h7n+doOPl BoQQ== ARC-Authentication-Results: i=1; mx.google.com; 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 i187si2380783pfe.21.2019.08.29.05.01.13; Thu, 29 Aug 2019 05:01:32 -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; 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 S1727051AbfH2MAW (ORCPT + 99 others); Thu, 29 Aug 2019 08:00:22 -0400 Received: from szxga08-in.huawei.com ([45.249.212.255]:34016 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726379AbfH2MAV (ORCPT ); Thu, 29 Aug 2019 08:00:21 -0400 Received: from DGGEMM401-HUB.china.huawei.com (unknown [172.30.72.53]) by Forcepoint Email with ESMTP id 1F79FF69D7A4173BC632; Thu, 29 Aug 2019 20:00:11 +0800 (CST) Received: from dggeme762-chm.china.huawei.com (10.3.19.108) by DGGEMM401-HUB.china.huawei.com (10.3.20.209) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 29 Aug 2019 20:00:10 +0800 Received: from architecture4 (10.140.130.215) by dggeme762-chm.china.huawei.com (10.3.19.108) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Thu, 29 Aug 2019 20:00:09 +0800 Date: Thu, 29 Aug 2019 19:59:22 +0800 From: Gao Xiang To: Christoph Hellwig CC: Alexander Viro , Greg Kroah-Hartman , Andrew Morton , Stephen Rothwell , Theodore Ts'o , "Pavel Machek" , David Sterba , Amir Goldstein , "Darrick J . Wong" , "Dave Chinner" , Jaegeuk Kim , Jan Kara , Linus Torvalds , , , LKML , , Chao Yu , Miao Xie , Li Guifu , Fang Wei Subject: Re: [PATCH v6 05/24] erofs: add inode operations Message-ID: <20190829115922.GG64893@architecture4> References: <20190802125347.166018-1-gaoxiang25@huawei.com> <20190802125347.166018-6-gaoxiang25@huawei.com> <20190829102426.GE20598@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20190829102426.GE20598@infradead.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-Originating-IP: [10.140.130.215] X-ClientProxiedBy: dggeme712-chm.china.huawei.com (10.1.199.108) To dggeme762-chm.china.huawei.com (10.3.19.108) X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 29, 2019 at 03:24:26AM -0700, Christoph Hellwig wrote: [] > > > + > > + /* fill last page if inline data is available */ > > + err = fill_inline_data(inode, data, ofs); > > Well, I think you should move the is_inode_flat_inline and > (S_ISLNK(inode->i_mode) && inode->i_size < PAGE_SIZE) checks from that > helper here, as otherwise you make everyone wonder why you'd always > fill out the inline data. Currently, fill_inline_data() only fills for fast symlink, later we can fill any tail-end block (such as dir block) for our requirements. And I think that is minor. > > > +static inline struct inode *erofs_iget_locked(struct super_block *sb, > > + erofs_nid_t nid) > > +{ > > + const unsigned long hashval = erofs_inode_hash(nid); > > + > > +#if BITS_PER_LONG >= 64 > > + /* it is safe to use iget_locked for >= 64-bit platform */ > > + return iget_locked(sb, hashval); > > +#else > > + return iget5_locked(sb, hashval, erofs_ilookup_test_actor, > > + erofs_iget_set_actor, &nid); > > +#endif > > Just use the slightly more complicated 32-bit version everywhere so that > you have a single actually tested code path. And then remove this > helper. The consideration is simply because iget_locked performs better than iget5_locked. Thanks, Gao Xiang