From patchwork Wed Jun 10 14:38:40 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 28429 Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id 6F1E6B7E39 for ; Thu, 11 Jun 2009 00:43:46 +1000 (EST) Received: by ozlabs.org (Postfix) id 81F63DE4AC; Thu, 11 Jun 2009 00:41:34 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 7F2D9DE496 for ; Thu, 11 Jun 2009 00:41:34 +1000 (EST) X-Original-To: cbe-oss-dev@ozlabs.org Delivered-To: cbe-oss-dev@ozlabs.org Received: from pophost.sonytel.be (vervifontaine.sonytel.be [80.88.33.193]) by ozlabs.org (Postfix) with ESMTP id C66BCDDDFD; Thu, 11 Jun 2009 00:39:20 +1000 (EST) Received: from vixen.sonytel.be (piraat.sonytel.be [43.221.60.197]) by pophost.sonytel.be (Postfix) with ESMTP id 2B8184448D; Wed, 10 Jun 2009 16:39:11 +0200 (CEST) Received: from geert by vixen.sonytel.be with local (Exim 4.63) (envelope-from ) id 1MEOxI-0006Jl-Cc; Wed, 10 Jun 2009 16:39:08 +0200 From: Geert Uytterhoeven To: Benjamin Herrenschmidt Date: Wed, 10 Jun 2009 16:38:40 +0200 Message-Id: <1244644748-24211-6-git-send-email-Geert.Uytterhoeven@sonycom.com> X-Mailer: git-send-email 1.6.2.4 In-Reply-To: <1244644748-24211-5-git-send-email-Geert.Uytterhoeven@sonycom.com> References: <1244644748-24211-1-git-send-email-Geert.Uytterhoeven@sonycom.com> <1244644748-24211-2-git-send-email-Geert.Uytterhoeven@sonycom.com> <1244644748-24211-3-git-send-email-Geert.Uytterhoeven@sonycom.com> <1244644748-24211-4-git-send-email-Geert.Uytterhoeven@sonycom.com> <1244644748-24211-5-git-send-email-Geert.Uytterhoeven@sonycom.com> Cc: Geert Uytterhoeven , linuxppc-dev@ozlabs.org, Jens Axboe , cbe-oss-dev@ozlabs.org Subject: [Cbe-oss-dev] [PATCH 05/33] block: Add bio_list_peek() X-BeenThere: cbe-oss-dev@ozlabs.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Discussion about Open Source Software for the Cell Broadband Engine List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: cbe-oss-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Errors-To: cbe-oss-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Introduce bio_list_peek(), to obtain a pointer to the first bio on the bio_list without actually removing it from the list. This is needed when you want to serialize based on the list being empty or not. Signed-off-by: Geert Uytterhoeven Cc: Jens Axboe --- include/linux/bio.h | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/include/linux/bio.h b/include/linux/bio.h index 7b214fd..618bb7d 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -590,6 +590,11 @@ static inline void bio_list_merge_head(struct bio_list *bl, bl->head = bl2->head; } +static inline struct bio *bio_list_peek(struct bio_list *bl) +{ + return bl->head; +} + static inline struct bio *bio_list_pop(struct bio_list *bl) { struct bio *bio = bl->head;