Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* Question about e8569813849b5da394a195c7e76b4faa452b12d1
@ 2008-10-08 20:59 Josef Bacik
  2008-10-09  0:14 ` Chris Mason
  2008-10-09  1:47 ` Yan Zheng
  0 siblings, 2 replies; 4+ messages in thread
From: Josef Bacik @ 2008-10-08 20:59 UTC (permalink / raw)
  To: linux-btrfs

Hello,

Is there a reason 

-       if (search_end == (u64)-1)
-               search_end = btrfs_super_total_bytes(&info->super_copy);

happened in the commit from $SUBJECT?  If its just a mistake thats fine I'll add
it back with my current patch, but if there is a reason it needed to go then I
need to know that too so I can figure out a different way to do what I want to
do.  Thanks,

Josef

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Question about e8569813849b5da394a195c7e76b4faa452b12d1
  2008-10-08 20:59 Question about e8569813849b5da394a195c7e76b4faa452b12d1 Josef Bacik
@ 2008-10-09  0:14 ` Chris Mason
  2008-10-09  1:47 ` Yan Zheng
  1 sibling, 0 replies; 4+ messages in thread
From: Chris Mason @ 2008-10-09  0:14 UTC (permalink / raw)
  To: Josef Bacik; +Cc: linux-btrfs

On Wed, 2008-10-08 at 16:59 -0400, Josef Bacik wrote:
> Hello,
> 
> Is there a reason 
> 
> -       if (search_end == (u64)-1)
> -               search_end = btrfs_super_total_bytes(&info->super_copy);
> 
> happened in the commit from $SUBJECT?  If its just a mistake thats fine I'll add
> it back with my current patch, but if there is a reason it needed to go then I
> need to know that too so I can figure out a different way to do what I want to
> do.  Thanks,

Yan removed this as part of the prep code for space balancing.  It is
probably because he needs to change btrfs_super_total_bytes and we can't
rely on it as search_end anymore.

-chris



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Question about e8569813849b5da394a195c7e76b4faa452b12d1
  2008-10-08 20:59 Question about e8569813849b5da394a195c7e76b4faa452b12d1 Josef Bacik
  2008-10-09  0:14 ` Chris Mason
@ 2008-10-09  1:47 ` Yan Zheng
  2008-10-09 10:49   ` Josef Bacik
  1 sibling, 1 reply; 4+ messages in thread
From: Yan Zheng @ 2008-10-09  1:47 UTC (permalink / raw)
  To: Josef Bacik; +Cc: linux-btrfs

2008/10/9 Josef Bacik <jbacik@redhat.com>:
> Hello,
>
> Is there a reason
>
> -       if (search_end == (u64)-1)
> -               search_end = btrfs_super_total_bytes(&info->super_copy);
>
> happened in the commit from $SUBJECT?  If its just a mistake thats fine I'll add
> it back with my current patch, but if there is a reason it needed to go then I
> need to know that too so I can figure out a different way to do what I want to
> do.  Thanks,
>

btrfs_super_total_bytes is total size of all devices. we can't rely on it as
search_end for two reasons:

1) If metadata mirror is enable, the value can be larger than the last byte of
    last chunk.

2) For a FS has been balanced, there are some 'holes' in the chunk address
    space, so the value can be smaller than the last byte of last chunk.

Regards
Yan Zheng

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Question about e8569813849b5da394a195c7e76b4faa452b12d1
  2008-10-09  1:47 ` Yan Zheng
@ 2008-10-09 10:49   ` Josef Bacik
  0 siblings, 0 replies; 4+ messages in thread
From: Josef Bacik @ 2008-10-09 10:49 UTC (permalink / raw)
  To: Yan Zheng; +Cc: Josef Bacik, linux-btrfs

On Thu, Oct 09, 2008 at 09:47:41AM +0800, Yan Zheng wrote:
> 2008/10/9 Josef Bacik <jbacik@redhat.com>:
> > Hello,
> >
> > Is there a reason
> >
> > -       if (search_end == (u64)-1)
> > -               search_end = btrfs_super_total_bytes(&info->super_copy);
> >
> > happened in the commit from $SUBJECT?  If its just a mistake thats fine I'll add
> > it back with my current patch, but if there is a reason it needed to go then I
> > need to know that too so I can figure out a different way to do what I want to
> > do.  Thanks,
> >
> 
> btrfs_super_total_bytes is total size of all devices. we can't rely on it as
> search_end for two reasons:
> 
> 1) If metadata mirror is enable, the value can be larger than the last byte of
>     last chunk.
> 
> 2) For a FS has been balanced, there are some 'holes' in the chunk address
>     space, so the value can be smaller than the last byte of last chunk.
>

Awesome thanks this is what I needed.  So here's my next question, we're hitting
ENOSPC before we're empty because of the way I currently lookup block groups in
find_free_extent, so I'm rewriting find_free_extent to lookup the
btrfs_space_info that we are looking to allocate out of, and just loop through
its list of block groups, starting at the one that the hint points to, until we
find what we need.  This way I can incorporate find_free_space into
find_free_extent and make the code a little easier to read.  Will this upset
what you are trying to do with the space balancing code?  Thanks,

Josef 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-10-09 10:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-08 20:59 Question about e8569813849b5da394a195c7e76b4faa452b12d1 Josef Bacik
2008-10-09  0:14 ` Chris Mason
2008-10-09  1:47 ` Yan Zheng
2008-10-09 10:49   ` Josef Bacik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox