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=-4.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED 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 7B085C2F421 for ; Mon, 21 Jan 2019 15:44:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 52FAF20879 for ; Mon, 21 Jan 2019 15:44:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729732AbfAUPoJ (ORCPT ); Mon, 21 Jan 2019 10:44:09 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:42546 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729534AbfAUPoJ (ORCPT ); Mon, 21 Jan 2019 10:44:09 -0500 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x0LFhwfG054327 for ; Mon, 21 Jan 2019 10:44:07 -0500 Received: from e15.ny.us.ibm.com (e15.ny.us.ibm.com [129.33.205.205]) by mx0b-001b2d01.pphosted.com with ESMTP id 2q5eyjnrk4-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 21 Jan 2019 10:44:07 -0500 Received: from localhost by e15.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 21 Jan 2019 15:44:06 -0000 Received: from b01cxnp22035.gho.pok.ibm.com (9.57.198.25) by e15.ny.us.ibm.com (146.89.104.202) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 21 Jan 2019 15:44:04 -0000 Received: from b01ledav005.gho.pok.ibm.com (b01ledav005.gho.pok.ibm.com [9.57.199.110]) by b01cxnp22035.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x0LFi3gY20971744 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 21 Jan 2019 15:44:03 GMT Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 94440AE063; Mon, 21 Jan 2019 15:44:03 +0000 (GMT) Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 18970AE060; Mon, 21 Jan 2019 15:44:02 +0000 (GMT) Received: from morokweng.localdomain (unknown [9.80.234.239]) by b01ledav005.gho.pok.ibm.com (Postfix) with ESMTPS; Mon, 21 Jan 2019 15:44:01 +0000 (GMT) References: <20190121005427.GA32322@pathfinder> User-agent: mu4e 1.0; emacs 26.1 From: Thiago Jung Bauermann To: Phillip Potter 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 In-reply-to: <20190121005427.GA32322@pathfinder> Date: Mon, 21 Jan 2019 13:43:57 -0200 MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-GCONF: 00 x-cbid: 19012115-0068-0000-0000-00000386204F X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00010448; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000275; SDB=6.01149720; UDB=6.00599092; IPR=6.00930044; MB=3.00025223; MTD=3.00000008; XFM=3.00000015; UTC=2019-01-21 15:44:06 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19012115-0069-0000-0000-00004736D43E Message-Id: <87fttmj9s2.fsf@morokweng.localdomain> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-01-21_09:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=954 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1901210124 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org 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