From: Alasdair G Kergon Subject: Re: [PATCH] Fixes for clone_bio and __clone_and_map functions in dm.c Date: Tue, 21 Mar 2006 14:35:15 +0000 Message-ID: <20060321143515.GL26428@agk.surrey.redhat.com> References: Reply-To: device-mapper development Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com To: device-mapper development List-Id: dm-devel.ids > I am a little confused about why is this not a problem. Isn't > clone->bi_vcnt > supposed to hold the number of bio vectors in the clone? Why does it hold > idx+bv_count instead? Please clarify. idx is non-zero; bv_count variable is the number starting from idx. clone->bi_vcnt is the total number. unsigned int bi_vcnt; /* how many bio_vec's */ unsigned int bi_idx; /* current index into bio_vec array */ clone_bio(bio, ci->sector, ci->idx, bio->bi_vcnt - ci->idx, ci->sector_count); leads to clone->bi_vcnt = ci->idx + bio->bi_vcnt - ci->idx = bio->bi_vcnt Like I said, obfuscated. Alasdair -- agk@redhat.com