From: Dave Chinner <david@fromorbit.com>
To: Alex Elder <aelder@sgi.com>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCHv2 10/10] xfs: track the log sector size rather than log2(that)
Date: Mon, 12 Apr 2010 17:29:19 +1000 [thread overview]
Message-ID: <20100412072919.GL2493@dastard> (raw)
In-Reply-To: <1271048070.3174.125.camel@doink>
On Sun, Apr 11, 2010 at 11:54:30PM -0500, Alex Elder wrote:
> Change struct log so it keeps track of the size (in basic blocks)
> of a log sector in l_sectsize rather than the log-base-2 of that
> value (previously, l_sectbb_log).
>
> Signed-off-by: Alex Elder <aelder@sgi.com>
OK, this is what I commented on earlier....
> @@ -1050,29 +1051,31 @@ xlog_alloc_log(xfs_mount_t *mp,
>
> error = EFSCORRUPTED;
> if (xfs_sb_version_hassector(&mp->m_sb)) {
> - log->l_sectbb_log = mp->m_sb.sb_logsectlog - BBSHIFT;
> - if (log->l_sectbb_log < 0 ||
> - log->l_sectbb_log > mp->m_sectbb_log) {
> - xlog_warn("XFS: Log sector size (0x%x) out of range.",
> - log->l_sectbb_log);
> + sector_bits = mp->m_sb.sb_logsectlog;
> + if (sector_bits < BBSHIFT) {
> + xlog_warn("XFS: Log sector byte size too small "
> + "(0x%x < 0x%x)", sector_bits, BBSHIFT);
"sector_bits"? That doesn't seem to fit the units the log sector
size being read from and checked against. i.e. it's not bits, nor is
it bytes (as the error message says). It's really log2(sector size),
so perhaps calling it sector_size_log would be more accurate.
> goto out_free_log;
> }
>
> - /* for larger sector sizes, must have v2 or external log */
> - if (log->l_sectbb_log != 0 &&
> - (log->l_logBBstart != 0 &&
> - !xfs_sb_version_haslogv2(&mp->m_sb))) {
> - xlog_warn("XFS: log sector size (0x%x) invalid "
> - "for configuration.", log->l_sectbb_log);
> + sector_bits -= BBSHIFT;
> + if (sector_bits > mp->m_sectbb_log) {
> + xlog_warn("XFS: Log sector basic block size too large "
It's just the log sector size is too large - no need for "basic
block" in that error message.
> + "(0x%x > 0x%x)", sector_bits, mp->m_sectbb_log);
> goto out_free_log;
> }
> - if (mp->m_sb.sb_logsectlog < BBSHIFT) {
> - xlog_warn("XFS: Log sector log (0x%x) too small.",
> - mp->m_sb.sb_logsectlog);
> +
> + /* for larger sector sizes, must have v2 or external log */
> + if (sector_bits && (log->l_logBBstart > 0 &&
> + !xfs_sb_version_haslogv2(&mp->m_sb))) {
no need for the extra ()s there.
> +
> + xlog_warn("XFS: log sector size (0x%x) invalid "
> + "for configuration.", sector_bits);
> goto out_free_log;
> }
> }
> - log->l_sectbb_mask = (1 << log->l_sectbb_log) - 1;
> + log->l_sectsize = 1 << sector_bits;
> + log->l_sectbb_mask = log->l_sectsize - 1;
There's only only place left that uses l_sectbb_mask left (in
xlog_align()), so you could probably kill it while you are at it.
Everything else looks OK.
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2010-04-13 1:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-12 4:54 [PATCHv2 10/10] xfs: track the log sector size rather than log2(that) Alex Elder
2010-04-12 7:29 ` Dave Chinner [this message]
2010-04-14 21:32 ` Alex Elder
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=20100412072919.GL2493@dastard \
--to=david@fromorbit.com \
--cc=aelder@sgi.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