Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\block_dev.c Create Date:2022-07-28 20:14:49
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:__blkdev_put

Proto:static void __blkdev_put(struct block_device *bdev, fmode_t mode, int for_part)

Type:void

Parameter:

TypeParameterName
struct block_device *bdev
fmode_tmode
intfor_part
1880  disk = bd_disk
1881  struct block_device * victim = NULL
1883  mutex_lock_nested( & open/close mutex , for_part)
1884  If for_part Then number of times partitions within this device have been opened. --
1887  If Not --bd_openers Then
1888  WARN_ON_ONCE(bd_holders)
1889  Write out and wait upon all the dirty data associated with a block* device via its mapping. Does not take the superblock lock.
1890  Kill _all_ buffers and pagecache , dirty or not..
1892  bdev_write_inode(bdev)
1894  If bd_contains == bdev Then
1895  If release Then release(disk, mode)
1898  If Not bd_openers Then
1899  disk_put_part(bd_part)
1900  bd_part = NULL
1901  bd_disk = NULL
1902  If bdev != bd_contains Then victim = bd_contains
1904  bd_contains = NULL
1906  put_disk_and_module(disk)
1908  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
1909  bdput(bdev)
1910  If victim Then __blkdev_put(victim, mode, 1)
Caller
NameDescribe
__blkdev_getd_mutex locking:* mutex_lock(part->bd_mutex)* mutex_lock_nested(whole->bd_mutex, 1)
__blkdev_put
blkdev_put