From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kara Subject: Re: [PATCH] bio: skip atomic inc/dec of ->bi_remaining for non-chains Date: Mon, 20 Apr 2015 18:04:46 +0200 Message-ID: <20150420160446.GL17020@quack.suse.cz> References: <20150417145933.GA4770@kernel.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org, elliott@hp.com To: Jens Axboe Return-path: Received: from cantor2.suse.de ([195.135.220.15]:44642 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753215AbbDTQEv (ORCPT ); Mon, 20 Apr 2015 12:04:51 -0400 Content-Disposition: inline In-Reply-To: <20150417145933.GA4770@kernel.dk> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Fri 17-04-15 08:59:33, Jens Axboe wrote: > @@ -292,8 +292,8 @@ void bio_reset(struct bio *bio) > __bio_free(bio); > > memset(bio, 0, BIO_RESET_BYTES); > - bio->bi_flags = flags|(1 << BIO_UPTODATE); > - atomic_set(&bio->bi_remaining, 1); > + bio->bi_flags = flags | 1 << BIO_UPTODATE; Although this is correct, I'd prefer to keep parenthesis around 1 << BIO_UPTODATE. Maybe I'm not a real C hacker but I had to lookup the operator precedence of | vs << :). Otherwise the patch looks good to me (but I'm not an expert in this area, I just looked into the patch by accident because I thought it's another respin of your direct IO patch ;). Honza -- Jan Kara SUSE Labs, CR