Re: [RFC][PATCH v5 01/09] fs: common implementation of file type

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jan 21, 2019 at 01:43:57PM -0200, Thiago Jung Bauermann wrote:
> 
> Hello Phillip,
> 
> Just minor nits.
> 
> Phillip Potter <phil@xxxxxxxxxxxxxxxx> 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



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux