From: Thiago Jung Bauermann <bauerman@linux.ibm.com>
To: Phillip Potter <phil@philpotter.co.uk>
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
Date: Mon, 21 Jan 2019 13:43:57 -0200 [thread overview]
Message-ID: <87fttmj9s2.fsf@morokweng.localdomain> (raw)
In-Reply-To: <20190121005427.GA32322@pathfinder>
Hello Phillip,
Just minor nits.
Phillip Potter <phil@philpotter.co.uk> 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 <linux/fs.h>
> +#include <linux/export.h>
> +
> +/*
> + * 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
next prev parent reply other threads:[~2019-01-21 15:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-21 0:54 [RFC][PATCH v5 01/09] fs: common implementation of file type Phillip Potter
2019-01-21 15:43 ` Thiago Jung Bauermann [this message]
2019-01-21 16:49 ` Jan Kara
2019-01-22 10:03 ` Phillip Potter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87fttmj9s2.fsf@morokweng.localdomain \
--to=bauerman@linux.ibm.com \
--cc=amir73il@gmail.com \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=phil@philpotter.co.uk \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox