Re: [PATCH 18/19] mkfs: unit conversions are case insensitive

Jan Tulak
2016-04-08T09:09:14Z

[-- Attachment #1.1: Type: text/plain, Size: 1463 bytes --]

On Fri, Apr 8, 2016 at 3:03 AM, Dave Chinner <david@fromorbit.com> wrote:

> On Thu, Apr 07, 2016 at 07:41:58PM -0500, Eric Sandeen wrote:
> > On 4/7/16 5:50 AM, Jan Tulak wrote:
> > > On Wed, Apr 6, 2016 at 11:10 PM, Eric Sandeen <sandeen@sandeen.net
> <mailto:sandeen@sandeen.net>>wrote:
> > > (hm, why do we have 3 copies of cvtnum?)
> > >
> > >
> > > ​Where? ​
> > > ​
> > >
> > > ​$ pwd
> > > ​/some/path/xfsprogs-dev
> > >
> > > $ grep -r "cvtnum(size_t" . |grep -v "^Binary"
> > > ​./include/input.h:extern long long cvtnum(size_t blocksize, size_t
> sectorsize, char *s);
> > > ./io/init.h:extern void init_cvtnum(size_t *blocksize, size_t
> *sectsize);
> >
> > File Line
> > 0 estimate/xfs_estimate.c 29 cvtnum(char *s)
> > 1 libxcmd/input.c 147 cvtnum(
> > 2 mkfs/xfs_mkfs.c 3618 cvtnum(
>
> FWIW, here's why we put the function name at the start of the line,
> rather than the way that it is typically done in the kernel code
> (i.e. after the return type specification):
>
> $ git grep ^cvtnum
> estimate/xfs_estimate.c:cvtnum(char *s)
> libxcmd/input.c:cvtnum(
> mkfs/xfs_mkfs.c:cvtnum(
>
>
​Ah, I see. A nice trick. :-)

It might be good to merge the three functions, but I think it can wait for
when this patchset is done - or there is always going to be something more
to add...

Thanks,
Jan ​

--
Jan Tulak
jtulak@redhat.com / jan@tulak.me

[-- Attachment #1.2: Type: text/html, Size: 3155 bytes --]

[-- Attachment #2: Type: text/plain, Size: 121 bytes --]