Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
group.c File Reference
#include <linux/kobject.h>
#include <linux/module.h>
#include <linux/dcache.h>
#include <linux/namei.h>
#include <linux/err.h>
#include "sysfs.h"

Go to the source code of this file.

Functions

int sysfs_create_group (struct kobject *kobj, const struct attribute_group *grp)
 
int sysfs_update_group (struct kobject *kobj, const struct attribute_group *grp)
 
void sysfs_remove_group (struct kobject *kobj, const struct attribute_group *grp)
 
int sysfs_merge_group (struct kobject *kobj, const struct attribute_group *grp)
 
 EXPORT_SYMBOL_GPL (sysfs_merge_group)
 
void sysfs_unmerge_group (struct kobject *kobj, const struct attribute_group *grp)
 
 EXPORT_SYMBOL_GPL (sysfs_unmerge_group)
 
 EXPORT_SYMBOL_GPL (sysfs_create_group)
 
 EXPORT_SYMBOL_GPL (sysfs_update_group)
 
 EXPORT_SYMBOL_GPL (sysfs_remove_group)
 

Function Documentation

EXPORT_SYMBOL_GPL ( sysfs_merge_group  )
EXPORT_SYMBOL_GPL ( sysfs_unmerge_group  )
EXPORT_SYMBOL_GPL ( sysfs_create_group  )
EXPORT_SYMBOL_GPL ( sysfs_update_group  )
EXPORT_SYMBOL_GPL ( sysfs_remove_group  )
int sysfs_create_group ( struct kobject kobj,
const struct attribute_group grp 
)

sysfs_create_group - given a directory kobject, create an attribute group : The kobject to create the group on : The attribute group to create

This function creates a group for the first time. It will explicitly warn and error if any of the attribute files being created already exist.

Returns 0 on success or error.

Definition at line 101 of file group.c.

int sysfs_merge_group ( struct kobject kobj,
const struct attribute_group grp 
)

sysfs_merge_group - merge files into a pre-existing attribute group. : The kobject containing the group. : The files to create and the attribute group they belong to.

This function returns an error if the group doesn't exist or any of the files already exist in that group, in which case none of the new files are created.

Definition at line 164 of file group.c.

void sysfs_remove_group ( struct kobject kobj,
const struct attribute_group grp 
)

Definition at line 132 of file group.c.

void sysfs_unmerge_group ( struct kobject kobj,
const struct attribute_group grp 
)

sysfs_unmerge_group - remove files from a pre-existing attribute group. : The kobject containing the group. : The files to remove and the attribute group they belong to.

Definition at line 193 of file group.c.

int sysfs_update_group ( struct kobject kobj,
const struct attribute_group grp 
)

sysfs_update_group - given a directory kobject, update an attribute group : The kobject to update the group on : The attribute group to update

This function updates an attribute group. Unlike sysfs_create_group(), it will explicitly not warn or error if any of the attribute files being created already exist. Furthermore, if the visibility of the files has changed through the is_visible() callback, it will update the permissions and add or remove the relevant files.

The primary use for this function is to call it after making a change that affects group visibility.

Returns 0 on success or error.

Definition at line 124 of file group.c.