From patchwork Wed Mar 13 01:05:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 2260551 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 70E4A3FCF6 for ; Wed, 13 Mar 2013 01:05:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932509Ab3CMBFi (ORCPT ); Tue, 12 Mar 2013 21:05:38 -0400 Received: from mail-ob0-f181.google.com ([209.85.214.181]:49522 "EHLO mail-ob0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932103Ab3CMBFi (ORCPT ); Tue, 12 Mar 2013 21:05:38 -0400 Received: by mail-ob0-f181.google.com with SMTP id ni5so483082obc.40 for ; Tue, 12 Mar 2013 18:05:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding :x-gm-message-state; bh=R4LH2fS++07pyTkBjjK2L8Q1FkNI9pEx+e2X5UBAlKY=; b=CdFQCp0tSwSkkPPSK4+6sllBBDW0lgb5sHimulK0qI6fLd9fgqVZqmd8RuDyt2eoNJ RU6a1/m7oXZVgiFdiBSeG+GJj1xvD6xCysYfAmc6v2pS9I95N/zbRpdQg32JHl3eN9fq qJGnq31As85tjI/ltBNcW0kJ3LKcMxlsHlPN+PJBbdKZSe17IWuNm5NDWV/M42pgwlbb ivckQuv92F9P5HTZMk00trWcAy9ATH/VuPX6ROpspY7peg6PM5SJ47oGp8WV3CMWV+7q RDD8XHT/d1rVzdAzBZEoIj9w1wVn9TlfJSpiXWwm67j8vBz+AQ+ZSBhG4qNucDMu/6P+ JWgg== X-Received: by 10.60.31.42 with SMTP id x10mr13863298oeh.18.1363136737987; Tue, 12 Mar 2013 18:05:37 -0700 (PDT) Received: from [172.22.22.4] (c-71-195-31-37.hsd1.mn.comcast.net. [71.195.31.37]) by mx.google.com with ESMTPS id t9sm23696396obk.13.2013.03.12.18.05.35 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 12 Mar 2013 18:05:36 -0700 (PDT) Message-ID: <513FD0DF.30103@inktank.com> Date: Tue, 12 Mar 2013 20:05:35 -0500 From: Alex Elder User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130221 Thunderbird/17.0.3 MIME-Version: 1.0 To: ceph-devel@vger.kernel.org Subject: [PATCH 2/4] libceph: kill ceph message bio_iter, bio_seg References: <513FD092.2030106@inktank.com> In-Reply-To: <513FD092.2030106@inktank.com> X-Gm-Message-State: ALoCoQlajNrMcTuw/bq2tgCB4F31ans4l60Qfse2loLzPoUosiQN821uTEJ6WDRDhr7H6WA0Xou/ Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org The bio_iter and bio_seg fields in a message are no longer used, we use the cursor instead. So get rid of them and the functions that operate on them them. This is related to: http://tracker.ceph.com/issues/4428 Signed-off-by: Alex Elder --- include/linux/ceph/messenger.h | 6 +----- net/ceph/messenger.c | 31 ------------------------------- 2 files changed, 1 insertion(+), 36 deletions(-) * For a bio data item, a piece is whatever remains of the next @@ -1112,10 +1089,6 @@ static void prepare_message_data(struct ceph_msg *msg, msg_pos->page_pos = msg->p.alignment; else msg_pos->page_pos = 0; -#ifdef CONFIG_BLOCK - if (ceph_msg_has_bio(msg)) - init_bio_iter(msg->b.bio, &msg->b.bio_iter, &msg->b.bio_seg); -#endif msg_pos->data_pos = 0; /* Initialize data cursors */ @@ -1460,10 +1433,6 @@ static void in_msg_pos_next(struct ceph_connection *con, size_t len, BUG_ON(received != len); msg_pos->page_pos = 0; msg_pos->page++; -#ifdef CONFIG_BLOCK - if (msg->b.bio) - iter_bio_next(&msg->b.bio_iter, &msg->b.bio_seg); -#endif /* CONFIG_BLOCK */ } static u32 ceph_crc32c_page(u32 crc, struct page *page, diff --git a/include/linux/ceph/messenger.h b/include/linux/ceph/messenger.h index 459e552..252e01b 100644 --- a/include/linux/ceph/messenger.h +++ b/include/linux/ceph/messenger.h @@ -121,11 +121,7 @@ struct ceph_msg_data { enum ceph_msg_data_type type; union { #ifdef CONFIG_BLOCK - struct { - struct bio *bio_iter; /* iterator */ - struct bio *bio; - unsigned int bio_seg; /* current seg in bio */ - }; + struct bio *bio; #endif /* CONFIG_BLOCK */ struct { struct page **pages; /* NOT OWNER. */ diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c index 1b003b4..835447c 100644 --- a/net/ceph/messenger.c +++ b/net/ceph/messenger.c @@ -716,29 +716,6 @@ static void con_out_kvec_add(struct ceph_connection *con, } #ifdef CONFIG_BLOCK -static void init_bio_iter(struct bio *bio, struct bio **bio_iter, - unsigned int *bio_seg) -{ - if (!bio) { - *bio_iter = NULL; - *bio_seg = 0; - return; - } - *bio_iter = bio; - *bio_seg = (unsigned int) bio->bi_idx; -} - -static void iter_bio_next(struct bio **bio_iter, unsigned int *seg) -{ - if (*bio_iter == NULL) - return; - - BUG_ON(*seg >= (*bio_iter)->bi_vcnt); - - (*seg)++; - if (*seg == (*bio_iter)->bi_vcnt) - init_bio_iter((*bio_iter)->bi_next, bio_iter, seg); -} /*