From: Stephen Hemminger <shemminger@osdl.org>
To: linux-kernel@vger.kernel.org
Subject: Re: [RFC][PATCH 3 of 4] Configfs is really sysfs
Date: Tue, 30 Aug 2005 16:06:43 -0700 [thread overview]
Message-ID: <20050830160643.65111ad0@dxpl.pdx.osdl.net> (raw)
In-Reply-To: <200508310859.55746.phillips@istop.com>
On Wed, 31 Aug 2005 08:59:55 +1000
Daniel Phillips <phillips@istop.com> wrote:
> Configfs rewritten as a single file and updated to use kobjects instead of its
> own clone of kobjects (config_items).
>
Some style issues:
Mixed case in labels
Bad identation
> +static int sysfs_create(struct dentry *dentry, int mode, int (*init) (struct inode *))
> +{
> + int error = 0;
> + struct inode *inode = NULL;
> + if (dentry) {
> + if (!dentry->d_inode) {
> + if ((inode = sysfs_new_inode(mode))) {
> + if (dentry->d_parent
> + && dentry->d_parent->d_inode) {
> + struct inode *p_inode =
> + dentry->d_parent->d_inode;
> + p_inode->i_mtime = p_inode->i_ctime =
> + CURRENT_TIME;
> + }
> + goto Proceed;
> + } else
> + error = -ENOMEM;
> + } else
> + error = -EEXIST;
> + } else
> + error = -ENOENT;
> + goto Done;
> +
> + Proceed:
> + if (init)
> + error = init(inode);
> + if (!error) {
> + d_instantiate(dentry, inode);
> + if (S_ISDIR(mode) || S_ISLNK(mode)) /* pin link and directory dentries */
> + dget(dentry);
> + } else
> + iput(inode);
> + Done:
Why the mixed case label?
> + return error;
> +}
> +/*
> + * configfs client helpers
> + */
> +
> +void config_group_init_type_name(struct kset *group, const char *name, struct kobj_type *type)
> +{
> + kobject_set_name(&group->kobj, name);
> + group->kobj.ktype = type;
> + config_group_init(group);
> +}
Use tabs not one space for indent.
> +void config_group_init(struct kset *group)
> +{
> + kobject_init(&group->kobj);
> + INIT_LIST_HEAD(&group->cg_children);
> +}
> +
> +void kobject_init_type_name(struct kobject *kobj, const char *name, struct kobj_type *type)
> +{
> + kobject_set_name(kobj, name);
> + kobj->ktype = type;
> + kobject_init(kobj);
> +}
> +
> +EXPORT_SYMBOL(configfs_register_subsystem);
> +EXPORT_SYMBOL(configfs_unregister_subsystem);
> +EXPORT_SYMBOL(config_group_init_type_name);
> +EXPORT_SYMBOL(config_group_init);
> +EXPORT_SYMBOL(kobject_init_type_name);
>
next prev parent reply other threads:[~2005-08-30 23:06 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-08-30 22:54 [RFC][PATCH 1 " Daniel Phillips
2005-08-30 22:57 ` [RFC][PATCH 2 " Daniel Phillips
2005-08-30 22:59 ` [RFC][PATCH 3 " Daniel Phillips
2005-08-30 23:03 ` [RFC][PATCH 4 " Daniel Phillips
2005-08-30 23:30 ` Daniel Phillips
2005-08-30 23:06 ` Stephen Hemminger [this message]
2005-08-30 23:18 ` [RFC][PATCH 3 " Daniel Phillips
2005-08-30 23:10 ` Daniel Phillips
2005-08-30 23:22 ` [RFC][PATCH 2 " Daniel Phillips
2005-08-30 23:13 ` [RFC][PATCH 1 " Joel Becker
2005-08-30 23:25 ` Daniel Phillips
2005-08-30 23:35 ` Daniel Phillips
2005-08-30 23:28 ` Andrew Morton
2005-08-30 23:34 ` viro
2005-08-30 23:51 ` Daniel Phillips
2005-08-30 23:37 ` Daniel Phillips
2005-08-31 0:03 ` Joel Becker
2005-09-04 3:53 ` Joel Becker
2005-09-04 4:12 ` Joel Becker
2005-09-04 4:41 ` Joel Becker
2005-09-04 4:54 ` Joel Becker
2005-09-07 20:31 ` Greg KH
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=20050830160643.65111ad0@dxpl.pdx.osdl.net \
--to=shemminger@osdl.org \
--cc=linux-kernel@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
all inboxes | Powered by JetHome®