procfs question

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

 



Hi list!

I need to create a hierarchy of procfs files. I made some tests successfully.
Now, I want to create a hierarchy as follows:

procfs
|
|
|-my_directory
          |
          |-dir_a
          |     |
          |     |-field 1
          |     |-field 2
          |     |-field 3
          |
          |-dir_b
          |     |-field 1
          |     |-field 2
          |     |-field 3

dir_a and dir_b has the correspondent dir_a and dir_b structs inside my module. These structs has the same type (the same fields but different values). So my idea was to assign the same read_proc function to all of my proc_dir_entry for "field *" files. Once inside this function, make a switch to know which concrete struct should I ask.
Here reaches my question. The switch would depend on the parent directory (if I'm reading from field 1 subdir of dir_a, then search for dir_a struct) but the comment at proc_fs.h say that "this is not complete implemented yet".

Can I use that fileds? Is there a easier way to implement this? I would like to write as fewer lines as possible to achieve this.

Thanks in advance.

[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