xfs
[Top] [All Lists]

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

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH 18/19] mkfs: unit conversions are case insensitive
From: Jan Tulak <jtulak@xxxxxxxxxx>
Date: Fri, 8 Apr 2016 11:08:49 +0200
Cc: Eric Sandeen <sandeen@xxxxxxxxxxx>, xfs-oss <xfs@xxxxxxxxxxx>
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <20160408010318.GA567@dastard>
References: <1458818136-56043-1-git-send-email-jtulak@xxxxxxxxxx> <1458818136-56043-19-git-send-email-jtulak@xxxxxxxxxx> <57057B2A.3000100@xxxxxxxxxxx> <CACj3i736w-nnDzBDOiBf39cJ3AUHqeVL9_Y8EbUgaMa9S7PToA@xxxxxxxxxxxxxx> <5706FE56.7060308@xxxxxxxxxxx> <20160408010318.GA567@dastard>
On Fri, Apr 8, 2016 at 3:03 AM, Dave Chinner <david@xxxxxxxxxxxxx> 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@xxxxxxxxxxx <mailto:sandeen@xxxxxxxxxxx>>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 â
Â
--
<Prev in Thread] Current Thread [Next in Thread>