Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2479239ybl; Thu, 29 Aug 2019 08:43:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqyGQffwMGBni//VHw0aYqhjz9j9xpQLIIKXILDC0yYGyY/qLAXgInDDS2nVM2mfHuo0fQ4d X-Received: by 2002:a17:902:b905:: with SMTP id bf5mr9925296plb.342.1567093432559; Thu, 29 Aug 2019 08:43:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567093432; cv=none; d=google.com; s=arc-20160816; b=wMkBu7zr3PA6BcuZYXCvNqc2OuVt3Eq/l4lCBm9Kru95KzpMgyk3VPKpuJS5t1Uwg3 vQp+BABBkw+CAxejCJG5inTQ3P8CHOHbkhcdQxIzXXohNJy1GPxo4FHy0YD/rG7z1E44 wAmV48U1UVLSCzYu5E6gfjALD5U2oFGRlkv110vpkOEFuG4KNp2M744ejrIsiSh8yBAP coU3grZ2Bao5xCGBnYXrnwh4ymiOuGaSS+o3psME87nU6/rTk2K80m2idQA/vY84Guvb oOStMZShs1AWliP32WgolmNAsbJB1uqMN1ntvd5Q2r9Mpl/f6uygaImvBLyDRnou891x RAuA== 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=aMNi5NAAB4VAvFquSQ+eHipcYiG2qnyVXSHnLH6H+N0=; b=i1sD5EETSwTN3RMDDwoCbnWnBLrQm6Hz0ATLn6Eb1L4qERLEkOO29S3a58y/uArD/I cpIroWDc59TE3G6QwwICEpxiZvDrv3jfef71CO+ixVnUQUlea+EdeLOeD3vCJCMG3ein PyMVgGaQ13q/4IgoeB6gRByFBBqVowDuhhhgarI10QRWTt4ssrE5Y7vYNiq4mHWnDX9H nX22W4AV/eQhd01yipVoFWbUWeUhqJDca5DLEmC1NoP3/kS5CCYtXFeUB+IT+54L40Ra fTZhGM/uJMfj8cdZwT85VLZmRjEaT6at3ceJ3dzt1RwienpUUhCcaoafv9FBAe+QzJ6R daGQ== 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 v185si2301307pgd.340.2019.08.29.08.43.36; Thu, 29 Aug 2019 08:43:52 -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 S1727926AbfH2Pmb (ORCPT + 99 others); Thu, 29 Aug 2019 11:42:31 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:3957 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727118AbfH2Pmb (ORCPT ); Thu, 29 Aug 2019 11:42:31 -0400 Received: from DGGEMM404-HUB.china.huawei.com (unknown [172.30.72.53]) by Forcepoint Email with ESMTP id 4648CDBF252A50D01A48; Thu, 29 Aug 2019 23:42:25 +0800 (CST) Received: from dggeme762-chm.china.huawei.com (10.3.19.108) by DGGEMM404-HUB.china.huawei.com (10.3.20.212) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 29 Aug 2019 23:42:24 +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 23:42:24 +0800 Date: Thu, 29 Aug 2019 23:41:37 +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 01/24] erofs: add on-disk layout Message-ID: <20190829154136.GA129582@architecture4> References: <20190802125347.166018-1-gaoxiang25@huawei.com> <20190802125347.166018-2-gaoxiang25@huawei.com> <20190829095954.GB20598@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20190829095954.GB20598@infradead.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-Originating-IP: [10.140.130.215] X-ClientProxiedBy: dggeme703-chm.china.huawei.com (10.1.199.99) 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 Hi Christoph, On Thu, Aug 29, 2019 at 02:59:54AM -0700, Christoph Hellwig wrote: [] > > > +static bool erofs_inode_is_data_compressed(unsigned int datamode) > > +{ > > + if (datamode == EROFS_INODE_FLAT_COMPRESSION) > > + return true; > > + return datamode == EROFS_INODE_FLAT_COMPRESSION_LEGACY; > > +} > > This looks like a really obsfucated way to write: > > return datamode == EROFS_INODE_FLAT_COMPRESSION || > datamode == EROFS_INODE_FLAT_COMPRESSION_LEGACY; Add a word about this, the above approach is not horrible if more datamode add here and comments, e.g static bool erofs_inode_is_data_compressed(unsigned int datamode) { /* has z_erofs_map_header */ if (datamode == EROFS_INODE_FLAT_COMPRESSION) return true; /* some blablabla */ if (datamode == (1) ) return true; /* some blablablabla */ if (datamode == (2) ) return true; /* no z_erofs_map_header */ return datamode == EROFS_INODE_FLAT_COMPRESSION_LEGACY; } vs. static bool erofs_inode_is_data_compressed(unsigned int datamode) { /* has z_erofs_map_header */ return datamode == EROFS_INODE_FLAT_COMPRESSION || /* some blablabla */ datamode == (1) || /* some blablablabla */ datamode == (2) || /* no z_erofs_map_header */ datamode == EROFS_INODE_FLAT_COMPRESSION_LEGACY; } I have no idea which one is better. Anyway, if you still like the form, I will change it. Thanks, Gao Xiang