Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753870AbcDOKuv (ORCPT ); Fri, 15 Apr 2016 06:50:51 -0400 Received: from mx2.suse.de ([195.135.220.15]:50116 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753811AbcDOKus (ORCPT ); Fri, 15 Apr 2016 06:50:48 -0400 Subject: Re: [PATCH 41/42] block: do not use REQ_FLUSH for tracking flush support To: mchristi@redhat.com, linux-f2fs-devel@lists.sourceforge.net, linux-ext4@vger.kernel.org, konrad.wilk@oracle.com, drbd-dev@lists.linbit.com, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, linux-raid@vger.kernel.org, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-bcache@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, linux-mtd@lists.infradead.org, target-devel@vger.kernel.org, linux-btrfs@vger.kernel.org, osd-dev@open-osd.org, xfs@oss.sgi.com, ocfs2-devel@oss.oracle.com References: <1460716802-2294-1-git-send-email-mchristi@redhat.com> <1460716802-2294-42-git-send-email-mchristi@redhat.com> From: Juergen Gross Message-ID: <5710C77F.2000405@pfupf.net> Date: Fri, 15 Apr 2016 12:50:39 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 In-Reply-To: <1460716802-2294-42-git-send-email-mchristi@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2294 Lines: 69 On 15/04/16 12:40, mchristi@redhat.com wrote: > From: Mike Christie > > The last patch added a REQ_OP_FLUSH for request_fn drivers > and the next patch renames REQ_FLUSH to REQ_PREFLUSH which > will be used by file systems and make_request_fn drivers so > they can send a write/flush combo. > > This patch drops xen's use of REQ_FLUSH to track if it supports > REQ_OP_FLUSH requests, so REQ_FLUSH can be deleted. > > v6: > - Dropped parts of patch handled by Jens's QUEUE_FLAG_WC/FUA > patches and modified patch to check feature_flush/fua bits. > > Signed-off-by: Mike Christie > Reviewed-by: Hannes Reinecke > --- > drivers/block/xen-blkfront.c | 47 ++++++++++++++++++++++---------------------- > 1 file changed, 24 insertions(+), 23 deletions(-) > > diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c > index f01691a..d6429e7 100644 > --- a/drivers/block/xen-blkfront.c > +++ b/drivers/block/xen-blkfront.c ... > @@ -985,24 +981,22 @@ static int xlvbd_init_blk_queue(struct gendisk *gd, u16 sector_size, > return 0; > } > > -static const char *flush_info(unsigned int feature_flush) > +static const char *flush_info(struct blkfront_info *info) > { > - switch (feature_flush & ((REQ_FLUSH | REQ_FUA))) { > - case REQ_FLUSH|REQ_FUA: > + if (info->feature_flush && info->feature_fua) > return "barrier: enabled;"; > - case REQ_FLUSH: > + else if (info->feature_fua) Shouldn't this test feature_flush? > return "flush diskcache: enabled;"; > - default: > + else > return "barrier or flush: disabled;"; > - } > } > > static void xlvbd_flush(struct blkfront_info *info) > { > - blk_queue_write_cache(info->rq, info->feature_flush & REQ_FLUSH, > - info->feature_flush & REQ_FUA); > + blk_queue_write_cache(info->rq, info->feature_flush ? true : false, > + info->feature_flush ? true : false); And here the second test should be feature_fua? > pr_info("blkfront: %s: %s %s %s %s %s\n", > - info->gd->disk_name, flush_info(info->feature_flush), > + info->gd->disk_name, flush_info(info), > "persistent grants:", info->feature_persistent ? > "enabled;" : "disabled;", "indirect descriptors:", > info->max_indirect_segments ? "enabled;" : "disabled;"); Juergen