函数逻辑报告 |
Source Code:fs\direct-io.c |
Create Date:2022-07-29 10:46:38 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
首页 | 函数Tree |
注解内核,赢得工具 | 下载SCCT | English |
函数名称:This is a library function for use by filesystem drivers
函数原型:static inline ssize_t do_blockdev_direct_IO(struct kiocb *iocb, struct inode *inode, struct block_device *bdev, struct iov_iter *iter, get_block_t get_block, dio_iodone_t end_io, dio_submit_t submit_io, int flags)
返回类型:ssize_t
参数:
类型 | 参数 | 名称 |
---|---|---|
struct kiocb * | iocb | |
struct inode * | inode | |
struct block_device * | bdev | |
struct iov_iter * | iter | |
get_block_t | get_block | |
dio_iodone_t | end_io | |
dio_submit_t | submit_io | |
int | flags |
1152 | blocksize_mask等于1左移blkbits位的值减1 |
1154 | count等于iov_iter_count(iter) |
1158 | struct dio_submit sdio = {0, } |
1159 | struct buffer_head map_bh = {0, } |
1161 | align等于offset按位或iov_iter_alignment(iter) |
1168 | 如果align按位与blocksize_mask则 |
1169 | 如果bdev则blkbits等于assumes size > 256 |
1171 | blocksize_mask等于1左移blkbits位的值减1 |
1172 | 如果align按位与blocksize_mask则转到:out |
1177 | 如果iov_iter_rw(iter)恒等于generic data direction definitions 且非count则返回:0 |
1191 | doesn't change 等于flags |
1192 | 如果doesn't change 按位与DIO_LOCKING则 |
1193 | 如果iov_iter_rw(iter)恒等于generic data direction definitions 则 |
1212 | 如果iov_iter_rw(iter)恒等于generic data direction definitions 且offset大于等于_size when submitted 则 |
1213 | 如果doesn't change 按位与DIO_LOCKING则inode_unlock(inode) |
1215 | kmem_cache_free(dio_cache, dio) |
1216 | retval等于0 |
1217 | 转到:out |
1226 | 如果is_sync_kiocb(iocb)则s IO async ? = false |
1230 | 否则s IO async ? = true |
1234 | 如果iov_iter_rw(iter)恒等于WRITE则 |
1235 | op等于REQ_OP_WRITE |
1237 | 如果ki_flags按位与IOCB_NOWAIT则op_flags或等于REQ_NOWAIT |
1239 | 否则 |
1240 | op等于REQ_OP_READ |
1242 | 如果ki_flags按位与IOCB_HIPRI则op_flags或等于REQ_HIPRI |
1249 | 如果s IO async ? 且iov_iter_rw(iter)恒等于WRITE则 |
1250 | retval等于0 |
1251 | 如果ki_flags按位与IOCB_DSYNC则retval等于dio_set_defer_completion(dio) |
1253 | 否则如果非s_dio_done_wq则 |
1261 | 如果retval则 |
1266 | kmem_cache_free(dio_cache, dio) |
1267 | 转到:out |
1274 | 允许I/O信号请求 |
1276 | retval等于0 |
1277 | doesn't change 等于blkbits |
1278 | When we're using an alignment whichis finer than the filesystem's softblocksize, this specifies how muchfiner. blkfactor=2 means 1/4-blockalignment. Does not change 等于i_blkbits减blkbits |
1281 | lock mapping function 等于get_block |
1282 | IO completion function 等于end_io |
1283 | IO submition function 等于submit_io |
1284 | current final block in bio + 1 等于负1 |
1289 | spin_lock_init( & protects BIO fields below ) |
1290 | direct_io_worker() and bios 等于1 |
1292 | pages should be dirtied 等于iter_is_iovec(iter)且iov_iter_rw(iter)恒等于generic data direction definitions |
1294 | doesn't change 等于end右移blkbits位 |
1303 | approximate total IO pages 加等于iov_iter_npages(iter, INT_MAX) |
1305 | blk_start_plug( & plug) |
1316 | retval等于0 |
1324 | 如果The page 则 |
1327 | ret2等于Put cur_page under IO |
1331 | The page = NULL |
1336 | blk_finish_plug( & plug) |
1349 | 如果iov_iter_rw(iter)恒等于generic data direction definitions 且doesn't change 按位与DIO_LOCKING则inode_unlock(inode) |
1359 | BUG_ON(retval == - cb queued, will get completion event ) |
1360 | 如果s IO async ? 且retval恒等于0且IO result 且iov_iter_rw(iter)恒等于generic data direction definitions 或IO result 恒等于count的值则retval等于负cb queued, will get completion event |
1366 | 如果drop_refcount(dio)恒等于0则 |
1368 | 否则BUG_ON(retval != - cb queued, will get completion event ) |
1371 | out : |
1372 | 返回:retval |
名称 | 描述 |
---|---|
__blockdev_direct_IO |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |