linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: Christoph Hellwig <hch@lst.de>, linux-xfs@vger.kernel.org
Subject: Re: [PATCH 1/3] xfs: add a xfs_valid_startblock helper
Date: Fri, 30 Aug 2019 17:32:53 +0200	[thread overview]
Message-ID: <20190830153253.GA20550@lst.de> (raw)
In-Reply-To: <20190830150650.GA5354@magnolia>

On Fri, Aug 30, 2019 at 08:06:50AM -0700, Darrick J. Wong wrote:
> > --- a/fs/xfs/libxfs/xfs_bmap.h
> > +++ b/fs/xfs/libxfs/xfs_bmap.h
> > @@ -171,6 +171,9 @@ static inline bool xfs_bmap_is_real_extent(struct xfs_bmbt_irec *irec)
> >  		!isnullstartblock(irec->br_startblock);
> >  }
> >  
> > +#define xfs_valid_startblock(ip, startblock) \
> > +	((startblock) != 0 || XFS_IS_REALTIME_INODE(ip))
> 
> We have more robust validators for data/rtdev fsblock_t, so why not:
> 
> #define xfs_valid_startblock(ip, startblock) \
> 	(XFS_IS_REALTIME_INODE(ip) ? xfs_verify_rtbno(startblock) : \
> 				     xfs_verify_fsbno(startblock))
> 
> and why not make it a static inline function too?

I tried an inline function, but I could not find a header to place
it that would actually easily compile everywhere...  Maybe we should
just make that a xfs_verify_bno(mp, startblock) and move that out of
line such in a way that a smart compiler avoids the function call
overhead for xfs_verify_rtbno / xfs_verify_fsbno.  I'll take another
stab at this.

  reply	other threads:[~2019-08-30 15:32 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-30 10:24 misc cleanups Christoph Hellwig
2019-08-30 10:24 ` [PATCH 1/3] xfs: add a xfs_valid_startblock helper Christoph Hellwig
2019-08-30 15:06   ` Darrick J. Wong
2019-08-30 15:32     ` Christoph Hellwig [this message]
2019-09-01  7:36       ` Christoph Hellwig
2019-09-01 20:31         ` Darrick J. Wong
2019-09-02  7:59           ` Christoph Hellwig
2019-09-02 17:04             ` Darrick J. Wong
2019-09-02 17:07               ` Christoph Hellwig
2019-08-30 10:24 ` [PATCH 2/3] xfs: cleanup xfs_fsb_to_db Christoph Hellwig
2019-08-30 15:07   ` Darrick J. Wong
2019-08-30 10:24 ` [PATCH 3/3] xfs: remove the unused XFS_ALLOC_USERDATA flag Christoph Hellwig
2019-08-30 15:08   ` Darrick J. Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190830153253.GA20550@lst.de \
    --to=hch@lst.de \
    --cc=darrick.wong@oracle.com \
    --cc=linux-xfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).