git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: chengang31@gmail.com
Cc: git@vger.kernel.org
Subject: Re: ce_stage(..) == 2?
Date: Sun, 14 Feb 2010 22:53:34 -0800	[thread overview]
Message-ID: <7vbpfrhtw1.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <4B78EE4B.2040707@gmail.com> (cg's message of "Mon\, 15 Feb 2010 14\:48\:43 +0800")

cg <chengang31@gmail.com> writes:

> I  saw some code like:
> attr.c(365): if (ce_stage(istate->cache[i]) == 2)
> ...
> rerere.c(352):  if (ce_stage(e2) == 2
> ...
>
> but there is no 0x200 in cache.h(158):
> #define CE_NAMEMASK  (0x0fff)
> #define CE_STAGEMASK (0x3000)
> #define CE_EXTENDED  (0x4000)
> #define CE_VALID     (0x8000)
> #define CE_STAGESHIFT 12
>
> so what does "2" mean?

#define ce_stage(ce) ((CE_STAGEMASK & (ce)->ce_flags) >> CE_STAGESHIFT)

0x3000 shifted 12 places is a mask for two bits, as you can have cache
entries at stage 0 (normal), or stage 1/2/3.

      reply	other threads:[~2010-02-15  6:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-15  6:48 ce_stage(..) == 2? cg
2010-02-15  6:53 ` Junio C Hamano [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=7vbpfrhtw1.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=chengang31@gmail.com \
    --cc=git@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).