All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Myers <bpm@sgi.com>
To: Jeff Liu <jeff.liu@oracle.com>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH v4 02/13] xfs: make use of xfs_calc_buf_res() in xfs_trans.c
Date: Thu, 31 Jan 2013 19:39:37 -0600	[thread overview]
Message-ID: <20130201013937.GS27055@sgi.com> (raw)
In-Reply-To: <51067C69.2020509@oracle.com>

Hey Jeff,

On Mon, Jan 28, 2013 at 09:26:01PM +0800, Jeff Liu wrote:
> Refining the existing reservations with xfs_calc_buf_res() in xfs_trans.c
> 
> Signed-off-by: Jie Liu <jeff.liu@oracle.com>
> CC: Dave Chinner <david@fromorbit.com>
> Reviewed-by: Mark Tinguely <tinguely@sgi.com>

...

> ---
>  fs/xfs/xfs_trans.c |  237 ++++++++++++++++++++++++----------------------------
>  1 file changed, 110 insertions(+), 127 deletions(-)
> 
> diff --git a/fs/xfs/xfs_trans.c b/fs/xfs/xfs_trans.c

...

> @@ -298,18 +286,19 @@ xfs_calc_create_reservation(
>  	struct xfs_mount	*mp)
>  {
>  	return XFS_DQUOT_LOGRES(mp) +
> -		MAX((mp->m_sb.sb_inodesize +
> -		     mp->m_sb.sb_inodesize +
> -		     mp->m_sb.sb_sectsize +
> +		MAX((xfs_calc_buf_res(2, mp->m_sb.sb_inodesize) +
> +		     xfs_calc_buf_res(1, mp->m_sb.sb_sectsize) +
>  		     XFS_FSB_TO_B(mp, 1) +
> -		     XFS_DIROP_LOG_RES(mp) +
> -		     128 * (3 + XFS_DIROP_LOG_COUNT(mp))),
> -		    (3 * mp->m_sb.sb_sectsize +
> -		     XFS_FSB_TO_B(mp, XFS_IALLOC_BLOCKS(mp)) +
> -		     XFS_FSB_TO_B(mp, mp->m_in_maxlevels) +
> -		     XFS_ALLOCFREE_LOG_RES(mp, 1) +
> -		     128 * (2 + XFS_IALLOC_BLOCKS(mp) + mp->m_in_maxlevels +
> -			    XFS_ALLOCFREE_LOG_COUNT(mp, 1))));
> +		     xfs_calc_buf_res(XFS_DIROP_LOG_COUNT(mp),
> +				      XFS_FSB_TO_B(mp, 1))),
> +		    (xfs_calc_buf_res(2, mp->m_sb.sb_sectsize) +
> +		     mp->m_sb.sb_sectsize +
> +		     xfs_calc_buf_res(XFS_IALLOC_BLOCKS(mp),
> +				      XFS_FSB_TO_B(mp, 1)) +
> +		     xfs_calc_buf_res(mp->m_in_maxlevels,
> +				      XFS_FSB_TO_B(mp, 1)) +
> +		     xfs_calc_buf_res(XFS_ALLOCFREE_LOG_COUNT(mp, 1),
> +				      XFS_FSB_TO_B(mp, 1))));
>  }

xfs/xfs_inode_item.c
xfs/xfs_trans.c: In function ‘xfs_calc_create_reservation’:
xfs/xfs_trans.c:289: warning: comparison of distinct pointer types lacks a cast

>  /*
> @@ -539,16 +524,14 @@ xfs_calc_attrrm_reservation(
>  	struct xfs_mount	*mp)
>  {
>  	return XFS_DQUOT_LOGRES(mp) +
> -		MAX((mp->m_sb.sb_inodesize +
> -		     XFS_FSB_TO_B(mp, XFS_DA_NODE_MAXDEPTH) +
> +		MAX((xfs_calc_buf_res(1, mp->m_sb.sb_inodesize) +
> +		     xfs_calc_buf_res(XFS_DA_NODE_MAXDEPTH,
> +				      XFS_FSB_TO_B(mp, 1)) +
>  		     XFS_FSB_TO_B(mp, XFS_BM_MAXLEVELS(mp, XFS_ATTR_FORK)) +
> -		     128 * (1 + XFS_DA_NODE_MAXDEPTH +
> -			    XFS_BM_MAXLEVELS(mp, XFS_DATA_FORK))),
> -		    (2 * mp->m_sb.sb_sectsize +
> -		     2 * mp->m_sb.sb_sectsize +
> -		     mp->m_sb.sb_sectsize +
> -		     XFS_ALLOCFREE_LOG_RES(mp, 2) +
> -		     128 * (5 + XFS_ALLOCFREE_LOG_COUNT(mp, 2))));
> +		     xfs_calc_buf_res(XFS_BM_MAXLEVELS(mp, XFS_DATA_FORK), 0)),
> +		    (xfs_calc_buf_res(5, mp->m_sb.sb_sectsize) +
> +		     xfs_calc_buf_res(XFS_ALLOCFREE_LOG_COUNT(mp, 2),
> +				      XFS_FSB_TO_B(mp, 1))));
>  }

xfs/xfs_trans.c: In function ‘xfs_calc_attrrm_reservation’:
xfs/xfs_trans.c:527: warning: comparison of distinct pointer types lacks a cast

Can you fix up those warnings?  I think you need only resend patch 2.

Thanks,
Ben

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

      reply	other threads:[~2013-02-01  1:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-28 13:26 [PATCH v4 02/13] xfs: make use of xfs_calc_buf_res() in xfs_trans.c Jeff Liu
2013-02-01  1:39 ` Ben Myers [this message]

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=20130201013937.GS27055@sgi.com \
    --to=bpm@sgi.com \
    --cc=jeff.liu@oracle.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.