Re: [PATCH] laptop-mode for 2.6, version 2

From: Nikita Danilov
Date: Thu Dec 25 2003 - 05:29:09 EST


Hugang writes:
> On Thu, 25 Dec 2003 12:17:43 +0300
> Nikita Danilov <Nikita@xxxxxxxxxxx> wrote:
>
> > > unsigned long blocks;
> > > unsigned long mount_options = REISERFS_SB(s)->s_mount_opt;
> > > unsigned long safe_mask = 0;
> > > + unsigned int commit_max_age = -1;
> >
> > Assigning -1 to the unsigned int looks strange. Let's use 0, it is
> > invalid anyway.
> Yes, must change to -1, fixed.
>
> > I think that it would be better to first
> >
> > SB_JOURNAL_MAX_COMMIT_AGE(p_s_sb) = val
> >
> > in the parse_options() (after checking for validity), and in
> > journal_init() do something like
> >
> > if (SB_JOURNAL_MAX_COMMIT_AGE(p_s_sb) == 0) {
> > SB_JOURNAL_MAX_COMMIT_AGE(p_s_sb) = le32_to_cpu (jh->jh_journal.jp_journal_max_commit_age);
> > }
> >
> > This will also get rid of
> >
> > + if(commit_max_age != -1) {
> > + SB_JOURNAL_MAX_COMMIT_AGE(s) = commit_max_age;
> > + }
> > +
> >
> > piece in reiserfs_remount.
> >
> > Otherwise patch looks ok. Have you tested it?
> >
> In the parse_options() can not assigning commit max age to super block,
> the journal memory not malloc, so I pass a it to journal_init.
>
> Yes, It works in my laptop for 1 days. Every thinks is fine.

+ if ( val > 0 ) {
+ *commit_max_age = val;
+ }

here warning should be issued, and mount refused, if val == 0.

>
> Thanks.

Nikita.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/