questions about gendisk

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

 



Hello,

I have some questions about using the gendisk-structure in the 2.6-Kernels. I am writing a module which has to be initialised with 0 Partitions, and gets the partitions later. The numer of partitions changes during the lifetime of the module (online).

The first problem exists during initialisation of the gendisk. Which value is the right for gendisk->minors? include/linux/genhd.h says it must be the maximum number of minors. So if i set it to 680 the initialisation runs, but when I call the del_gendisk in the exit-function I get an error, that the system got an NULL-Pointer (gendisk is not NULL, but the partitions). If I set minors to the current count of partitions (0) it runs. And how must I initialise gendisk->part?

Second Problem: what do I have to do to add a partition to a gendisk? Do I have to build a new array of *hd_struct with one *hd_struct more? Or has gendisk->part to be initialised with the maximum count of partitions I need? Have I to do a del_gendisk and a add_disk to say the system that there is a new partition?

My third question has to do with get_gendisk. In my 2.6 Kernel this function gets two parameters: a dev_t (the device-number) and an *Integer (called part). In 2.4 there was only the device-number (a kdev_t). Why is the second parameter needed? Can a dev_t refer to more than one gendisk? Which value has *part to have?

I searched the documentation comeing with the kernel, the LKMPG and some books about my problems, without a result. Searching on google did not help me, even after spending much time on it. If someone nows any documentation in the internet or some books about that, I would be pleased. And I would be more pleased, if such a person would replay to me and tell me about it... :-)

tschau


Sascha Effert

--
Being evil means it can be christmas every day.

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[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