LKML Archive on lore.kernel.org help / color / mirror / Atom feed
From: akuster <akuster@mvista.com> To: Andrew Morton <akpm@linux-foundation.org> Cc: linux-kernel@vger.kernel.org, Pavel Machek <pavel@ucw.cz>, "Rafael J. Wysocki" <rjw@sisk.pl>, Nigel Cunningham <nigel@suspend2.net> Subject: Re: [patch 1/1] PM: Adds remount fs ro at suspend Date: Fri, 02 Feb 2007 14:57:19 -1000 [thread overview] Message-ID: <45C3DDEF.3040400@mvista.com> (raw) In-Reply-To: <20070202161611.cf8b4328.akpm@linux-foundation.org> Andrew Morton wrote: > On Fri, 02 Feb 2007 13:50:10 -1000 > akuster@mvista.com wrote: > >> <snipped> >> +struct suspremount { >> +struct super_block *sb; >> +struct suspremount *next; >> +}; > > The fields of this struct need a leading tab. ok. > > The name "suspremount" might be unpopular. suspend_remount_state would be > more kernely. > ok. > >> +static struct suspremount *suspremount_list; >> + >> +void suspend_remount_log_fs(struct super_block *sb) >> +{ >> + struct suspremount *remountp; >> + >> + if ((remountp = (struct suspremount *) >> + kmalloc(sizeof(struct suspremount), GFP_KERNEL)) != NULL) { > > The typecast is unneeded, and the compounded assign-and-test is not > preferred style. So here, please use > > struct suspremount *remountp; > > remountp = kmalloc(sizeof(*remountp), GFP_KERNEL); > if (remountp != NULL) { ok. >> +EXPORT_SYMBOL(suspend_remount_all_fs_ro); > > Why is this exported to modules? > it shouldn't. will remove >> + sb = remountp->sb; >> + flags = 0; >> + if (sb->s_op && sb->s_op->remount_fs) { >> + ret = sb->s_op->remount_fs(sb, &flags, NULL); >> + if (ret) printk("resume_remount_rw: error %d\n", ret); > > newline needed here. ok. > > super_block_operations.remount_fs() is supposed to be called under lock_super(). > Some filesystems might go BUG over this, or something. Was there a reason to > not do this? nope. will correct > >> + } >> + >> + tp = remountp->next; >> + kfree(remountp); >> + remountp = tp; >> + } >> + suspremount_list = NULL; >> +} >> +EXPORT_SYMBOL(resume_remount_fs_rw); > > Why the export? shouldn't > > All this code is singly-threaded at a much higher level (I hope), hence > that list doesn't need locking. However a comment explaining this might be > good. ok. > >> @@ -613,6 +677,9 @@ int do_remount_sb(struct super_block *sb >> unlock_super(sb); >> if (retval) >> return retval; >> +#ifdef CONFIG_SUSPEND_REMOUNTFS >> + suspend_remount_log_fs(sb); >> +#endif > > We try to avoid putting ifdefs in C files. So in a header file, do > > struct super_block; > #ifdef CONFIG_SUSPEND_REMOUNTFS > extern void suspend_remount_log_fs(struct super_block *sb); > #else > static inline void suspend_remount_log_fs(struct super_block *sb) {} > #endif > will do. Many thanks on the feedback. Armin
next prev parent reply other threads:[~2007-02-03 0:58 UTC|newest] Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top 2007-02-02 23:50 [patch 1/1] PM: Adds remount fs ro at suspend akuster 2007-02-03 0:16 ` Andrew Morton 2007-02-03 0:35 ` Henrique de Moraes Holschuh 2007-02-05 21:28 ` Nigel Cunningham 2007-02-05 21:35 ` Christoph Hellwig 2007-02-06 14:32 ` Henrique de Moraes Holschuh 2007-02-06 18:07 ` Rafael J. Wysocki 2007-02-06 21:38 ` Nigel Cunningham 2007-02-07 11:25 ` Henrique de Moraes Holschuh 2007-02-07 11:43 ` Nigel Cunningham 2007-02-07 12:05 ` Henrique de Moraes Holschuh 2007-02-07 14:10 ` Rafael J. Wysocki 2007-02-09 22:24 ` Pavel Machek 2007-02-13 12:12 ` Pavel Machek 2007-02-03 0:57 ` akuster [this message] 2007-02-03 10:08 ` Christoph Hellwig 2007-02-04 1:34 ` akuster 2007-02-05 16:56 ` Christoph Hellwig 2007-02-14 11:07 ` Pavel Machek 2007-02-03 16:19 ` Pavel Machek
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=45C3DDEF.3040400@mvista.com \ --to=akuster@mvista.com \ --cc=akpm@linux-foundation.org \ --cc=linux-kernel@vger.kernel.org \ --cc=nigel@suspend2.net \ --cc=pavel@ucw.cz \ --cc=rjw@sisk.pl \ /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: linkBe 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).