Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7FC2BC2F421 for ; Mon, 21 Jan 2019 16:49:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4F4C620663 for ; Mon, 21 Jan 2019 16:49:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730135AbfAUQtM (ORCPT ); Mon, 21 Jan 2019 11:49:12 -0500 Received: from mx2.suse.de ([195.135.220.15]:49574 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729940AbfAUQtM (ORCPT ); Mon, 21 Jan 2019 11:49:12 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 611BDAF31; Mon, 21 Jan 2019 16:49:11 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 0FA201E1584; Mon, 21 Jan 2019 17:49:11 +0100 (CET) Date: Mon, 21 Jan 2019 17:49:11 +0100 From: Jan Kara To: Thiago Jung Bauermann Cc: Phillip Potter , viro@zeniv.linux.org.uk, jack@suse.cz, amir73il@gmail.com, linux-fsdevel@vger.kernel.org Subject: Re: [RFC][PATCH v5 01/09] fs: common implementation of file type Message-ID: <20190121164911.GB16403@quack2.suse.cz> References: <20190121005427.GA32322@pathfinder> <87fttmj9s2.fsf@morokweng.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87fttmj9s2.fsf@morokweng.localdomain> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Mon 21-01-19 13:43:57, Thiago Jung Bauermann wrote: > > Hello Phillip, > > Just minor nits. > > Phillip Potter writes: > > > diff --git a/fs/fs_types.c b/fs/fs_types.c > > new file mode 100644 > > index 000000000000..6fc57f4b1dcb > > --- /dev/null > > +++ b/fs/fs_types.c > > @@ -0,0 +1,105 @@ > > +// SPDX-License-Identifier: GPL-2.0 > > +#include > > +#include > > + > > +/* > > + * fs on-disk file type to dirent file type conversion > > + */ > > +static unsigned char fs_dtype_by_ftype[FT_MAX] = { > > + [FT_UNKNOWN] = DT_UNKNOWN, > > + [FT_REG_FILE] = DT_REG, > > + [FT_DIR] = DT_DIR, > > + [FT_CHRDEV] = DT_CHR, > > + [FT_BLKDEV] = DT_BLK, > > + [FT_FIFO] = DT_FIFO, > > + [FT_SOCK] = DT_SOCK, > > + [FT_SYMLINK] = DT_LNK > > +}; > > This array should be const so that it ends up in .rodata. > > > +/* > > + * dirent file type to fs on-disk file type conversion > > + * Values not initialized explicitly are FT_UNKNOWN (0). > > + */ > > +static unsigned char fs_ftype_by_dtype[DT_MAX] = { > > + [DT_REG] = FT_REG_FILE, > > + [DT_DIR] = FT_DIR, > > + [DT_LNK] = FT_SYMLINK, > > + [DT_CHR] = FT_CHRDEV, > > + [DT_BLK] = FT_BLKDEV, > > + [DT_FIFO] = FT_FIFO, > > + [DT_SOCK] = FT_SOCK, > > +}; > > This array should be const so that it ends up in .rodata. Good points! I can update this when pushing the patch to my tree. Thanks for your review. Honza -- Jan Kara SUSE Labs, CR