From: Dave Chinner <david@fromorbit.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH] xfs: cleanup log reservation calculactions
Date: Wed, 28 Apr 2010 16:03:50 +1000 [thread overview]
Message-ID: <20100428060350.GF9783@dastard> (raw)
In-Reply-To: <20100427141909.GA6597@infradead.org>
On Tue, Apr 27, 2010 at 10:19:09AM -0400, Christoph Hellwig wrote:
> Instead of having small helper functions calling big macros do the
> calculations for the log reservations directly in the functions. These
> are mostly 1:1 from the macros execept that the macros kept the quota
> calculations in their callers.
I like the idea, just a coupl eof small(ish) comments.
Firstly:
> - return XFS_CALC_WRITE_LOG_RES(mp) + XFS_DQUOT_LOGRES(mp);
> + return MAX(
<some large expression>
> + ) + XFS_DQUOT_LOGRES(mp);
It's not very obvious that the dquot logres is separate to the large
calculation. The single space indents as perenthesis are nested
just doesn't make this stand out like I think it should. Can you
put the XFS_DQUOT_LOGRES(mp) first in all these calculations so that
it is more obvious that it is both present and separate to the main
reservation?i
That would also address the second issue that the way you terminate
the major expression and add the dquot logres is different in a
couple of functions.
I'm also wondering if we should be converting some of the magic
numbers like:
> +xfs_calc_ichange_reservation(
> + struct xfs_mount *mp)
> {
> - return XFS_CALC_ICHANGE_LOG_RES(mp) + XFS_DQUOT_LOGRES(mp);
> + return mp->m_sb.sb_inodesize +
> + mp->m_sb.sb_sectsize +
> + 512 +
> + XFS_DQUOT_LOGRES(mp);
> +
> }
to be correct. i.e.
return mp->m_sb.sb_inodesize +
mp->m_sb.sb_sectsize +
sizeof(struct xfs_inode_log_format) +
sizeof(struct xfs_buf_log_format) +
XFS_DQUOT_LOGRES(mp);
instead of the magic 512 bytes that are added? I guess that's more
of a followup correctness patch than a cleanup patch....
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
prev parent reply other threads:[~2010-04-28 6:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-27 14:19 [PATCH] xfs: cleanup log reservation calculactions Christoph Hellwig
2010-04-28 6:03 ` Dave Chinner [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=20100428060350.GF9783@dastard \
--to=david@fromorbit.com \
--cc=hch@infradead.org \
--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