     sysfs

 kobject   ,    
 .     ?   sysfs  
  ,     .

,   

 ,      ,   -
  ktype  kobj ect   kset. ,  
kobject           ,  
 .  kobject_type   default_attrs,
     attribute.   -
       sysfs.

 attributes    <linux/sysfs .h>.

/*  attribute -     

    sysfs */
struct attribute {

char             *name;   /*   */
struct module     *owner;  /* ,  , 

  */

mode t           mode;    /*     */
};

 name   .       
    sysfs.  owner      module,
   ,   .
    ,     NULL.  mode 
 mode_t          sysfs.  -
    ,       
  S IRUGO,         , 
     S_IRUSR.     ,
 ,     S_IRUGO | S_IWUSR.    
   sysfs     -
    .

 attribute    ,  
sysfs_ops ,    .  sysfs_ops   -
   ,     <linux/sysfs . h>
 .

struct sysfs ops (

/*         sysfs */
ssize_t (*show) (struct kobject *kobj,         '
struct attribute *attr,
char *buffer) ;

/*         sysfs */
ssize_t (*store) (struct kobject *kobj,
struct attribute *attr,
const char *buffer,
size t size) ;

366  17