---
name: "attempt_plug_merge"
section: "9"
platform: "linux"
package: "linux-manual-3.2"
version: "3.2.78-1"
release: "Debian 7 (Wheezy)"
platforms: ["linux"]
url: "https://new.carta.tech/attempt_plug_merge"
---

# attempt\_plug\_merge(9)

try to merge with current's plugged list

## NAME

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

## SYNOPSIS

**bool attempt\_plug\_merge(struct request\_queue \*** *q***, struct bio \*** *bio***, unsigned int \*** *request\_count***);**

## 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

## 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**.

This function is called without *q*-\>queue\_lock; however, elevator is accessed iff there already are requests on the plugged list which in turn guarantees validity of the elevator.

Note that, on successful merge, elevator operation **elevator\_bio\_merged\_fn** will be called without queue lock. Elevator must be ready for this.

## COPYRIGHT
