mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-19 10:53:58 +00:00
Additional information on the memory properties of struct disk
instances: the memory holding a struct disk should be pre-zeroed so as to initialize any storage framework private data in the structures properly. In addition, the memory must be writable so that the private data may be updated. Pointed out by: phk
This commit is contained in:
parent
ef43d3b590
commit
5e50629b39
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=120497
@ -46,6 +46,7 @@ components, including
|
||||
.Xr GEOM 4 ,
|
||||
and
|
||||
.Xr devfs 5 .
|
||||
.Pp
|
||||
Each disk device is described by a
|
||||
.Vt "struct disk"
|
||||
structure, which contains a variety of parameters for the disk device,
|
||||
@ -53,11 +54,17 @@ function pointers for various methods that may be performed on the device,
|
||||
as well as private data storage for the device driver.
|
||||
In addition, some fields are reserved for use by GEOM in managing access
|
||||
to the device and its statistics.
|
||||
Fields in the structure will generally be assumed not to change once the
|
||||
structure is submitted to
|
||||
Because of storage driver framework private data stored in
|
||||
.Vt "struct disk" ,
|
||||
instances of the structure should be allocated out of writable, pre-zero'd
|
||||
memory.
|
||||
.Pp
|
||||
Public fields in the structure will generally be assumed not to change once
|
||||
the structure is submitted to
|
||||
.Fn disk_create ,
|
||||
and so no explicit locking is employed; drivers that change the values of
|
||||
any of these fields do so at their own risk.
|
||||
.Pp
|
||||
Memory associated with the
|
||||
.Vt "struct disk"
|
||||
is owned by the device driver, but should not be released until after
|
||||
|
Loading…
Reference in New Issue
Block a user