This structure represents a disk device and its media for the kernel. This structure is allocated by the kernel in the 'disk_add' function, freed in the 'disk_dereference' function.
More...
This structure represents a disk device and its media for the kernel. This structure is allocated by the kernel in the 'disk_add' function, freed in the 'disk_dereference' function.
- Source
- blkdev/disk.inc:126
◆ AppCache
◆ cache_size
Pointer to array of .NumPartitions pointers to PARTITION structures.
◆ CacheLock
inherited from cache_ideX_size
◆ DriverFlags
This field is passed to all callback functions so a driver can decide which physical device is addressed.
◆ Functions
All disk devices are linked in one list with these two fields. Head of the list is the 'disk_list' variable.
◆ MediaInfo
Count of active references to the media object. One reference is kept during the lifetime of the media between two calls to 'disk_media_changed'. Another reference is taken during any filesystem operation for this media. The callback 'closemedia' is called when the reference count decrements to zero: this usually occurs in 'disk_media_changed', but can be delayed to the end of the last filesystem operation, if one is active.
◆ MediaInserted
Lock to protect the MEDIA structure. See the description after 'disk_list_mutex' for the locking strategy. Fields of media object
◆ MediaLock
Count of active references to this structure. One reference is kept during the lifetime of the structure between 'disk_add' and 'disk_del'. Another reference is taken during any filesystem operation for this disk. One reference is added if media is inserted. The structure is destroyed when the reference count decrements to zero: this usually occurs in 'disk_del', but can be delayed to the end of last filesystem operation, if one is active.
◆ MediaRefCount
The following fields are not valid unless either .MediaInserted is nonzero or they are accessed from a code which has obtained the reference when .MediaInserted was nonzero.
◆ MediaUsed
0 if media is not inserted, nonzero otherwise.
◆ Name
Pointer to the 'DISKFUNC' structure with driver functions.
◆ Next
◆ NumPartitions
This field keeps information on the current media.
◆ Partitions
Number of partitions on this media.
◆ Prev
◆ RefCount
Bitfield. Currently only DISK_NO_INSERT_NOTIFICATION bit is defined. If it is set, the driver will never issue 'disk_media_changed' notification with argument set to true, so the kernel must try to detect media during requests from the file system.
◆ SysCache
Lock to protect both caches.
◆ UserData
Pointer to the string used for accesses through the global filesystem.
The documentation for this struct was generated from the following file: