From mboxrd@z Thu Jan 1 00:00:00 1970 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=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,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 719F2C282C4 for ; Tue, 22 Jan 2019 10:03:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 384AD20823 for ; Tue, 22 Jan 2019 10:03:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=philpotter-co-uk.20150623.gappssmtp.com header.i=@philpotter-co-uk.20150623.gappssmtp.com header.b="qedgu8yt" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728126AbfAVKDM (ORCPT ); Tue, 22 Jan 2019 05:03:12 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:40136 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727844AbfAVKDM (ORCPT ); Tue, 22 Jan 2019 05:03:12 -0500 Received: by mail-wr1-f67.google.com with SMTP id p4so26574879wrt.7 for ; Tue, 22 Jan 2019 02:03:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=philpotter-co-uk.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=94KPPezA9HXM1+L6wD28CErbfXeNRf7BaEGpZi7O5NY=; b=qedgu8ytdGWmdy8W+ryftfvlzByEojqkFwARYqsu06mui+e10Z9bxRmhKvXnD8AA2R tgb7eXn1RoeB1iAGsu8IvhtYrhHave/mx1P+tcB9Z6btilwzyOAd8H5j/3kadoLrpp39 sIetjzbCONyVS05ZREQQ2RhIDqN+3y5V3S/DksVkCzSJjwFEOtzCS5aWS17lxQ7FZIma 2S58djLoL9w/zKkjsH0itH8HL+RRe0u6NM2jRkHajmg4vNqnB2l35L6kuikaaPtfHEwY e8nOWRlNRaujbpPn2fC2JIUdjZo/PwOX6sF6ow2khDwzgXazXV/UsyrojKwySnDWmmYn w2Pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=94KPPezA9HXM1+L6wD28CErbfXeNRf7BaEGpZi7O5NY=; b=NLYpepO5keL8XkSULhxhOKvsw2VDm/PMNsSeBLlN4lZdl5QK/k7USFHEzTATG7tEIc KS/nBpq/2SIaRaLyaWBAhyo2BuaCfSpSnCkI4TC/L2yDNZxfZCUpZJ9vPSaUa1VLRFh8 Az8tX16WTD0PxtNYIi9VUwOWbkMBSNYymjAWwQF1wa6s/YRHp4GcjyEJ3drqm4qeBOyP sF8acYUoZp/2mK6i/HmkLpLT4fbLv/WPFuvazDBksySzE0MOd2wrEEZpcb7/boMHqxlT AdjAyDsC7wxIkPvbjvvVVCJ3X6j1nKijN4zzkKaxjkMwM7g+Srba8M670Ec1+9PSB0H9 5sew== X-Gm-Message-State: AJcUukezf/PZaA8FbkJA92BMfsXf0oWLHQd/z30iGiepQnPpC7JJVXdZ OWqKkY2N+/Fo9uLmoduX51W3mA== X-Google-Smtp-Source: ALg8bN7LZPYthBVmgC+udOQxvOlAGvF/Y6qjE3kYmyvVtcbwNrAHNbgIkawDJNcTnESnllYOvy+SaA== X-Received: by 2002:adf:f848:: with SMTP id d8mr34010052wrq.178.1548151390615; Tue, 22 Jan 2019 02:03:10 -0800 (PST) Received: from pathfinder ([90.222.17.17]) by smtp.gmail.com with ESMTPSA id n82sm51868534wma.42.2019.01.22.02.03.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Jan 2019 02:03:10 -0800 (PST) Date: Tue, 22 Jan 2019 10:03:08 +0000 From: Phillip Potter To: Thiago Jung Bauermann Cc: 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: <20190122100308.GC3245@pathfinder> 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, Jan 21, 2019 at 01:43:57PM -0200, 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. > > -- > Thiago Jung Bauermann > IBM Linux Technology Center > Dear Thiago, Thank you for these suggestions. Don't know why I didn't spot this myself. As Jan has kindly offered to make this change upon including this in his tree, I will forgo publishing the corrections on this occasion. Regards, Phil