linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wang Sheng-Hui <shhuiw@gmail.com>
To: Alex Lyakas <alex.btrfs@zadarastorage.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: Questions about mkfs -A option
Date: Thu, 25 Oct 2012 11:01:24 +0800	[thread overview]
Message-ID: <5088AB84.9020409@gmail.com> (raw)
In-Reply-To: <CAOcd+r3wVZc+doKBzF4E=K+xC7FTP44da6==iEaqB=2jNNkWYg@mail.gmail.com>

On 2012年10月24日 17:44, Alex Lyakas wrote:

> Hi Wang,
> if you just look at the code in find_free_dev_extent():
> u64 search_start = 0;
> ...
> search_start = max((u64)1024 * 1024, search_start);
> if (root->fs_info->alloc_start + num_bytes <= device->total_bytes)
> 	search_start = max(root->fs_info->alloc_start, search_start);
> ...
> key.objectid = device->devid;
> key.offset = search_start;
> key.type = BTRFS_DEV_EXTENT_KEY;
> 
> You see that it will search for DEV_EXTENTs (when allocating chunks)
> that begin after the value you specified. So it will not use some
> space at the beginning of the device for allocations. Same behavior in
> the kernel can be caused by using "alloc_start=X" mount option.
> What is the purpose of this I don't know, but what it does looks pretty clear.
> The (first copy of the) superblock, though, is always written to
> BTRFS_SUPER_INFO_OFFSET, as you mentioned.
> 
> Alex.
> 
> 


Thanks, Alex.

> 
> 
> On Wed, Oct 24, 2012 at 2:48 AM, Wang Sheng-Hui <shhuiw@gmail.com> wrote:
>> On 2012年10月23日 01:49, Alex Lyakas wrote:
>>
>>> Wang,
>>> I would say that zeroing is done to prevent from seeing some other superblock (besides btrfs) there.
>>
>>
>> That make sense.
>>
>>>
>>> Alex.
>>>
>>>
>>
>>
>> But I still confused by the -A option?
>>
>> In mkfs, we always write the sb info into BTRFS_SUPER_INFO_OFFSET.
>> From the -A comment, I think btrfs would be places after the -A value.
>> What would happen if we specify a -A value larger than it?
>>
>>
>> Thanks,
>> Sheng-Hui



      reply	other threads:[~2012-10-25  3:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-17  7:02 Questions about mkfs -A option Wang Sheng-Hui
     [not found] ` <CAOcd+r1aPGGh4zHYzeMMuE01j4Nr+aiMmHBCAWqqCXvZZTb2XQ@mail.gmail.com>
2012-10-24  0:48   ` Wang Sheng-Hui
2012-10-24  9:44     ` Alex Lyakas
2012-10-25  3:01       ` Wang Sheng-Hui [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=5088AB84.9020409@gmail.com \
    --to=shhuiw@gmail.com \
    --cc=alex.btrfs@zadarastorage.com \
    --cc=linux-btrfs@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).