From patchwork Fri Aug 31 13:30:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pankaj Gupta X-Patchwork-Id: 964445 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4220l621Jgz9s1x for ; Fri, 31 Aug 2018 23:36:50 +1000 (AEST) Received: from localhost ([::1]:53726 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fvjbT-0005pG-UN for incoming@patchwork.ozlabs.org; Fri, 31 Aug 2018 09:36:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56935) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fvjad-0005g5-2h for qemu-devel@nongnu.org; Fri, 31 Aug 2018 09:35:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fvjVf-0005wS-O4 for qemu-devel@nongnu.org; Fri, 31 Aug 2018 09:30:48 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:48468 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fvjVf-0005wK-JU for qemu-devel@nongnu.org; Fri, 31 Aug 2018 09:30:47 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 399C580823E3; Fri, 31 Aug 2018 13:30:47 +0000 (UTC) Received: from dhcp201-121.englab.pnq.redhat.com (dhcp193-198.pnq.redhat.com [10.65.193.198]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7F6D7F3D01; Fri, 31 Aug 2018 13:30:38 +0000 (UTC) From: Pankaj Gupta To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, qemu-devel@nongnu.org, linux-nvdimm@ml01.01.org Date: Fri, 31 Aug 2018 19:00:16 +0530 Message-Id: <20180831133019.27579-2-pagupta@redhat.com> In-Reply-To: <20180831133019.27579-1-pagupta@redhat.com> References: <20180831133019.27579-1-pagupta@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Fri, 31 Aug 2018 13:30:47 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Fri, 31 Aug 2018 13:30:47 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'pagupta@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH 1/3] nd: move nd_region to common header X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, pagupta@redhat.com, jack@suse.cz, xiaoguangrong.eric@gmail.com, riel@surriel.com, niteshnarayanlal@hotmail.com, david@redhat.com, ross.zwisler@intel.com, lcapitulino@redhat.com, hch@infradead.org, mst@redhat.com, stefanha@redhat.com, imammedo@redhat.com, pbonzini@redhat.com, dan.j.williams@intel.com, nilal@redhat.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" This patch moves nd_region definition to common header include/linux/nd.h file. This is required for flush callback support for both virtio-pmem & pmem driver. Signed-off-by: Pankaj Gupta --- drivers/nvdimm/nd.h | 39 --------------------------------------- include/linux/nd.h | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 39 deletions(-) diff --git a/drivers/nvdimm/nd.h b/drivers/nvdimm/nd.h index 98317e7..d079a2b 100644 --- a/drivers/nvdimm/nd.h +++ b/drivers/nvdimm/nd.h @@ -123,45 +123,6 @@ enum nd_mapping_lock_class { ND_MAPPING_UUID_SCAN, }; -struct nd_mapping { - struct nvdimm *nvdimm; - u64 start; - u64 size; - int position; - struct list_head labels; - struct mutex lock; - /* - * @ndd is for private use at region enable / disable time for - * get_ndd() + put_ndd(), all other nd_mapping to ndd - * conversions use to_ndd() which respects enabled state of the - * nvdimm. - */ - struct nvdimm_drvdata *ndd; -}; - -struct nd_region { - struct device dev; - struct ida ns_ida; - struct ida btt_ida; - struct ida pfn_ida; - struct ida dax_ida; - unsigned long flags; - struct device *ns_seed; - struct device *btt_seed; - struct device *pfn_seed; - struct device *dax_seed; - u16 ndr_mappings; - u64 ndr_size; - u64 ndr_start; - int id, num_lanes, ro, numa_node; - void *provider_data; - struct kernfs_node *bb_state; - struct badblocks bb; - struct nd_interleave_set *nd_set; - struct nd_percpu_lane __percpu *lane; - struct nd_mapping mapping[0]; -}; - struct nd_blk_region { int (*enable)(struct nvdimm_bus *nvdimm_bus, struct device *dev); int (*do_io)(struct nd_blk_region *ndbr, resource_size_t dpa, diff --git a/include/linux/nd.h b/include/linux/nd.h index 43c181a..b9da9f7 100644 --- a/include/linux/nd.h +++ b/include/linux/nd.h @@ -120,6 +120,46 @@ struct nd_namespace_blk { struct resource **res; }; +struct nd_mapping { + struct nvdimm *nvdimm; + u64 start; + u64 size; + int position; + struct list_head labels; + struct mutex lock; + /* + * @ndd is for private use at region enable / disable time for + * get_ndd() + put_ndd(), all other nd_mapping to ndd + * conversions use to_ndd() which respects enabled state of the + * nvdimm. + */ + struct nvdimm_drvdata *ndd; +}; + +struct nd_region { + struct device dev; + struct ida ns_ida; + struct ida btt_ida; + struct ida pfn_ida; + struct ida dax_ida; + unsigned long flags; + struct device *ns_seed; + struct device *btt_seed; + struct device *pfn_seed; + struct device *dax_seed; + u16 ndr_mappings; + u64 ndr_size; + u64 ndr_start; + int id, num_lanes, ro, numa_node; + void *provider_data; + struct kernfs_node *bb_state; + struct badblocks bb; + struct nd_interleave_set *nd_set; + struct nd_percpu_lane __percpu *lane; + int (*flush)(struct nd_region *nd_region); + struct nd_mapping mapping[0]; +}; + static inline struct nd_namespace_io *to_nd_namespace_io(const struct device *dev) { return container_of(dev, struct nd_namespace_io, common.dev);