public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Brian Foster <bfoster@redhat.com>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH 12/16] xfs: reduce direct usage of mp->m_dir_geo
Date: Wed, 28 May 2014 09:53:07 +1000	[thread overview]
Message-ID: <20140527235307.GG8554@dastard> (raw)
In-Reply-To: <20140527155957.GD11265@laptop.bfoster>

On Tue, May 27, 2014 at 11:59:57AM -0400, Brian Foster wrote:
> On Fri, May 23, 2014 at 10:03:48AM +1000, Dave Chinner wrote:
> > From: Dave Chinner <dchinner@redhat.com>
> > 
> > There are many places in the directory code were we don't pass the
> > args into and so have to extract the geometry direct from the mount
> > structure. Push the args or the geometry into these leaf functions
> > so that we don't need to grab it from the struct xfs_mount.
> > 
> > This, in turn, brings use to the point where directory geometry is
> > no longer a property of the struct xfs_mount; it is not a global
> > property anymore, and hence we can start to consider per-directory
> > configuration of physical geometries.
> > 
> > Start by converting the xfs_dir_isblock/leaf code - pass in the
> > xfs_da_args and convert the readdir code to use xfs_da_args like
> > the rest of the directory code to pass information around.
> > 
> > Signed-off-by: Dave Chinner <dchinner@redhat.com>
.....
> >  STATIC int
> >  xfs_dir2_leaf_readbuf(
> > -	struct xfs_inode	*dp,
> > +	struct xfs_da_args	*args,
> >  	size_t			bufsize,
> >  	struct xfs_dir2_leaf_map_info *mip,
> >  	xfs_dir2_off_t		*curoff,
> >  	struct xfs_buf		**bpp)
> >  {
> > -	struct xfs_mount	*mp = dp->i_mount;
> > +	struct xfs_inode	*dp = args->dp;
> >  	struct xfs_buf		*bp = *bpp;
> >  	struct xfs_bmbt_irec	*map = mip->map;
> >  	struct blk_plug		plug;
> > @@ -304,7 +297,7 @@ xfs_dir2_leaf_readbuf(
> >  	int			length;
> >  	int			i;
> >  	int			j;
> > -	struct xfs_da_geometry	*geo = mp->m_dir_geo;
> > +	struct xfs_da_geometry	*geo = args->geo;
> 
> I notice that we remove the local geo pointer in some of the immediately
> previous fixups. Here we keep it...
> 
> >  
> >  	/*
> >  	 * If we have a buffer, we need to release it and
> > @@ -314,7 +307,7 @@ xfs_dir2_leaf_readbuf(
> >  	if (bp) {
> >  		xfs_trans_brelse(NULL, bp);
> >  		bp = NULL;
> > -		mip->map_blocks -= geo->fsbcount;
> > +		mip->map_blocks -= args->geo->fsbcount;
> 
> ... convert some calls to use args...
> 
> >  		/*
> >  		 * Loop to get rid of the extents for the
> >  		 * directory block.
> > @@ -338,8 +331,7 @@ xfs_dir2_leaf_readbuf(
> >  	/*
> >  	 * Recalculate the readahead blocks wanted.
> >  	 */
> > -	mip->ra_want = howmany(bufsize + geo->blksize,
> > -			       mp->m_sb.sb_blocksize) - 1;
> > +	mip->ra_want = howmany(bufsize + geo->blksize, (1 << geo->fsblog)) - 1;
> >  	ASSERT(mip->ra_want >= 0);
> 
> ... and not others. So we should probably at least be consistent within
> function. :) Otherwise this patch looks good to me.

Yup, brain fart. i converted each function in the entire file to use
a local geo variable....

-Dave
-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  reply	other threads:[~2014-05-27 23:53 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-23  0:03 [PATCH 00/16 V2] xfs: introduce struct xfs_da_geometry Dave Chinner
2014-05-23  0:03 ` [PATCH 01/16] xfs: introduce directory geometry structure Dave Chinner
2014-05-23 19:04   ` Brian Foster
2014-05-26  4:28     ` Dave Chinner
2014-05-26 13:29       ` Brian Foster
2014-05-26 21:39         ` Dave Chinner
2014-05-23  0:03 ` [PATCH 02/16] xfs: move directory block translatiosn to xfs_da_btree.h Dave Chinner
2014-05-23 19:05   ` Brian Foster
2014-05-27 10:46   ` Christoph Hellwig
2014-05-27 23:06     ` Dave Chinner
2014-05-28  5:28       ` Christoph Hellwig
2014-05-28  5:39         ` Dave Chinner
2014-05-23  0:03 ` [PATCH 03/16] xfs: kill XFS_DIR2...FIRSTDB macros Dave Chinner
2014-05-23 19:05   ` Brian Foster
2014-05-27 10:47   ` Christoph Hellwig
2014-05-23  0:03 ` [PATCH 04/16] xfs: convert dir byte/off conversion to xfs_da_geometry Dave Chinner
2014-05-23 19:05   ` Brian Foster
2014-05-23  0:03 ` [PATCH 05/16] xfs: convert directory dablk " Dave Chinner
2014-05-23 19:06   ` Brian Foster
2014-05-26  4:48     ` Dave Chinner
2014-05-23  0:03 ` [PATCH 06/16] xfs: convert directory db " Dave Chinner
2014-05-23 19:07   ` Brian Foster
2014-05-23  0:03 ` [PATCH 07/16] xfs: convert directory segment limits " Dave Chinner
2014-05-23 20:43   ` Brian Foster
2014-05-23  0:03 ` [PATCH 08/16] xfs: convert m_dirblkfsbs " Dave Chinner
2014-05-23 20:43   ` Brian Foster
2014-05-23  0:03 ` [PATCH 09/16] xfs: convert m_dirblksize " Dave Chinner
2014-05-27 15:59   ` Brian Foster
2014-05-23  0:03 ` [PATCH 10/16] xfs: convert dir/attr btree threshold " Dave Chinner
2014-05-27 15:59   ` Brian Foster
2014-05-23  0:03 ` [PATCH 11/16] xfs: move node entry counts " Dave Chinner
2014-05-27 15:59   ` Brian Foster
2014-05-27 23:47     ` Dave Chinner
2014-05-23  0:03 ` [PATCH 12/16] xfs: reduce direct usage of mp->m_dir_geo Dave Chinner
2014-05-27 15:59   ` Brian Foster
2014-05-27 23:53     ` Dave Chinner [this message]
2014-05-23  0:03 ` [PATCH 13/16] xfs: remove mp->m_dir_geo from directory logging Dave Chinner
2014-05-27 16:00   ` Brian Foster
2014-05-23  0:03 ` [PATCH 14/16] xfs: use xfs_da_geometry for block size in attr code Dave Chinner
2014-05-27 16:01   ` Brian Foster
2014-05-23  0:03 ` [PATCH 15/16] xfs: pass xfs_da_args to xfs_attr_leaf_newentsize Dave Chinner
2014-05-27 16:01   ` Brian Foster
2014-05-23  0:03 ` [PATCH 16/16] xfs: repalce attr LBSIZE with xfs_da_geometry Dave Chinner
2014-05-27 16:01   ` Brian Foster
  -- strict thread matches above, loose matches on Subject: below --
2014-05-28  6:04 [PATCH 00/16 V3] xfs: introduce struct xfs_da_geometry Dave Chinner
2014-05-28  6:04 ` [PATCH 12/16] xfs: reduce direct usage of mp->m_dir_geo Dave Chinner
2014-05-30 19:05   ` Brian Foster

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=20140527235307.GG8554@dastard \
    --to=david@fromorbit.com \
    --cc=bfoster@redhat.com \
    --cc=xfs@oss.sgi.com \
    /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