函数逻辑报告 |
Source Code:fs\block_dev.c |
Create Date:2022-07-29 10:46:07 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
首页 | 函数Tree |
注解内核,赢得工具 | 下载SCCT | English |
函数名称:d_mutex locking:* mutex_lock(part->bd_mutex)* mutex_lock_nested(whole->bd_mutex, 1)
函数原型:static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part)
返回类型:int
参数:
类型 | 参数 | 名称 |
---|---|---|
struct block_device * | bdev | |
fmode_t | mode | |
int | for_part |
1562 | perm等于0 |
1563 | bool first_open = false |
1565 | 如果mode按位与le is open for reading 则perm或等于MAY_READ |
1567 | 如果mode按位与le is open for writing 则perm或等于MAY_WRITE |
1572 | 如果非for_part则 |
1580 | restart : |
1583 | disk等于bdev_get_gendisk(bdev, & partno) |
1587 | disk_block_events(disk) |
1588 | mutex_lock_nested( & open/close mutex , for_part) |
1589 | 如果非bd_openers则 |
1590 | first_open = true |
1593 | bd_contains等于bdev |
1596 | 如果非partno则 |
1598 | bd_part等于disk_get_part(disk, partno) |
1602 | ret等于0 |
1603 | 如果open则 |
1610 | disk_put_part(bd_part) |
1611 | bd_part = NULL |
1612 | bd_disk = NULL |
1613 | bd_queue = NULL |
1615 | disk_unblock_events(disk) |
1616 | put_disk_and_module(disk) |
1617 | 转到:restart |
1621 | 如果非ret则 |
1622 | bd_set_size(bdev, (loff_t)get_capacity(disk) << 9) |
1623 | set_init_blocksize(bdev) |
1632 | 如果bd_invalidated且非ret或ret恒等于负ENOMEDIUM的值则bdev_disk_changed(bdev, ret == - ENOMEDIUM) |
1638 | 否则 |
1648 | bd_contains等于whole |
1649 | bd_part等于disk_get_part(disk, partno) |
1650 | 如果非flags按位与GENHD_FL_UP的值或非bd_part或非nr_sects则 |
1655 | bd_set_size(bdev, (loff_t)nr_sects << 9) |
1656 | set_init_blocksize(bdev) |
1659 | 如果bd_bdi恒等于noop_backing_dev_info则bd_bdi等于bdi_get(backing_dev_info) |
1661 | 否则 |
1662 | 如果bd_contains恒等于bdev则 |
1674 | bd_openers自加 |
1678 | disk_unblock_events(disk) |
1680 | 如果非first_open则put_disk_and_module(disk) |
1682 | 返回:0 |
1684 | out_clear : |
1685 | disk_put_part(bd_part) |
1686 | bd_disk = NULL |
1687 | bd_part = NULL |
1688 | bd_queue = NULL |
1689 | 如果bdev不等于bd_contains则__blkdev_put(bd_contains, mode, 1) |
1691 | bd_contains = NULL |
1692 | out_unlock_bdev : |
1694 | disk_unblock_events(disk) |
1695 | put_disk_and_module(disk) |
1696 | out : |
1699 | 返回:ret |
名称 | 描述 |
---|---|
__blkdev_get | d_mutex locking:* mutex_lock(part->bd_mutex)* mutex_lock_nested(whole->bd_mutex, 1) |
blkdev_get | lkdev_get - open a block device*@bdev: block_device to open*@mode: FMODE_* mask*@holder: exclusive holder identifier* Open @bdev with @mode. If @mode includes %FMODE_EXCL, @bdev is* open with exclusive access. Specifying %FMODE_EXCL with %NULL |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |