From: Phillip Potter <phil@philpotter.co.uk>
To: Thiago Jung Bauermann <bauerman@linux.ibm.com>
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: Tue, 22 Jan 2019 10:03:08 +0000 [thread overview]
Message-ID: <20190122100308.GC3245@pathfinder> (raw)
In-Reply-To: <87fttmj9s2.fsf@morokweng.localdomain>
On Mon, Jan 21, 2019 at 01:43:57PM -0200, Thiago Jung Bauermann wrote:
>
> 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
>
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
prev parent reply other threads:[~2019-01-22 10:03 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
2019-01-21 16:49 ` Jan Kara
2019-01-22 10:03 ` Phillip Potter [this message]
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=20190122100308.GC3245@pathfinder \
--to=phil@philpotter.co.uk \
--cc=amir73il@gmail.com \
--cc=bauerman@linux.ibm.com \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--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;
as well as URLs for NNTP newsgroup(s).