Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:block\blk-core.c Create Date:2022-07-28 17:00:02
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:generic_make_request_checks

Proto:static __attribute__((__noinline__)) bool generic_make_request_checks(struct bio *bio)

Type:bool

Parameter:

TypeParameterName
struct bio *bio
872  nr_sectors = bio_sectors(bio)
873  status = BLK_STS_IOERR
876  might_sleep()
878  q = queue
879  If Value for the false possibility is greater at compile time(!q) Then
880  printk - print a kernel message*@fmt: format string* This is printk(). It can be called from any context. We want it to work.* We try to grab the console_lock. If we succeed, it's easy - we log the* output and call the console drivers
884  Go to end_io
892  If bottom bits req flags, * top bits REQ_OP. Use * accessors. & REQ_NOWAIT && Not queue_is_mq(q) Then
893  status = BLK_STS_AGAIN
894  Go to end_io
897  If should_fail_bio(bio) Then Go to end_io
900  If bi_partno Then
901  If Value for the false possibility is greater at compile time(Remap block n of partition p to block n+start(p) of the disk.) Then Go to end_io
903  Else
904  If Value for the false possibility is greater at compile time(bio_check_ro(bio, & part0)) Then Go to end_io
906  If Value for the false possibility is greater at compile time(Check whether this bio extends beyond the end of the device or partition.* This may well happen - the kernel calls bread() without checking the size of* the device, e.g., when mounting a file system.) Then Go to end_io
915  If Check if the bio or request is one that needs special treatment in the* flush state machine. && Not st_bit - Determine whether a bit is set*@nr: bit number to test*@addr: Address to start counting from Then
917  bottom bits req flags, * top bits REQ_OP. Use * accessors. &= ~(REQ_PREFLUSH | REQ_FUA)
918  If Not nr_sectors Then
919  status = BLK_STS_OK
920  Go to end_io
924  If Not st_bit - Determine whether a bit is set*@nr: bit number to test*@addr: Address to start counting from Then bottom bits req flags, * top bits REQ_OP. Use * accessors. &= ~REQ_HIPRI
928  Case bio_op(bio) == REQ_OP_DISCARD
929  If Not blk_queue_discard(q) Then Go to not_supported
931  Break
932  Case bio_op(bio) == REQ_OP_SECURE_ERASE
933  If Not blk_queue_secure_erase(q) Then Go to not_supported
935  Break
936  Case bio_op(bio) == REQ_OP_WRITE_SAME
937  If Not max_write_same_sectors Then Go to not_supported
939  Break
940  Case bio_op(bio) == REQ_OP_ZONE_RESET
941  Case bio_op(bio) == REQ_OP_ZONE_OPEN
942  Case bio_op(bio) == REQ_OP_ZONE_CLOSE
943  Case bio_op(bio) == REQ_OP_ZONE_FINISH
944  If Not blk_queue_is_zoned(q) Then Go to not_supported
946  Break
947  Case bio_op(bio) == REQ_OP_ZONE_RESET_ALL
948  If Not blk_queue_is_zoned(q) || Not blk_queue_zone_resetall(q) Then Go to not_supported
950  Break
951  Case bio_op(bio) == REQ_OP_WRITE_ZEROES
952  If Not max_write_zeroes_sectors Then Go to not_supported
954  Break
955  Default
956  Break
965  reate_io_context - try to create task->io_context*@gfp_mask: allocation mask*@node: allocation node* If %current->io_context is %NULL, allocate a new io_context and install* it. Returns the current %current->io_context which may be %NULL if
967  If Not blkcg_bio_issue_check(q, bio) Then Return false
970  If Not bio_flagged(bio, BIO_TRACE_COMPLETION) Then
971  lock_bio_queue - putting new block IO operation in queue*@q: queue holding operation*@bio: new block operation* About to place the block IO operation @bio into queue @q.
975  bio_set_flag(bio, BIO_TRACE_COMPLETION)
977  Return true
979  not_supported :
980  status = BLK_STS_NOTSUPP
981  end_io :
982  bi_status = status
983  _endio - end I/O on a bio*@bio: bio* Description:* bio_endio() will end I/O on the whole bio. bio_endio() is the preferred* way to end I/O on a bio. No one should call bi_end_io() directly on a
984  Return false
Caller
NameDescribe
generic_make_requestgeneric_make_request - hand a buffer to its device driver for I/O*@bio: The bio describing the location in memory and on the device.* generic_make_request() is used to make I/O requests of block* devices
direct_make_requestdirect_make_request - hand a buffer directly to its device driver for I/O*@bio: The bio describing the location in memory and on the device.* This function behaves like generic_make_request(), but does not protect* against recursion