xfs
[Top] [All Lists]

Re: [PATCH 31/37] xfs: move xfs_fsb_to_db to xfs_bmap.h

To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Subject: Re: [PATCH 31/37] xfs: move xfs_fsb_to_db to xfs_bmap.h
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Mon, 30 Apr 2012 12:31:32 +1000
Cc: xfs@xxxxxxxxxxx
In-reply-to: <20120429215300.GJ19889@xxxxxxxxxxxxx>
References: <1335160747-17254-1-git-send-email-david@xxxxxxxxxxxxx> <1335160747-17254-32-git-send-email-david@xxxxxxxxxxxxx> <20120429215300.GJ19889@xxxxxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Sun, Apr 29, 2012 at 05:53:00PM -0400, Christoph Hellwig wrote:
> On Mon, Apr 23, 2012 at 03:59:01PM +1000, Dave Chinner wrote:
> > From: Dave Chinner <dchinner@xxxxxxxxxx>
> > 
> > This is the only remaining useful function in xfs_rw.h, so move it
> 
> Well, xfs_get_extsz_hint also still is useful, and you only move it in
> the next patch.

Ok, the only remaining useful -inline- function. :)

> > +/*
> > + * Convert the given file system block to a disk block.  We have to treat 
> > it
> > + * differently based on whether the file is a real time file or not, 
> > because the
> > + * bmap code does.
> > + */
> 
> Might be worth alaborating why exactly.  When I last looked over it I
> couldn't make much sense of it.

realtime device is a flat filesysetm block address space - it has to
be for a bitmap allocator to work - but the data device is a sparse
address space. I'll add that to the comment.

> 
> > +xfs_daddr_t
> > +xfs_fsb_to_db(struct xfs_inode *ip, xfs_fsblock_t fsb)
> > +{
> > +   return (XFS_IS_REALTIME_INODE(ip) ? \
> > +            (xfs_daddr_t)XFS_FSB_TO_BB((ip)->i_mount, (fsb)) : \
> > +            XFS_FSB_TO_DADDR((ip)->i_mount, (fsb)));
> > +}
> 
> Might be worth to "demacrofy" it while you're at it, e.g. rewrite it as:

*nod*. Will do.

Cheers,

Dave.

-- 
Dave Chinner
david@xxxxxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>