update block_device_operations documentation
Updated Documentation/filesystems/Locking to match the code. Signed-off-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
committed by
Al Viro
parent
8358e7d71e
commit
e1455d1bdc
@@ -349,21 +349,36 @@ call this method upon the IO completion.
|
|||||||
|
|
||||||
--------------------------- block_device_operations -----------------------
|
--------------------------- block_device_operations -----------------------
|
||||||
prototypes:
|
prototypes:
|
||||||
int (*open) (struct inode *, struct file *);
|
int (*open) (struct block_device *, fmode_t);
|
||||||
int (*release) (struct inode *, struct file *);
|
int (*release) (struct gendisk *, fmode_t);
|
||||||
int (*ioctl) (struct inode *, struct file *, unsigned, unsigned long);
|
int (*ioctl) (struct block_device *, fmode_t, unsigned, unsigned long);
|
||||||
|
int (*compat_ioctl) (struct block_device *, fmode_t, unsigned, unsigned long);
|
||||||
|
int (*direct_access) (struct block_device *, sector_t, void **, unsigned long *);
|
||||||
int (*media_changed) (struct gendisk *);
|
int (*media_changed) (struct gendisk *);
|
||||||
|
void (*unlock_native_capacity) (struct gendisk *);
|
||||||
int (*revalidate_disk) (struct gendisk *);
|
int (*revalidate_disk) (struct gendisk *);
|
||||||
|
int (*getgeo)(struct block_device *, struct hd_geometry *);
|
||||||
|
void (*swap_slot_free_notify) (struct block_device *, unsigned long);
|
||||||
|
|
||||||
locking rules:
|
locking rules:
|
||||||
BKL bd_sem
|
BKL bd_mutex
|
||||||
open: yes yes
|
open: no yes
|
||||||
release: yes yes
|
release: no yes
|
||||||
ioctl: yes no
|
ioctl: no no
|
||||||
|
compat_ioctl: no no
|
||||||
|
direct_access: no no
|
||||||
media_changed: no no
|
media_changed: no no
|
||||||
|
unlock_native_capacity: no no
|
||||||
revalidate_disk: no no
|
revalidate_disk: no no
|
||||||
|
getgeo: no no
|
||||||
|
swap_slot_free_notify: no no (see below)
|
||||||
|
|
||||||
|
media_changed, unlock_native_capacity and revalidate_disk are called only from
|
||||||
|
check_disk_change().
|
||||||
|
|
||||||
|
swap_slot_free_notify is called with swap_lock and sometimes the page lock
|
||||||
|
held.
|
||||||
|
|
||||||
The last two are called only from check_disk_change().
|
|
||||||
|
|
||||||
--------------------------- file_operations -------------------------------
|
--------------------------- file_operations -------------------------------
|
||||||
prototypes:
|
prototypes:
|
||||||
|
Reference in New Issue
Block a user