linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zheng Liu <gnehzuil.liu@gmail.com>
To: Theodore Ts'o <tytso@mit.edu>
Cc: linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	Zheng Liu <wenqing.lz@taobao.com>
Subject: Re: [PATCH 03/10 v3] ext4: add physical block and status member into extent status tree
Date: Tue, 29 Jan 2013 13:34:15 +0800	[thread overview]
Message-ID: <20130129053415.GA27002@gmail.com> (raw)
In-Reply-To: <20130129030353.GK7003@thunk.org>

On Mon, Jan 28, 2013 at 10:03:53PM -0500, Theodore Ts'o wrote:
> On Wed, Jan 23, 2013 at 08:03:53PM +0800, Zheng Liu wrote:
> > +	ext4_fsblk_t es_pblk : 62;	/* first physical block */
> > +	ext4_fsblk_t es_status : 2;	/* record the status of extent */
> 
> I'll accept this for now but note that ext4_fsblk_t is typedefed to be
> an unsigned long long, and C99 only guarantees that bitfields can be
> made from Bool, signed int, and unsigned int.  Gcc accepts unsigned
> long long based bit fields as an extension, but it's not portable
> code.  This is kernel code, though, and we have plenty more gcc
> specific code....

Thanks for pointing out.  When I tried to implement this code, there are
two choices.  One is like this that bit field is used.  IMHO it is clear
enough, although it is not portable.

Another choice is like this:

        struct extent_status {
                ...
                ext4_fsblk_t es_pblk;   /* first physical block */
        };

        #define EXTENT_STATUS_WRITTEN   (1ULL << 60)
        #define EXTENT_STATUS_UNWRITTEN (1ULL << 61)
        #define EXTENT_STATUS_DELAYED   (1ULL << 62)

When we want to set extent status, we will need to do like the following:

        es->es_pblk |= EXTENT_STATUS_WRITTEN;

This can make us avoid non-protable code.  I am happy to refine this
patch if you think the latter one is better.

Thanks,
                                                - Zheng

  reply	other threads:[~2013-01-29  5:20 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-23 12:03 [PATCH 00/10 v3] ext4: extent status tree (step2) Zheng Liu
2013-01-23 12:03 ` [PATCH 01/10 v3] ext4: refine extent status tree Zheng Liu
2013-01-23 12:03 ` [PATCH 02/10 v3] ext4: remove EXT4_MAP_FROM_CLUSTER flag Zheng Liu
2013-01-23 12:03 ` [PATCH 03/10 v3] ext4: add physical block and status member into extent status tree Zheng Liu
2013-01-29  3:03   ` Theodore Ts'o
2013-01-29  5:34     ` Zheng Liu [this message]
2013-01-29 17:28       ` Theodore Ts'o
2013-01-30  2:43         ` Zheng Liu
2013-01-23 12:03 ` [PATCH 04/10 v3] ext4: adjust interfaces of " Zheng Liu
2013-01-23 12:03 ` [PATCH 05/10 v3] ext4: track all extent status in " Zheng Liu
2013-01-23 12:03 ` [PATCH 06/10 v3] ext4: lookup block mapping " Zheng Liu
2013-01-23 12:03 ` [PATCH 07/10 v3] ext4: remove single extent cache Zheng Liu
2013-01-23 12:03 ` [PATCH 08/10 v3] fs: allow for fs-specific objects to be pruned as part of pruning inodes Zheng Liu
2013-01-23 12:03 ` [PATCH 09/10 v3] ext4: adjust some functions for reclaiming extents from extent status tree Zheng Liu
2013-01-23 12:04 ` [PATCH 10/10 v3] ext4: reclaim " Zheng Liu

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=20130129053415.GA27002@gmail.com \
    --to=gnehzuil.liu@gmail.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=tytso@mit.edu \
    --cc=wenqing.lz@taobao.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;
as well as URLs for NNTP newsgroup(s).