---
name: "blk_attempt_plug_merge"
section: "9"
platform: "linux"
package: "linux-manual-4.9"
version: "4.9.228-1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/blk_attempt_plug_merge"
---

# blk\_attempt\_plug\_merge(9)

try to merge with current's plugged list

## NAME

blk\_attempt\_plug\_merge - try to merge with **current**'s plugged list

## SYNOPSIS

**bool blk\_attempt\_plug\_merge(struct request\_queue \*** *q***, struct bio \*** *bio***, unsigned int \*** *request\_count***, struct request \*\*** *same\_queue\_rq***);**

## ARGUMENTS

*q*

request\_queue new bio is being queued at

*bio*

new bio being queued

*request\_count*

out parameter for number of traversed plugged requests

*same\_queue\_rq*

pointer to struct request that gets filled in when another request associated with *q* is found on the plug list (optional, may be **NULL**)

## DESCRIPTION

Determine whether *bio* being queued on *q* can be merged with a request on **current**'s plugged list. Returns **true** if merge was successful, otherwise **false**.

Plugging coalesces IOs from the same issuer for the same purpose without going through *q*-\>queue\_lock. As such it's more of an issuing mechanism than scheduling, and the request, while may have elvpriv data, is not added on the elevator at this point. In addition, we don't have reliable access to the elevator outside queue lock. Only check basic merging parameters without querying the elevator.

Caller must ensure !blk\_queue\_nomerges(q) beforehand.

## COPYRIGHT
