1

I am pretty new to Linux kernel programming and I am supposed to create a new RAID level for a course. This is why I am asking myself some questions about the functions and structures contained in the md.c file and especially about the structure mddev defined here. As you can see there are nearly no comments about the structure in itself. I simply do not understand what is the main role of that and what is the big difference with md_personality? Both seem to define the RAID functionality.

Nathan Tuggy
  • 2,237
  • 27
  • 30
  • 38
Zaaro
  • 11
  • 2
  • I clarified and trimmed the title to make it more attractive and easier to understand, and trimmed the tags and body for the same reason. – Nathan Tuggy Mar 16 '15 at 01:31
  • http://www.mjmwired.net/kernel/Documentation/md.txt As per this md_personality is more about RAID levels and mddev is for the device itself – Milind Dumbare Mar 16 '15 at 06:14
  • Thank you for the help guys and the modifications guys ! I think i get it now :D – Zaaro Mar 16 '15 at 20:41

1 Answers1

0

As per my understanding, whenever you create any new RAID device using mdadm utility with certain RAID level, MD layer creates mddev structure which holds information related to that newly created device like major-minor number for newly created device, max devices allowed etc.

md_personality is related to raid level you have given in mdadm. It contains RAID level and supported operations which can be performed on RAID device. md_personality is itself part of mddev.

In your case, I think you need to create new personality for your own purpose just like other personalities, i.e. raid5_personality for RAID 5 level.

pratik
  • 434
  • 2
  • 8
  • Thank you very much for that nice and quick answer ! I see how these stuffs work together now :) – Zaaro Mar 16 '15 at 20:42