How to create sysfs file and associate it with file operations like mmap

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

 



Hi all,
I want to create a sysfs file and associate it with several file opeations like open,close and mmap.
But when coming across sysfs file creation I saw that I can create a file using
device_create_file(struct device*,struct device_attributes*);
The device attributes were initialized using following
DEVICE_ATTR(_name,_permission,_show,_store);
But I want to associate my file with following operations
struct file_operations my_fops
{
      .open = my_open,
      .close = my_close,
      .mmap = my_mmap,
};
 
I was able to do this using
debugfs_create_file(...,&my_fops);
But is there anyway if I want to put this file in sec_class.
Thanking you in advance.
 
Thanks and Regards,
Niroj Pokhrel
 
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux