bug-parted
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: linux-swap code


From: Richard Hirst
Subject: Re: linux-swap code
Date: Wed, 27 Mar 2002 16:22:54 +0000
User-agent: Mutt/1.3.24i

Hi Andrew,

On Tue, Mar 26, 2002 at 04:34:48PM +1100, Andrew Clausen wrote:
> On Mon, Mar 25, 2002 at 04:01:54PM +0000, Richard Hirst wrote:
> > @@ -383,6 +379,7 @@
> >     if (!ped_geometry_read (fs->geom, fs_info->header, 0, 2))
> >             return 0;
> >     if (!rewrite) {
> > +           /* Creating a new swapspace */
> >  /* not many people use 2.0 nowadays.  If they are, then there's no harm 
> > done...
> >   * they'll just get a bit confused when they can't swap on...
> >   */
> > @@ -405,8 +402,11 @@
> >                                             - sizeof (SwapNewHeader)) / 4;
> >             memcpy (fs_info->sig, "SWAPSPACE2", 10);
> >     }
> > -   if (!swap_check_pages (fs))
> > -           return 0;
> > +   else {
> > +           /* Checking an existing swapspace */
> > +           if (!swap_check_pages (fs))
> > +                   return 0;
> > +   }
> >     return ped_geometry_write (fs->geom, fs_info->header, 0,
> >                                fs_info->page_sectors);
> >  }
> 
> This won't fix your complaint.  Resizing will also have rewrite == 1.
> The best solution is probably to separate writing the header and
> writing the bad page lists.  (i.e. make swap_check_pages() write
> out the list, and let the caller call it as they wish)

My complaint was that mkfs N linux-swap was slow, resizing didn't come in
to it, but anyway...

I don't see that in my source; swap_write() is only called with
rewrite=1 from swap_check().  I checked 1.6 which is basically the same.
swap_resize() calls swap_write() with rewrite=0.

[1.6 has extra calls to fs->check() from ped_file_system_{copy,resize}(),
but I don't think they'll ever get invoked for linux_swap, as
swap_open() sets fs->checked]

Am I misunderstanding something?

Cheers,
  Richard




reply via email to

[Prev in Thread] Current Thread [Next in Thread]