函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\block_dev.c Create Date:2022-07-29 10:46:09
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:__blkdev_put

函数原型:static void __blkdev_put(struct block_device *bdev, fmode_t mode, int for_part)

返回类型:void

参数:

类型参数名称
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  如果for_part number of times partitions within this device have been opened. 自减
1887  如果非bd_openers先自减则
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  如果bd_contains恒等于bdev
1895  如果releaserelease(disk, mode)
1898  如果非bd_openers
1899  disk_put_part(bd_part)
1900  bd_part = NULL
1901  bd_disk = NULL
1902  如果bdev不等于bd_containsvictim等于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  如果victim__blkdev_put(victim, mode, 1)
调用者
名称描述
__blkdev_getd_mutex locking:* mutex_lock(part->bd_mutex)* mutex_lock_nested(whole->bd_mutex, 1)
__blkdev_put
blkdev_put