License cleanup: add SPDX GPL-2.0 license identifier to files with no license
[linux-2.6-block.git] / drivers / nvdimm / pmem.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
f295e53b
DW
2#ifndef __NVDIMM_PMEM_H__
3#define __NVDIMM_PMEM_H__
4#include <linux/badblocks.h>
5#include <linux/types.h>
6#include <linux/pfn_t.h>
7#include <linux/fs.h>
8
f295e53b
DW
9/* this definition is in it's own header for tools/testing/nvdimm to consume */
10struct pmem_device {
11 /* One contiguous memory region per device */
12 phys_addr_t phys_addr;
13 /* when non-zero this device is hosting a 'pfn' instance */
14 phys_addr_t data_offset;
15 u64 pfn_flags;
7a9eb206 16 void *virt_addr;
f295e53b
DW
17 /* immutable base size of the namespace */
18 size_t size;
19 /* trim size when namespace capacity has been section aligned */
20 u32 pfn_pad;
975750a9 21 struct kernfs_node *bb_state;
f295e53b 22 struct badblocks bb;
c1d6e828
DW
23 struct dax_device *dax_dev;
24 struct gendisk *disk;
f295e53b 25};
c1d6e828
DW
26
27long __pmem_direct_access(struct pmem_device *pmem, pgoff_t pgoff,
28 long nr_pages, void **kaddr, pfn_t *pfn);
f295e53b 29#endif /* __NVDIMM_PMEM_H__ */