From: Jan Kara <jack@suse.cz>
To: Thiago Jung Bauermann <bauerman@linux.ibm.com>
Cc: Phillip Potter <phil@philpotter.co.uk>,
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 17:49:11 +0100 [thread overview]
Message-ID: <20190121164911.GB16403@quack2.suse.cz> (raw)
In-Reply-To: <87fttmj9s2.fsf@morokweng.localdomain>
On Mon 21-01-19 13:43:57, 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.
Good points! I can update this when pushing the patch to my tree. Thanks
for your review.
Honza
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
next prev parent reply other threads:[~2019-01-21 16:49 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 [this message]
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=20190121164911.GB16403@quack2.suse.cz \
--to=jack@suse.cz \
--cc=amir73il@gmail.com \
--cc=bauerman@linux.ibm.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.