Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2908905ybl; Sun, 1 Sep 2019 02:42:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqwosHdyusNUHEEpOG0g9/FA/DQ2cfII8smeDQmMJPKoybA+quphpA6UpWMXvjyFnVtxUHzn X-Received: by 2002:aa7:8a98:: with SMTP id a24mr25219764pfc.101.1567330958241; Sun, 01 Sep 2019 02:42:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567330958; cv=none; d=google.com; s=arc-20160816; b=pO7ZadroHrG4+2jqz+Wnb+ZCn5RY/HLXAzKujrM8o5tIJR32+tgfDZYfGypqYavQVi nrucr+rR29vDy4JT4ntqXKNv3Fz6spq6bu0owArruUcyzmULpVH17fUj6VyRR5Fbd7xY ITQmGKb+Dd3Bzw3zU79DhCiTz98auEJ578g6eZm3nswH9XxwsC0DqwLhZoTROKNShK5t YGAgTRgci89ZKtjaUhWEHUTiCoO5fXzmWHxzZsC12A0Tu1rOlDCP4ni8pkaMjAr2xgw5 SavNLNCkDf8ab1XVao9pBZd5QMVfQC7HYNOZy/zVGl7F8diD3qVrn6lZuFXPcVtF+Gxj uO9A== 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; bh=cHlH9WiAvjL21Ab1gMYZyJ5FOMKVRsvNZyUnXUBAmGo=; b=KwvGptc5f4hthitNjgiFHkzjnNmkrPk3w7tHjP/oNM/idwhw7h6tt0Sy7ENO6jEahX RmUqjLSzNTqdg4AMlXPePlPS7z6rGp9NEZ7GVtUOYNY2/q2dLSxOXsvfMcar0f3D8jWi 1aORPcpnL1FvDkq1MURPUGtWlDIyphD2SN1F2NOFmCScz6A4Hg5eBvGmagWOCZkbUNAu ng2QWyjXyYMOO9JDlWmjQoG28wz69NLo/WOHj2KnBiVyfeto10HxnwScEFmtb2GbRn44 gXKs+bUQynJfwLgWRVTFbWBjqwrerK0zNEHfo13CAtG/nI5Xdv2xrAva6RcbWHVga/fs 56CA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@aol.com header.s=a2048 header.b=MfPXUqTO; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=aol.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t20si8661885pgv.580.2019.09.01.02.41.47; Sun, 01 Sep 2019 02:42:38 -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=pass header.i=@aol.com header.s=a2048 header.b=MfPXUqTO; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=aol.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728390AbfIAJjd (ORCPT + 99 others); Sun, 1 Sep 2019 05:39:33 -0400 Received: from sonic301-21.consmr.mail.gq1.yahoo.com ([98.137.64.147]:41881 "EHLO sonic301-21.consmr.mail.gq1.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728590AbfIAJjd (ORCPT ); Sun, 1 Sep 2019 05:39:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1567330771; bh=cHlH9WiAvjL21Ab1gMYZyJ5FOMKVRsvNZyUnXUBAmGo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From:Subject; b=MfPXUqTOfnneZL37s56uLRiVNXb/M4DXFFztSTMa06uZCQZkBANnS/h23XQpTSBDt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OKTcLKKwA0KnDdJJ9HygI6rsgmXB_e141l68v.Oy_z4FQx MS32vW3.2QpkntNrxZDVgIT067.WKaWjrKDYK2efCKOISecfqjE10HGJBkXwSgdjIx93DBN0MiuB A8kfCSEMN1dhfjhx0WACWuiHe9D_LuKFovc2YV.ibQememms0F42dk5IYD5XdEUl3Zpxi3ZrJlul vXXu9qrpbiuA0rcmV8m1NKLVVySAuLr67znzTgltqT0TLRi5iIWqSWK7YiVJxg8u2c8eWvgNQMou k1U6aA9hBup7vFmS0OWDlUxlCZ0X.l7QYtVzH9nwmvlfgYGXB13PsHUWNCcOjGMX9EN0lIlp4G_d QWxEpmjJRQYS6xGzDM2EcDJ1bQa2iPmXFR57PLwnPk4tPBSrq7G54eAJZ4ECX6APRNu5vq1UqZHj HUJ.86x2dwrX50ZrF.x9nFhSQg8yRXxI4FXU4vfVFqLOQ06LMyrLVbfzECR4JNYvp4ZWtvS1Ln.N j8URE72BAnOj8gsGP4BF.0W6ZAdJAtAf5J7m9ZKsoW3tQddU1VB0uTa5poSs14fXke9TKNxOu6ti wGSD2i7hN41nw Received: from sonic.gate.mail.ne1.yahoo.com by sonic301.consmr.mail.gq1.yahoo.com with HTTP; Sun, 1 Sep 2019 09:39:31 +0000 Received: by smtp401.mail.ir2.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 682a89ffe636f493a8dcfa91a6749f63; Sun, 01 Sep 2019 09:39:26 +0000 (UTC) Date: Sun, 1 Sep 2019 17:39:13 +0800 From: Gao Xiang To: Christoph Hellwig Cc: Gao Xiang , Jan Kara , Dave Chinner , LKML , Miao Xie , devel@driverdev.osuosl.org, Stephen Rothwell , "Darrick J . Wong" , Linus Torvalds , Amir Goldstein , Alexander Viro , Jaegeuk Kim , Theodore Ts'o , Pavel Machek , David Sterba , Greg Kroah-Hartman , linux-fsdevel@vger.kernel.org, Andrew Morton , linux-erofs@lists.ozlabs.org Subject: Re: [PATCH v6 06/24] erofs: support special inode Message-ID: <20190901093912.GB6267@hsiangkao-HP-ZHAN-66-Pro-G1> References: <20190802125347.166018-1-gaoxiang25@huawei.com> <20190802125347.166018-7-gaoxiang25@huawei.com> <20190829102503.GF20598@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190829102503.GF20598@infradead.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-Mailer: WebService/1.1.14303 hermes Apache-HttpAsyncClient/4.1.4 (Java/1.8.0_181) Content-Length: 1474 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 03:25:03AM -0700, Christoph Hellwig wrote: > On Fri, Aug 02, 2019 at 08:53:29PM +0800, Gao Xiang wrote: > > This patch adds to support special inode, such as > > block dev, char, socket, pipe inode. > > > > Signed-off-by: Gao Xiang > > --- > > fs/erofs/inode.c | 27 +++++++++++++++++++++++++-- > > 1 file changed, 25 insertions(+), 2 deletions(-) > > > > diff --git a/fs/erofs/inode.c b/fs/erofs/inode.c > > index b6ea997bc4ae..637bf6e4de44 100644 > > --- a/fs/erofs/inode.c > > +++ b/fs/erofs/inode.c > > @@ -34,7 +34,16 @@ static int read_inode(struct inode *inode, void *data) > > vi->xattr_isize = ondisk_xattr_ibody_size(v2->i_xattr_icount); > > > > inode->i_mode = le16_to_cpu(v2->i_mode); > > - vi->raw_blkaddr = le32_to_cpu(v2->i_u.raw_blkaddr); > > + if (S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) || > > + S_ISLNK(inode->i_mode)) > > + vi->raw_blkaddr = le32_to_cpu(v2->i_u.raw_blkaddr); > > + else if (S_ISCHR(inode->i_mode) || S_ISBLK(inode->i_mode)) > > + inode->i_rdev = > > + new_decode_dev(le32_to_cpu(v2->i_u.rdev)); > > + else if (S_ISFIFO(inode->i_mode) || S_ISSOCK(inode->i_mode)) > > + inode->i_rdev = 0; > > + else > > + return -EIO; > > Please use a switch statement when dealing with the file modes to > make everything easier to read. Fixed in https://lore.kernel.org/linux-fsdevel/20190901055130.30572-18-hsiangkao@aol.com/ Thanks, Gao Xiang