Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp562665imm; Fri, 31 Aug 2018 07:33:23 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaUsqzQoYxbwC3W+2fijJK58yr/UH9nDIr3urI5ogqyacv2EwA+zzIpiU5RN/lovNgJyXV0 X-Received: by 2002:a65:6455:: with SMTP id s21-v6mr14872730pgv.25.1535726003002; Fri, 31 Aug 2018 07:33:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535726002; cv=none; d=google.com; s=arc-20160816; b=Xp9hgxuVOONp+Um/4qzQJ6Sw4k1Dst2D1Ia5ReCGpplf3dKgflPMZGdzX+asvNr01T dkUJh6TPU3812ybqSUo5+uOYG7g1zDgAQ94yzcuZy5CTQAdxpY7tUuQEB+h+5E4+UD+I M1yQQl5E1FfWtgf+fngp7OBSr//R1MNzzJSB8teX4T2cOBwBHKrbdSJd51OkCe18AJcq SNai+8U3ZdetPFlutzDVclUPxYCoMJQdim4GIDHwZetPmM0X2r1SJWWFZ1hVoUbF2RsQ kEih9AHw3K0pB6NUJCUAbdX3FnIhK4MOy0TelxybpKYI8hrI0ooT9t9TpREeFniGrDI2 pm7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=Vm/q+3FGRQZKLpHYqvk2XUAVQhwctSwLUOnmnn4qMWU=; b=UQa/IDdJ6faQ6AiLSSJkPVJEG4y73xATqCLkZHk0LMVUi8WrSPB5ZyO2177ond0edh zpzlxVhAsqNs/gGMqX2xDew4DCZu/Nccbro4JjrudSzeaIQ0A6BtW5r/54WmLqOyeYvH SsSeWJgG68xY9F+j7/pFicEDjH46wFB0XpGXJqBVPREo1iKtHkjgnjZ8dvsNGzHrdJcf KkkyUwdel845IXkU/aEqG6p4kmmzV1wEDrSiGhf5JZZJz+rNfRNjcUQQcd7jW3FQoGYP LsaeN9lRIt5TcbY6FPVfsRFE6mjn9EnfD/gsvjD6fJvpcA9m9OuqwBphqPOXbkXG1Wl8 ybJw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o3-v6si9703038pld.281.2018.08.31.07.33.08; Fri, 31 Aug 2018 07:33:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728179AbeHaRiS (ORCPT + 99 others); Fri, 31 Aug 2018 13:38:18 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:60344 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728120AbeHaRiS (ORCPT ); Fri, 31 Aug 2018 13:38:18 -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 Cc: jack@suse.cz, stefanha@redhat.com, dan.j.williams@intel.com, riel@surriel.com, nilal@redhat.com, kwolf@redhat.com, pbonzini@redhat.com, ross.zwisler@intel.com, david@redhat.com, xiaoguangrong.eric@gmail.com, hch@infradead.org, mst@redhat.com, niteshnarayanlal@hotmail.com, lcapitulino@redhat.com, imammedo@redhat.com, eblake@redhat.com, pagupta@redhat.com Subject: [PATCH 1/3] nd: move nd_region to common header 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:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); -- 2.9.3