All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tao Ma <tao.ma@oracle.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH 13/15] ocfs2: ocfs2_group_bitmap_size has to handle old volume.
Date: Fri, 02 Apr 2010 07:32:52 +0800	[thread overview]
Message-ID: <4BB52D24.1070204@oracle.com> (raw)
In-Reply-To: <20100401175334.GJ19666@mail.oracle.com>

Joel Becker wrote:
> On Thu, Apr 01, 2010 at 03:46:43PM +0800, Tao Ma wrote:
>   
>> Joel Becker wrote:
>>     
>>> 	So we do need the kernel to store the old-style bg_size in order
>>> to keep compatibility.  But we can do better.  First, you don't need the
>>> supports_discontig_bg argument.  You already have the superblock, just
>>> check ocfs2_supports_discontig_bg(OCFS2_SB(sb)).
>>>       
>> I have thought of this before, but finally I gave up. The reason is
>> that OCFS2_SB(sb) use ocfs2_super which is declared in ocfs2.h. So
>> you see, I don't want to overlap these 2 head files.
>>     
>
> 	You're right about OCFS2_SB().  This comes back to your
> userspace version of the interface too, where we don't even have the
> superblock.
> 	Perhaps the ocfs2_fs.h version of the function needs the awful
> integer arguments.  Maybe we can define a wrapper interface in ocfs2.h
> that takes the smarter arguments.  This would allow most call sites to
> read better.
> 	We could also define it as ocfs2_group_bitmap_size(struct
> super_block *sb, int sysfile_type, u32 feature_incompat).  This requires
> we pass in arguments that are obvious on their face.  We're going to
> have to know the information when we call the function anyway.
>   
I just went through all the callers of ocfs2_group_bitmap_size and it 
seems that it is called in 2 scenarios:
1. set bg_size.
2. check some situation in resize.

So how about change it to
ocfs2_group_bitmap_size(struct super_block *sb, struct ocfs2_group_desc *gd)
so if gd is NULL, we returns the old value, if not, just return bg_size.

As for place of setting bg_size, we can set bg_bits first and then set 
bg_size to (bg_bits +7)/8.

Regards,
Tao
> Joel
>
>
>   

  reply	other threads:[~2010-04-01 23:32 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-01  2:53 [Ocfs2-devel] [PATCH 0/15] ocfs2: Support for discontiguous block group Tao Ma
2010-04-01  2:58 ` [Ocfs2-devel] [PATCH 01/15] ocfs2: Define data structures for discontiguous block groups Tao Ma
2010-04-01  2:58 ` [Ocfs2-devel] [PATCH 02/15] ocfs2: Allocate " Tao Ma
2010-04-01  2:59 ` [Ocfs2-devel] [PATCH 03/15] ocfs2: Pass suballocation results back via a structure Tao Ma
2010-04-01  2:59 ` [Ocfs2-devel] [PATCH 04/15] ocfs2: Add suballoc_loc to metadata blocks Tao Ma
2010-04-01  2:59 ` [Ocfs2-devel] [PATCH 05/15] ocfs2: ocfs2_claim_suballoc_bits() doesn't need an osb argument Tao Ma
2010-04-01  2:59 ` [Ocfs2-devel] [PATCH 06/15] ocfs2: Trim suballocations if they cross discontiguous regions Tao Ma
2010-04-01  2:59 ` [Ocfs2-devel] [PATCH 07/15] ocfs2: ocfs2_claim_*() don't need an ocfs2_super argument Tao Ma
2010-04-01  2:59 ` [Ocfs2-devel] [PATCH 08/15] ocfs2: Return allocated metadata blknos on the ocfs2_suballoc_result Tao Ma
2010-04-01  2:59 ` [Ocfs2-devel] [PATCH 09/15] ocfs2: Set suballoc_loc on allocated metadata Tao Ma
2010-04-01  2:59 ` [Ocfs2-devel] [PATCH 10/15] ocfs2: Grow discontig block groups in one transaction Tao Ma
2010-04-01  2:59 ` [Ocfs2-devel] [PATCH 11/15] ocfs2: Don't relink cluster groups when allocating discontig block groups Tao Ma
2010-04-01  2:59 ` [Ocfs2-devel] [PATCH 12/15] ocfs2: Some tiny bug fixes for discontiguous block allocation Tao Ma
2010-04-01  3:34   ` Joel Becker
2010-04-01  4:32     ` Tao Ma
2010-04-01 17:44       ` Joel Becker
2010-04-01  2:59 ` [Ocfs2-devel] [PATCH 13/15] ocfs2: ocfs2_group_bitmap_size has to handle old volume Tao Ma
2010-04-01  3:38   ` Joel Becker
2010-04-01  4:22     ` Tao Ma
2010-04-01  4:34       ` Wengang Wang
2010-04-01  4:39         ` Tao Ma
2010-04-01  4:50           ` Tao Ma
2010-04-01  7:40             ` Joel Becker
2010-04-01  7:39           ` Joel Becker
2010-04-01  7:38         ` Joel Becker
2010-04-01  7:37       ` Joel Becker
2010-04-01  7:46         ` Tao Ma
2010-04-01 17:53           ` Joel Becker
2010-04-01 23:32             ` Tao Ma [this message]
2010-04-01 23:43               ` Joel Becker
2010-04-01  2:59 ` [Ocfs2-devel] [PATCH 14/15] ocfs2: Free block to the right block group Tao Ma
2010-04-01  3:42   ` Joel Becker
2010-04-01  2:59 ` [Ocfs2-devel] [PATCH 15/15] ocfs2: enable discontig block group support Tao Ma
2010-04-01  3:43   ` Joel Becker

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=4BB52D24.1070204@oracle.com \
    --to=tao.ma@oracle.com \
    --cc=ocfs2-devel@oss.oracle.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.