KolibriOS kernel
DISK Struct Reference

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...

Public Attributes

dd Next
 
dd Prev
 
dd Functions
 
dd Name
 
dd UserData
 
dd DriverFlags
 
dd RefCount
 
MUTEX MediaLock
 
db MediaInserted
 
db MediaUsed
 
dd MediaRefCount
 
DISKMEDIAINFO MediaInfo
 
dd NumPartitions
 
dd Partitions
 
dd cache_size
 
MUTEX CacheLock
 
DISKCACHE SysCache
 
DISKCACHE AppCache
 

Detailed Description

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

Member Data Documentation

◆ AppCache

DISKCACHE DISK::AppCache

◆ cache_size

dd DISK::cache_size

Pointer to array of .NumPartitions pointers to PARTITION structures.

◆ CacheLock

MUTEX DISK::CacheLock

inherited from cache_ideX_size

◆ DriverFlags

dd DISK::DriverFlags

This field is passed to all callback functions so a driver can decide which physical device is addressed.

◆ Functions

dd DISK::Functions

All disk devices are linked in one list with these two fields. Head of the list is the 'disk_list' variable.

◆ MediaInfo

DISKMEDIAINFO DISK::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

db DISK::MediaInserted

Lock to protect the MEDIA structure. See the description after 'disk_list_mutex' for the locking strategy. Fields of media object

◆ MediaLock

MUTEX DISK::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

dd DISK::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

db DISK::MediaUsed

0 if media is not inserted, nonzero otherwise.

◆ Name

dd DISK::Name

Pointer to the 'DISKFUNC' structure with driver functions.

◆ Next

dd DISK::Next

Fields of disk object

◆ NumPartitions

dd DISK::NumPartitions

This field keeps information on the current media.

◆ Partitions

dd DISK::Partitions

Number of partitions on this media.

◆ Prev

dd DISK::Prev

◆ RefCount

dd DISK::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

DISKCACHE DISK::SysCache

Lock to protect both caches.

◆ UserData

dd DISK::UserData

Pointer to the string used for accesses through the global filesystem.


The documentation for this struct was generated from the following file: