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

Dave Chinner
2016-04-08T01:10:45Z

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(

Cheers,

Dave.
--
Dave Chinner
david@fromorbit.com