Re: [RFC][PATCH 3 of 4] Configfs is really sysfs

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

 



On Wed, 31 Aug 2005 08:59:55 +1000
Daniel Phillips <[email protected]> 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);
>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux