License cleanup: add SPDX GPL-2.0 license identifier to files with no license
Many source files in the tree are missing licensing information, which
makes it harder for compliance tools to determine the correct license.
By default all files without license information are under the default
license of the kernel, which is GPL version 2.
Update the files which contain no license information with the 'GPL-2.0'
SPDX license identifier. The SPDX identifier is a legally binding
shorthand, which can be used instead of the full boiler plate text.
This patch is based on work done by Thomas Gleixner and Kate Stewart and
Philippe Ombredanne.
How this work was done:
Patches were generated and checked against linux-4.14-rc6 for a subset of
the use cases:
- file had no licensing information it it.
- file was a */uapi/* one with no licensing information in it,
- file was a */uapi/* one with existing licensing information,
Further patches will be generated in subsequent months to fix up cases
where non-standard license headers were used, and references to license
had to be inferred by heuristics based on keywords.
The analysis to determine which SPDX License Identifier to be applied to
a file was done in a spreadsheet of side by side results from of the
output of two independent scanners (ScanCode & Windriver) producing SPDX
tag:value files created by Philippe Ombredanne. Philippe prepared the
base worksheet, and did an initial spot review of a few 1000 files.
The 4.13 kernel was the starting point of the analysis with 60,537 files
assessed. Kate Stewart did a file by file comparison of the scanner
results in the spreadsheet to determine which SPDX license identifier(s)
to be applied to the file. She confirmed any determination that was not
immediately clear with lawyers working with the Linux Foundation.
Criteria used to select files for SPDX license identifier tagging was:
- Files considered eligible had to be source code files.
- Make and config files were included as candidates if they contained >5
lines of source
- File already had some variant of a license header in it (even if <5
lines).
All documentation files were explicitly excluded.
The following heuristics were used to determine which SPDX license
identifiers to apply.
- when both scanners couldn't find any license traces, file was
considered to have no license information in it, and the top level
COPYING file license applied.
For non */uapi/* files that summary was:
SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 11139
and resulted in the first patch in this series.
If that file was a */uapi/* path one, it was "GPL-2.0 WITH
Linux-syscall-note" otherwise it was "GPL-2.0". Results of that was:
SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 WITH Linux-syscall-note 930
and resulted in the second patch in this series.
- if a file had some form of licensing information in it, and was one
of the */uapi/* ones, it was denoted with the Linux-syscall-note if
any GPL family license was found in the file or had no licensing in
it (per prior point). Results summary:
SPDX license identifier # files
---------------------------------------------------|------
GPL-2.0 WITH Linux-syscall-note 270
GPL-2.0+ WITH Linux-syscall-note 169
((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) 21
((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) 17
LGPL-2.1+ WITH Linux-syscall-note 15
GPL-1.0+ WITH Linux-syscall-note 14
((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause) 5
LGPL-2.0+ WITH Linux-syscall-note 4
LGPL-2.1 WITH Linux-syscall-note 3
((GPL-2.0 WITH Linux-syscall-note) OR MIT) 3
((GPL-2.0 WITH Linux-syscall-note) AND MIT) 1
and that resulted in the third patch in this series.
- when the two scanners agreed on the detected license(s), that became
the concluded license(s).
- when there was disagreement between the two scanners (one detected a
license but the other didn't, or they both detected different
licenses) a manual inspection of the file occurred.
- In most cases a manual inspection of the information in the file
resulted in a clear resolution of the license that should apply (and
which scanner probably needed to revisit its heuristics).
- When it was not immediately clear, the license identifier was
confirmed with lawyers working with the Linux Foundation.
- If there was any question as to the appropriate license identifier,
the file was flagged for further research and to be revisited later
in time.
In total, over 70 hours of logged manual review was done on the
spreadsheet to determine the SPDX license identifiers to apply to the
source files by Kate, Philippe, Thomas and, in some cases, confirmation
by lawyers working with the Linux Foundation.
Kate also obtained a third independent scan of the 4.13 code base from
FOSSology, and compared selected files where the other two scanners
disagreed against that SPDX file, to see if there was new insights. The
Windriver scanner is based on an older version of FOSSology in part, so
they are related.
Thomas did random spot checks in about 500 files from the spreadsheets
for the uapi headers and agreed with SPDX license identifier in the
files he inspected. For the non-uapi files Thomas did random spot checks
in about 15000 files.
In initial set of patches against 4.14-rc6, 3 files were found to have
copy/paste license identifier errors, and have been fixed to reflect the
correct identifier.
Additionally Philippe spent 10 hours this week doing a detailed manual
inspection and review of the 12,461 patched files from the initial patch
version early this week with:
- a full scancode scan run, collecting the matched texts, detected
license ids and scores
- reviewing anything where there was a license detected (about 500+
files) to ensure that the applied SPDX license was correct
- reviewing anything where there was no detection but the patch license
was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
SPDX license was correct
This produced a worksheet with 20 files needing minor correction. This
worksheet was then exported into 3 different .csv files for the
different types of files to be modified.
These .csv files were then reviewed by Greg. Thomas wrote a script to
parse the csv files and add the proper SPDX tag to the file, in the
format that the file expected. This script was further refined by Greg
based on the output to detect more types of files automatically and to
distinguish between header and source .c files (which need different
comment types.) Finally Greg ran the script using the .csv files to
generate the patches.
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-01 14:07:57 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
2015-09-08 21:58:40 +00:00
|
|
|
#ifndef _LINUX_DAX_H
|
|
|
|
#define _LINUX_DAX_H
|
|
|
|
|
|
|
|
#include <linux/fs.h>
|
|
|
|
#include <linux/mm.h>
|
2016-05-12 16:29:17 +00:00
|
|
|
#include <linux/radix-tree.h>
|
2015-09-08 21:58:40 +00:00
|
|
|
|
2018-11-30 16:05:06 +00:00
|
|
|
typedef unsigned long dax_entry_t;
|
|
|
|
|
2021-11-29 10:21:38 +00:00
|
|
|
struct dax_device;
|
|
|
|
struct gendisk;
|
2016-09-19 01:24:49 +00:00
|
|
|
struct iomap_ops;
|
2021-11-29 10:21:52 +00:00
|
|
|
struct iomap_iter;
|
2020-02-28 16:34:56 +00:00
|
|
|
struct iomap;
|
2021-11-29 10:21:38 +00:00
|
|
|
|
2022-05-13 22:10:58 +00:00
|
|
|
enum dax_access_mode {
|
|
|
|
DAX_ACCESS,
|
|
|
|
DAX_RECOVERY_WRITE,
|
|
|
|
};
|
|
|
|
|
2017-01-25 02:44:18 +00:00
|
|
|
struct dax_operations {
|
|
|
|
/*
|
|
|
|
* direct_access: translate a device-relative
|
|
|
|
* logical-page-offset into an absolute physical pfn. Return the
|
|
|
|
* number of pages available for DAX at that pfn.
|
|
|
|
*/
|
|
|
|
long (*direct_access)(struct dax_device *, pgoff_t, long,
|
2022-05-13 22:10:58 +00:00
|
|
|
enum dax_access_mode, void **, pfn_t *);
|
2019-05-16 20:26:29 +00:00
|
|
|
/*
|
|
|
|
* Validate whether this device is usable as an fsdax backing
|
|
|
|
* device.
|
|
|
|
*/
|
|
|
|
bool (*dax_supported)(struct dax_device *, struct block_device *, int,
|
|
|
|
sector_t, sector_t);
|
2020-02-28 16:34:52 +00:00
|
|
|
/* zero_page_range: required operation. Zero page range */
|
|
|
|
int (*zero_page_range)(struct dax_device *, pgoff_t, size_t);
|
2022-04-22 22:45:06 +00:00
|
|
|
/*
|
|
|
|
* recovery_write: recover a poisoned range by DAX device driver
|
|
|
|
* capable of clearing poison.
|
|
|
|
*/
|
|
|
|
size_t (*recovery_write)(struct dax_device *dax_dev, pgoff_t pgoff,
|
|
|
|
void *addr, size_t bytes, struct iov_iter *iter);
|
2017-01-25 02:44:18 +00:00
|
|
|
};
|
2016-09-19 01:24:49 +00:00
|
|
|
|
dax: introduce holder for dax_device
Patch series "v14 fsdax-rmap + v11 fsdax-reflink", v2.
The patchset fsdax-rmap is aimed to support shared pages tracking for
fsdax.
It moves owner tracking from dax_assocaite_entry() to pmem device driver,
by introducing an interface ->memory_failure() for struct pagemap. This
interface is called by memory_failure() in mm, and implemented by pmem
device.
Then call holder operations to find the filesystem which the corrupted
data located in, and call filesystem handler to track files or metadata
associated with this page.
Finally we are able to try to fix the corrupted data in filesystem and do
other necessary processing, such as killing processes who are using the
files affected.
The call trace is like this:
memory_failure()
|* fsdax case
|------------
|pgmap->ops->memory_failure() => pmem_pgmap_memory_failure()
| dax_holder_notify_failure() =>
| dax_device->holder_ops->notify_failure() =>
| - xfs_dax_notify_failure()
| |* xfs_dax_notify_failure()
| |--------------------------
| | xfs_rmap_query_range()
| | xfs_dax_failure_fn()
| | * corrupted on metadata
| | try to recover data, call xfs_force_shutdown()
| | * corrupted on file data
| | try to recover data, call mf_dax_kill_procs()
|* normal case
|-------------
|mf_generic_kill_procs()
The patchset fsdax-reflink attempts to add CoW support for fsdax, and
takes XFS, which has both reflink and fsdax features, as an example.
One of the key mechanisms needed to be implemented in fsdax is CoW. Copy
the data from srcmap before we actually write data to the destination
iomap. And we just copy range in which data won't be changed.
Another mechanism is range comparison. In page cache case, readpage() is
used to load data on disk to page cache in order to be able to compare
data. In fsdax case, readpage() does not work. So, we need another
compare data with direct access support.
With the two mechanisms implemented in fsdax, we are able to make reflink
and fsdax work together in XFS.
This patch (of 14):
To easily track filesystem from a pmem device, we introduce a holder for
dax_device structure, and also its operation. This holder is used to
remember who is using this dax_device:
- When it is the backend of a filesystem, the holder will be the
instance of this filesystem.
- When this pmem device is one of the targets in a mapped device, the
holder will be this mapped device. In this case, the mapped device
has its own dax_device and it will follow the first rule. So that we
can finally track to the filesystem we needed.
The holder and holder_ops will be set when filesystem is being mounted,
or an target device is being activated.
Link: https://lkml.kernel.org/r/20220603053738.1218681-1-ruansy.fnst@fujitsu.com
Link: https://lkml.kernel.org/r/20220603053738.1218681-2-ruansy.fnst@fujitsu.com
Signed-off-by: Shiyang Ruan <ruansy.fnst@fujitsu.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dan Williams <dan.j.wiliams@intel.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Cc: Dave Chinner <david@fromorbit.com>
Cc: Jane Chu <jane.chu@oracle.com>
Cc: Goldwyn Rodrigues <rgoldwyn@suse.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Naoya Horiguchi <naoya.horiguchi@nec.com>
Cc: Miaohe Lin <linmiaohe@huawei.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Goldwyn Rodrigues <rgoldwyn@suse.com>
Cc: Ritesh Harjani <riteshh@linux.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2022-06-03 05:37:25 +00:00
|
|
|
struct dax_holder_operations {
|
|
|
|
/*
|
|
|
|
* notify_failure - notify memory failure into inner holder device
|
|
|
|
* @dax_dev: the dax device which contains the holder
|
|
|
|
* @offset: offset on this dax device where memory failure occurs
|
|
|
|
* @len: length of this memory failure event
|
|
|
|
* @flags: action flags for memory failure handler
|
|
|
|
*/
|
|
|
|
int (*notify_failure)(struct dax_device *dax_dev, u64 offset,
|
|
|
|
u64 len, int mf_flags);
|
|
|
|
};
|
|
|
|
|
2017-05-13 23:31:05 +00:00
|
|
|
#if IS_ENABLED(CONFIG_DAX)
|
2021-12-15 08:45:07 +00:00
|
|
|
struct dax_device *alloc_dax(void *private, const struct dax_operations *ops);
|
dax: introduce holder for dax_device
Patch series "v14 fsdax-rmap + v11 fsdax-reflink", v2.
The patchset fsdax-rmap is aimed to support shared pages tracking for
fsdax.
It moves owner tracking from dax_assocaite_entry() to pmem device driver,
by introducing an interface ->memory_failure() for struct pagemap. This
interface is called by memory_failure() in mm, and implemented by pmem
device.
Then call holder operations to find the filesystem which the corrupted
data located in, and call filesystem handler to track files or metadata
associated with this page.
Finally we are able to try to fix the corrupted data in filesystem and do
other necessary processing, such as killing processes who are using the
files affected.
The call trace is like this:
memory_failure()
|* fsdax case
|------------
|pgmap->ops->memory_failure() => pmem_pgmap_memory_failure()
| dax_holder_notify_failure() =>
| dax_device->holder_ops->notify_failure() =>
| - xfs_dax_notify_failure()
| |* xfs_dax_notify_failure()
| |--------------------------
| | xfs_rmap_query_range()
| | xfs_dax_failure_fn()
| | * corrupted on metadata
| | try to recover data, call xfs_force_shutdown()
| | * corrupted on file data
| | try to recover data, call mf_dax_kill_procs()
|* normal case
|-------------
|mf_generic_kill_procs()
The patchset fsdax-reflink attempts to add CoW support for fsdax, and
takes XFS, which has both reflink and fsdax features, as an example.
One of the key mechanisms needed to be implemented in fsdax is CoW. Copy
the data from srcmap before we actually write data to the destination
iomap. And we just copy range in which data won't be changed.
Another mechanism is range comparison. In page cache case, readpage() is
used to load data on disk to page cache in order to be able to compare
data. In fsdax case, readpage() does not work. So, we need another
compare data with direct access support.
With the two mechanisms implemented in fsdax, we are able to make reflink
and fsdax work together in XFS.
This patch (of 14):
To easily track filesystem from a pmem device, we introduce a holder for
dax_device structure, and also its operation. This holder is used to
remember who is using this dax_device:
- When it is the backend of a filesystem, the holder will be the
instance of this filesystem.
- When this pmem device is one of the targets in a mapped device, the
holder will be this mapped device. In this case, the mapped device
has its own dax_device and it will follow the first rule. So that we
can finally track to the filesystem we needed.
The holder and holder_ops will be set when filesystem is being mounted,
or an target device is being activated.
Link: https://lkml.kernel.org/r/20220603053738.1218681-1-ruansy.fnst@fujitsu.com
Link: https://lkml.kernel.org/r/20220603053738.1218681-2-ruansy.fnst@fujitsu.com
Signed-off-by: Shiyang Ruan <ruansy.fnst@fujitsu.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dan Williams <dan.j.wiliams@intel.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Cc: Dave Chinner <david@fromorbit.com>
Cc: Jane Chu <jane.chu@oracle.com>
Cc: Goldwyn Rodrigues <rgoldwyn@suse.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Naoya Horiguchi <naoya.horiguchi@nec.com>
Cc: Miaohe Lin <linmiaohe@huawei.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Goldwyn Rodrigues <rgoldwyn@suse.com>
Cc: Ritesh Harjani <riteshh@linux.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2022-06-03 05:37:25 +00:00
|
|
|
void *dax_holder(struct dax_device *dax_dev);
|
2017-05-13 23:31:05 +00:00
|
|
|
void put_dax(struct dax_device *dax_dev);
|
2018-03-30 00:22:13 +00:00
|
|
|
void kill_dax(struct dax_device *dax_dev);
|
|
|
|
void dax_write_cache(struct dax_device *dax_dev, bool wc);
|
|
|
|
bool dax_write_cache_enabled(struct dax_device *dax_dev);
|
2021-12-15 08:45:06 +00:00
|
|
|
bool dax_synchronous(struct dax_device *dax_dev);
|
|
|
|
void set_dax_synchronous(struct dax_device *dax_dev);
|
2022-04-22 22:45:06 +00:00
|
|
|
size_t dax_recovery_write(struct dax_device *dax_dev, pgoff_t pgoff,
|
|
|
|
void *addr, size_t bytes, struct iov_iter *i);
|
2019-07-05 14:03:26 +00:00
|
|
|
/*
|
|
|
|
* Check if given mapping is supported by the file / underlying device.
|
|
|
|
*/
|
|
|
|
static inline bool daxdev_mapping_supported(struct vm_area_struct *vma,
|
|
|
|
struct dax_device *dax_dev)
|
|
|
|
{
|
|
|
|
if (!(vma->vm_flags & VM_SYNC))
|
|
|
|
return true;
|
|
|
|
if (!IS_DAX(file_inode(vma->vm_file)))
|
|
|
|
return false;
|
|
|
|
return dax_synchronous(dax_dev);
|
|
|
|
}
|
2017-05-13 23:31:05 +00:00
|
|
|
#else
|
dax: introduce holder for dax_device
Patch series "v14 fsdax-rmap + v11 fsdax-reflink", v2.
The patchset fsdax-rmap is aimed to support shared pages tracking for
fsdax.
It moves owner tracking from dax_assocaite_entry() to pmem device driver,
by introducing an interface ->memory_failure() for struct pagemap. This
interface is called by memory_failure() in mm, and implemented by pmem
device.
Then call holder operations to find the filesystem which the corrupted
data located in, and call filesystem handler to track files or metadata
associated with this page.
Finally we are able to try to fix the corrupted data in filesystem and do
other necessary processing, such as killing processes who are using the
files affected.
The call trace is like this:
memory_failure()
|* fsdax case
|------------
|pgmap->ops->memory_failure() => pmem_pgmap_memory_failure()
| dax_holder_notify_failure() =>
| dax_device->holder_ops->notify_failure() =>
| - xfs_dax_notify_failure()
| |* xfs_dax_notify_failure()
| |--------------------------
| | xfs_rmap_query_range()
| | xfs_dax_failure_fn()
| | * corrupted on metadata
| | try to recover data, call xfs_force_shutdown()
| | * corrupted on file data
| | try to recover data, call mf_dax_kill_procs()
|* normal case
|-------------
|mf_generic_kill_procs()
The patchset fsdax-reflink attempts to add CoW support for fsdax, and
takes XFS, which has both reflink and fsdax features, as an example.
One of the key mechanisms needed to be implemented in fsdax is CoW. Copy
the data from srcmap before we actually write data to the destination
iomap. And we just copy range in which data won't be changed.
Another mechanism is range comparison. In page cache case, readpage() is
used to load data on disk to page cache in order to be able to compare
data. In fsdax case, readpage() does not work. So, we need another
compare data with direct access support.
With the two mechanisms implemented in fsdax, we are able to make reflink
and fsdax work together in XFS.
This patch (of 14):
To easily track filesystem from a pmem device, we introduce a holder for
dax_device structure, and also its operation. This holder is used to
remember who is using this dax_device:
- When it is the backend of a filesystem, the holder will be the
instance of this filesystem.
- When this pmem device is one of the targets in a mapped device, the
holder will be this mapped device. In this case, the mapped device
has its own dax_device and it will follow the first rule. So that we
can finally track to the filesystem we needed.
The holder and holder_ops will be set when filesystem is being mounted,
or an target device is being activated.
Link: https://lkml.kernel.org/r/20220603053738.1218681-1-ruansy.fnst@fujitsu.com
Link: https://lkml.kernel.org/r/20220603053738.1218681-2-ruansy.fnst@fujitsu.com
Signed-off-by: Shiyang Ruan <ruansy.fnst@fujitsu.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dan Williams <dan.j.wiliams@intel.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Cc: Dave Chinner <david@fromorbit.com>
Cc: Jane Chu <jane.chu@oracle.com>
Cc: Goldwyn Rodrigues <rgoldwyn@suse.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Naoya Horiguchi <naoya.horiguchi@nec.com>
Cc: Miaohe Lin <linmiaohe@huawei.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Goldwyn Rodrigues <rgoldwyn@suse.com>
Cc: Ritesh Harjani <riteshh@linux.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2022-06-03 05:37:25 +00:00
|
|
|
static inline void *dax_holder(struct dax_device *dax_dev)
|
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
2021-11-29 10:21:38 +00:00
|
|
|
static inline struct dax_device *alloc_dax(void *private,
|
2021-12-15 08:45:07 +00:00
|
|
|
const struct dax_operations *ops)
|
2018-03-30 00:22:13 +00:00
|
|
|
{
|
|
|
|
/*
|
|
|
|
* Callers should check IS_ENABLED(CONFIG_DAX) to know if this
|
|
|
|
* NULL is an error or expected.
|
|
|
|
*/
|
|
|
|
return NULL;
|
|
|
|
}
|
2017-05-13 23:31:05 +00:00
|
|
|
static inline void put_dax(struct dax_device *dax_dev)
|
|
|
|
{
|
|
|
|
}
|
2018-03-30 00:22:13 +00:00
|
|
|
static inline void kill_dax(struct dax_device *dax_dev)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
static inline void dax_write_cache(struct dax_device *dax_dev, bool wc)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
static inline bool dax_write_cache_enabled(struct dax_device *dax_dev)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
2019-07-05 14:03:24 +00:00
|
|
|
static inline bool dax_synchronous(struct dax_device *dax_dev)
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
static inline void set_dax_synchronous(struct dax_device *dax_dev)
|
|
|
|
{
|
|
|
|
}
|
2019-07-05 14:03:26 +00:00
|
|
|
static inline bool daxdev_mapping_supported(struct vm_area_struct *vma,
|
|
|
|
struct dax_device *dax_dev)
|
|
|
|
{
|
|
|
|
return !(vma->vm_flags & VM_SYNC);
|
|
|
|
}
|
2022-04-22 22:45:06 +00:00
|
|
|
static inline size_t dax_recovery_write(struct dax_device *dax_dev,
|
|
|
|
pgoff_t pgoff, void *addr, size_t bytes, struct iov_iter *i)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
2017-05-13 23:31:05 +00:00
|
|
|
#endif
|
|
|
|
|
2021-12-15 08:45:08 +00:00
|
|
|
void set_dax_nocache(struct dax_device *dax_dev);
|
|
|
|
void set_dax_nomc(struct dax_device *dax_dev);
|
|
|
|
|
2018-03-07 23:26:44 +00:00
|
|
|
struct writeback_control;
|
2021-11-29 10:22:01 +00:00
|
|
|
#if defined(CONFIG_BLOCK) && defined(CONFIG_FS_DAX)
|
2021-11-29 10:21:38 +00:00
|
|
|
int dax_add_host(struct dax_device *dax_dev, struct gendisk *disk);
|
|
|
|
void dax_remove_host(struct gendisk *disk);
|
dax: introduce holder for dax_device
Patch series "v14 fsdax-rmap + v11 fsdax-reflink", v2.
The patchset fsdax-rmap is aimed to support shared pages tracking for
fsdax.
It moves owner tracking from dax_assocaite_entry() to pmem device driver,
by introducing an interface ->memory_failure() for struct pagemap. This
interface is called by memory_failure() in mm, and implemented by pmem
device.
Then call holder operations to find the filesystem which the corrupted
data located in, and call filesystem handler to track files or metadata
associated with this page.
Finally we are able to try to fix the corrupted data in filesystem and do
other necessary processing, such as killing processes who are using the
files affected.
The call trace is like this:
memory_failure()
|* fsdax case
|------------
|pgmap->ops->memory_failure() => pmem_pgmap_memory_failure()
| dax_holder_notify_failure() =>
| dax_device->holder_ops->notify_failure() =>
| - xfs_dax_notify_failure()
| |* xfs_dax_notify_failure()
| |--------------------------
| | xfs_rmap_query_range()
| | xfs_dax_failure_fn()
| | * corrupted on metadata
| | try to recover data, call xfs_force_shutdown()
| | * corrupted on file data
| | try to recover data, call mf_dax_kill_procs()
|* normal case
|-------------
|mf_generic_kill_procs()
The patchset fsdax-reflink attempts to add CoW support for fsdax, and
takes XFS, which has both reflink and fsdax features, as an example.
One of the key mechanisms needed to be implemented in fsdax is CoW. Copy
the data from srcmap before we actually write data to the destination
iomap. And we just copy range in which data won't be changed.
Another mechanism is range comparison. In page cache case, readpage() is
used to load data on disk to page cache in order to be able to compare
data. In fsdax case, readpage() does not work. So, we need another
compare data with direct access support.
With the two mechanisms implemented in fsdax, we are able to make reflink
and fsdax work together in XFS.
This patch (of 14):
To easily track filesystem from a pmem device, we introduce a holder for
dax_device structure, and also its operation. This holder is used to
remember who is using this dax_device:
- When it is the backend of a filesystem, the holder will be the
instance of this filesystem.
- When this pmem device is one of the targets in a mapped device, the
holder will be this mapped device. In this case, the mapped device
has its own dax_device and it will follow the first rule. So that we
can finally track to the filesystem we needed.
The holder and holder_ops will be set when filesystem is being mounted,
or an target device is being activated.
Link: https://lkml.kernel.org/r/20220603053738.1218681-1-ruansy.fnst@fujitsu.com
Link: https://lkml.kernel.org/r/20220603053738.1218681-2-ruansy.fnst@fujitsu.com
Signed-off-by: Shiyang Ruan <ruansy.fnst@fujitsu.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dan Williams <dan.j.wiliams@intel.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Cc: Dave Chinner <david@fromorbit.com>
Cc: Jane Chu <jane.chu@oracle.com>
Cc: Goldwyn Rodrigues <rgoldwyn@suse.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Naoya Horiguchi <naoya.horiguchi@nec.com>
Cc: Miaohe Lin <linmiaohe@huawei.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Goldwyn Rodrigues <rgoldwyn@suse.com>
Cc: Ritesh Harjani <riteshh@linux.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2022-06-03 05:37:25 +00:00
|
|
|
struct dax_device *fs_dax_get_by_bdev(struct block_device *bdev, u64 *start_off,
|
|
|
|
void *holder, const struct dax_holder_operations *ops);
|
|
|
|
void fs_put_dax(struct dax_device *dax_dev, void *holder);
|
2017-05-08 17:55:27 +00:00
|
|
|
#else
|
2021-11-29 10:21:38 +00:00
|
|
|
static inline int dax_add_host(struct dax_device *dax_dev, struct gendisk *disk)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
static inline void dax_remove_host(struct gendisk *disk)
|
|
|
|
{
|
|
|
|
}
|
2021-11-29 10:21:59 +00:00
|
|
|
static inline struct dax_device *fs_dax_get_by_bdev(struct block_device *bdev,
|
dax: introduce holder for dax_device
Patch series "v14 fsdax-rmap + v11 fsdax-reflink", v2.
The patchset fsdax-rmap is aimed to support shared pages tracking for
fsdax.
It moves owner tracking from dax_assocaite_entry() to pmem device driver,
by introducing an interface ->memory_failure() for struct pagemap. This
interface is called by memory_failure() in mm, and implemented by pmem
device.
Then call holder operations to find the filesystem which the corrupted
data located in, and call filesystem handler to track files or metadata
associated with this page.
Finally we are able to try to fix the corrupted data in filesystem and do
other necessary processing, such as killing processes who are using the
files affected.
The call trace is like this:
memory_failure()
|* fsdax case
|------------
|pgmap->ops->memory_failure() => pmem_pgmap_memory_failure()
| dax_holder_notify_failure() =>
| dax_device->holder_ops->notify_failure() =>
| - xfs_dax_notify_failure()
| |* xfs_dax_notify_failure()
| |--------------------------
| | xfs_rmap_query_range()
| | xfs_dax_failure_fn()
| | * corrupted on metadata
| | try to recover data, call xfs_force_shutdown()
| | * corrupted on file data
| | try to recover data, call mf_dax_kill_procs()
|* normal case
|-------------
|mf_generic_kill_procs()
The patchset fsdax-reflink attempts to add CoW support for fsdax, and
takes XFS, which has both reflink and fsdax features, as an example.
One of the key mechanisms needed to be implemented in fsdax is CoW. Copy
the data from srcmap before we actually write data to the destination
iomap. And we just copy range in which data won't be changed.
Another mechanism is range comparison. In page cache case, readpage() is
used to load data on disk to page cache in order to be able to compare
data. In fsdax case, readpage() does not work. So, we need another
compare data with direct access support.
With the two mechanisms implemented in fsdax, we are able to make reflink
and fsdax work together in XFS.
This patch (of 14):
To easily track filesystem from a pmem device, we introduce a holder for
dax_device structure, and also its operation. This holder is used to
remember who is using this dax_device:
- When it is the backend of a filesystem, the holder will be the
instance of this filesystem.
- When this pmem device is one of the targets in a mapped device, the
holder will be this mapped device. In this case, the mapped device
has its own dax_device and it will follow the first rule. So that we
can finally track to the filesystem we needed.
The holder and holder_ops will be set when filesystem is being mounted,
or an target device is being activated.
Link: https://lkml.kernel.org/r/20220603053738.1218681-1-ruansy.fnst@fujitsu.com
Link: https://lkml.kernel.org/r/20220603053738.1218681-2-ruansy.fnst@fujitsu.com
Signed-off-by: Shiyang Ruan <ruansy.fnst@fujitsu.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dan Williams <dan.j.wiliams@intel.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Cc: Dave Chinner <david@fromorbit.com>
Cc: Jane Chu <jane.chu@oracle.com>
Cc: Goldwyn Rodrigues <rgoldwyn@suse.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Naoya Horiguchi <naoya.horiguchi@nec.com>
Cc: Miaohe Lin <linmiaohe@huawei.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Goldwyn Rodrigues <rgoldwyn@suse.com>
Cc: Ritesh Harjani <riteshh@linux.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2022-06-03 05:37:25 +00:00
|
|
|
u64 *start_off, void *holder,
|
|
|
|
const struct dax_holder_operations *ops)
|
2017-08-30 16:16:38 +00:00
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
dax: introduce holder for dax_device
Patch series "v14 fsdax-rmap + v11 fsdax-reflink", v2.
The patchset fsdax-rmap is aimed to support shared pages tracking for
fsdax.
It moves owner tracking from dax_assocaite_entry() to pmem device driver,
by introducing an interface ->memory_failure() for struct pagemap. This
interface is called by memory_failure() in mm, and implemented by pmem
device.
Then call holder operations to find the filesystem which the corrupted
data located in, and call filesystem handler to track files or metadata
associated with this page.
Finally we are able to try to fix the corrupted data in filesystem and do
other necessary processing, such as killing processes who are using the
files affected.
The call trace is like this:
memory_failure()
|* fsdax case
|------------
|pgmap->ops->memory_failure() => pmem_pgmap_memory_failure()
| dax_holder_notify_failure() =>
| dax_device->holder_ops->notify_failure() =>
| - xfs_dax_notify_failure()
| |* xfs_dax_notify_failure()
| |--------------------------
| | xfs_rmap_query_range()
| | xfs_dax_failure_fn()
| | * corrupted on metadata
| | try to recover data, call xfs_force_shutdown()
| | * corrupted on file data
| | try to recover data, call mf_dax_kill_procs()
|* normal case
|-------------
|mf_generic_kill_procs()
The patchset fsdax-reflink attempts to add CoW support for fsdax, and
takes XFS, which has both reflink and fsdax features, as an example.
One of the key mechanisms needed to be implemented in fsdax is CoW. Copy
the data from srcmap before we actually write data to the destination
iomap. And we just copy range in which data won't be changed.
Another mechanism is range comparison. In page cache case, readpage() is
used to load data on disk to page cache in order to be able to compare
data. In fsdax case, readpage() does not work. So, we need another
compare data with direct access support.
With the two mechanisms implemented in fsdax, we are able to make reflink
and fsdax work together in XFS.
This patch (of 14):
To easily track filesystem from a pmem device, we introduce a holder for
dax_device structure, and also its operation. This holder is used to
remember who is using this dax_device:
- When it is the backend of a filesystem, the holder will be the
instance of this filesystem.
- When this pmem device is one of the targets in a mapped device, the
holder will be this mapped device. In this case, the mapped device
has its own dax_device and it will follow the first rule. So that we
can finally track to the filesystem we needed.
The holder and holder_ops will be set when filesystem is being mounted,
or an target device is being activated.
Link: https://lkml.kernel.org/r/20220603053738.1218681-1-ruansy.fnst@fujitsu.com
Link: https://lkml.kernel.org/r/20220603053738.1218681-2-ruansy.fnst@fujitsu.com
Signed-off-by: Shiyang Ruan <ruansy.fnst@fujitsu.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dan Williams <dan.j.wiliams@intel.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Cc: Dave Chinner <david@fromorbit.com>
Cc: Jane Chu <jane.chu@oracle.com>
Cc: Goldwyn Rodrigues <rgoldwyn@suse.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Naoya Horiguchi <naoya.horiguchi@nec.com>
Cc: Miaohe Lin <linmiaohe@huawei.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Goldwyn Rodrigues <rgoldwyn@suse.com>
Cc: Ritesh Harjani <riteshh@linux.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2022-06-03 05:37:25 +00:00
|
|
|
static inline void fs_put_dax(struct dax_device *dax_dev, void *holder)
|
2021-11-29 10:22:01 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
#endif /* CONFIG_BLOCK && CONFIG_FS_DAX */
|
2018-03-07 23:26:44 +00:00
|
|
|
|
2021-11-29 10:22:01 +00:00
|
|
|
#if IS_ENABLED(CONFIG_FS_DAX)
|
|
|
|
int dax_writeback_mapping_range(struct address_space *mapping,
|
|
|
|
struct dax_device *dax_dev, struct writeback_control *wbc);
|
|
|
|
|
|
|
|
struct page *dax_layout_busy_page(struct address_space *mapping);
|
|
|
|
struct page *dax_layout_busy_page_range(struct address_space *mapping, loff_t start, loff_t end);
|
|
|
|
dax_entry_t dax_lock_page(struct page *page);
|
|
|
|
void dax_unlock_page(struct page *page, dax_entry_t cookie);
|
2022-06-03 05:37:28 +00:00
|
|
|
dax_entry_t dax_lock_mapping_entry(struct address_space *mapping,
|
|
|
|
unsigned long index, struct page **page);
|
|
|
|
void dax_unlock_mapping_entry(struct address_space *mapping,
|
|
|
|
unsigned long index, dax_entry_t cookie);
|
2021-11-29 10:22:01 +00:00
|
|
|
#else
|
mm, fs, dax: handle layout changes to pinned dax mappings
Background:
get_user_pages() in the filesystem pins file backed memory pages for
access by devices performing dma. However, it only pins the memory pages
not the page-to-file offset association. If a file is truncated the
pages are mapped out of the file and dma may continue indefinitely into
a page that is owned by a device driver. This breaks coherency of the
file vs dma, but the assumption is that if userspace wants the
file-space truncated it does not matter what data is inbound from the
device, it is not relevant anymore. The only expectation is that dma can
safely continue while the filesystem reallocates the block(s).
Problem:
This expectation that dma can safely continue while the filesystem
changes the block map is broken by dax. With dax the target dma page
*is* the filesystem block. The model of leaving the page pinned for dma,
but truncating the file block out of the file, means that the filesytem
is free to reallocate a block under active dma to another file and now
the expected data-incoherency situation has turned into active
data-corruption.
Solution:
Defer all filesystem operations (fallocate(), truncate()) on a dax mode
file while any page/block in the file is under active dma. This solution
assumes that dma is transient. Cases where dma operations are known to
not be transient, like RDMA, have been explicitly disabled via
commits like 5f1d43de5416 "IB/core: disable memory registration of
filesystem-dax vmas".
The dax_layout_busy_page() routine is called by filesystems with a lock
held against mm faults (i_mmap_lock) to find pinned / busy dax pages.
The process of looking up a busy page invalidates all mappings
to trigger any subsequent get_user_pages() to block on i_mmap_lock.
The filesystem continues to call dax_layout_busy_page() until it finally
returns no more active pages. This approach assumes that the page
pinning is transient, if that assumption is violated the system would
have likely hung from the uncompleted I/O.
Cc: Jeff Moyer <jmoyer@redhat.com>
Cc: Dave Chinner <david@fromorbit.com>
Cc: Matthew Wilcox <mawilcox@microsoft.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Reported-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2018-03-10 01:44:31 +00:00
|
|
|
static inline struct page *dax_layout_busy_page(struct address_space *mapping)
|
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2020-03-03 19:58:21 +00:00
|
|
|
static inline struct page *dax_layout_busy_page_range(struct address_space *mapping, pgoff_t start, pgoff_t nr_pages)
|
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2018-03-07 23:26:44 +00:00
|
|
|
static inline int dax_writeback_mapping_range(struct address_space *mapping,
|
2020-01-03 18:33:07 +00:00
|
|
|
struct dax_device *dax_dev, struct writeback_control *wbc)
|
2018-03-07 23:26:44 +00:00
|
|
|
{
|
|
|
|
return -EOPNOTSUPP;
|
|
|
|
}
|
2018-07-14 04:50:16 +00:00
|
|
|
|
2018-11-30 16:05:06 +00:00
|
|
|
static inline dax_entry_t dax_lock_page(struct page *page)
|
2018-07-14 04:50:16 +00:00
|
|
|
{
|
|
|
|
if (IS_DAX(page->mapping->host))
|
2018-11-30 16:05:06 +00:00
|
|
|
return ~0UL;
|
|
|
|
return 0;
|
2018-07-14 04:50:16 +00:00
|
|
|
}
|
|
|
|
|
2018-11-30 16:05:06 +00:00
|
|
|
static inline void dax_unlock_page(struct page *page, dax_entry_t cookie)
|
2018-07-14 04:50:16 +00:00
|
|
|
{
|
|
|
|
}
|
2022-06-03 05:37:28 +00:00
|
|
|
|
|
|
|
static inline dax_entry_t dax_lock_mapping_entry(struct address_space *mapping,
|
|
|
|
unsigned long index, struct page **page)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void dax_unlock_mapping_entry(struct address_space *mapping,
|
|
|
|
unsigned long index, dax_entry_t cookie)
|
|
|
|
{
|
|
|
|
}
|
2017-05-08 17:55:27 +00:00
|
|
|
#endif
|
|
|
|
|
2021-11-29 10:21:52 +00:00
|
|
|
int dax_zero_range(struct inode *inode, loff_t pos, loff_t len, bool *did_zero,
|
|
|
|
const struct iomap_ops *ops);
|
|
|
|
int dax_truncate_page(struct inode *inode, loff_t pos, bool *did_zero,
|
|
|
|
const struct iomap_ops *ops);
|
|
|
|
|
2020-09-20 15:54:42 +00:00
|
|
|
#if IS_ENABLED(CONFIG_DAX)
|
2017-04-11 16:49:49 +00:00
|
|
|
int dax_read_lock(void);
|
|
|
|
void dax_read_unlock(int id);
|
2020-09-20 15:54:42 +00:00
|
|
|
#else
|
|
|
|
static inline int dax_read_lock(void)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void dax_read_unlock(int id)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
#endif /* CONFIG_DAX */
|
2017-01-25 07:02:09 +00:00
|
|
|
bool dax_alive(struct dax_device *dax_dev);
|
|
|
|
void *dax_get_private(struct dax_device *dax_dev);
|
2017-01-27 04:37:35 +00:00
|
|
|
long dax_direct_access(struct dax_device *dax_dev, pgoff_t pgoff, long nr_pages,
|
2022-05-13 22:10:58 +00:00
|
|
|
enum dax_access_mode mode, void **kaddr, pfn_t *pfn);
|
2017-05-29 19:57:56 +00:00
|
|
|
size_t dax_copy_from_iter(struct dax_device *dax_dev, pgoff_t pgoff, void *addr,
|
|
|
|
size_t bytes, struct iov_iter *i);
|
2018-05-02 13:46:33 +00:00
|
|
|
size_t dax_copy_to_iter(struct dax_device *dax_dev, pgoff_t pgoff, void *addr,
|
|
|
|
size_t bytes, struct iov_iter *i);
|
2020-02-28 16:34:52 +00:00
|
|
|
int dax_zero_page_range(struct dax_device *dax_dev, pgoff_t pgoff,
|
|
|
|
size_t nr_pages);
|
dax: introduce holder for dax_device
Patch series "v14 fsdax-rmap + v11 fsdax-reflink", v2.
The patchset fsdax-rmap is aimed to support shared pages tracking for
fsdax.
It moves owner tracking from dax_assocaite_entry() to pmem device driver,
by introducing an interface ->memory_failure() for struct pagemap. This
interface is called by memory_failure() in mm, and implemented by pmem
device.
Then call holder operations to find the filesystem which the corrupted
data located in, and call filesystem handler to track files or metadata
associated with this page.
Finally we are able to try to fix the corrupted data in filesystem and do
other necessary processing, such as killing processes who are using the
files affected.
The call trace is like this:
memory_failure()
|* fsdax case
|------------
|pgmap->ops->memory_failure() => pmem_pgmap_memory_failure()
| dax_holder_notify_failure() =>
| dax_device->holder_ops->notify_failure() =>
| - xfs_dax_notify_failure()
| |* xfs_dax_notify_failure()
| |--------------------------
| | xfs_rmap_query_range()
| | xfs_dax_failure_fn()
| | * corrupted on metadata
| | try to recover data, call xfs_force_shutdown()
| | * corrupted on file data
| | try to recover data, call mf_dax_kill_procs()
|* normal case
|-------------
|mf_generic_kill_procs()
The patchset fsdax-reflink attempts to add CoW support for fsdax, and
takes XFS, which has both reflink and fsdax features, as an example.
One of the key mechanisms needed to be implemented in fsdax is CoW. Copy
the data from srcmap before we actually write data to the destination
iomap. And we just copy range in which data won't be changed.
Another mechanism is range comparison. In page cache case, readpage() is
used to load data on disk to page cache in order to be able to compare
data. In fsdax case, readpage() does not work. So, we need another
compare data with direct access support.
With the two mechanisms implemented in fsdax, we are able to make reflink
and fsdax work together in XFS.
This patch (of 14):
To easily track filesystem from a pmem device, we introduce a holder for
dax_device structure, and also its operation. This holder is used to
remember who is using this dax_device:
- When it is the backend of a filesystem, the holder will be the
instance of this filesystem.
- When this pmem device is one of the targets in a mapped device, the
holder will be this mapped device. In this case, the mapped device
has its own dax_device and it will follow the first rule. So that we
can finally track to the filesystem we needed.
The holder and holder_ops will be set when filesystem is being mounted,
or an target device is being activated.
Link: https://lkml.kernel.org/r/20220603053738.1218681-1-ruansy.fnst@fujitsu.com
Link: https://lkml.kernel.org/r/20220603053738.1218681-2-ruansy.fnst@fujitsu.com
Signed-off-by: Shiyang Ruan <ruansy.fnst@fujitsu.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dan Williams <dan.j.wiliams@intel.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Cc: Dave Chinner <david@fromorbit.com>
Cc: Jane Chu <jane.chu@oracle.com>
Cc: Goldwyn Rodrigues <rgoldwyn@suse.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Naoya Horiguchi <naoya.horiguchi@nec.com>
Cc: Miaohe Lin <linmiaohe@huawei.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Goldwyn Rodrigues <rgoldwyn@suse.com>
Cc: Ritesh Harjani <riteshh@linux.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2022-06-03 05:37:25 +00:00
|
|
|
int dax_holder_notify_failure(struct dax_device *dax_dev, u64 off, u64 len,
|
|
|
|
int mf_flags);
|
2017-09-01 01:47:43 +00:00
|
|
|
void dax_flush(struct dax_device *dax_dev, void *addr, size_t size);
|
2017-04-11 16:49:49 +00:00
|
|
|
|
2016-11-08 00:32:46 +00:00
|
|
|
ssize_t dax_iomap_rw(struct kiocb *iocb, struct iov_iter *iter,
|
2017-01-28 07:20:26 +00:00
|
|
|
const struct iomap_ops *ops);
|
2018-06-28 06:26:17 +00:00
|
|
|
vm_fault_t dax_iomap_fault(struct vm_fault *vmf, enum page_entry_size pe_size,
|
2018-01-07 21:38:43 +00:00
|
|
|
pfn_t *pfnp, int *errp, const struct iomap_ops *ops);
|
2018-06-08 00:04:29 +00:00
|
|
|
vm_fault_t dax_finish_sync_fault(struct vm_fault *vmf,
|
|
|
|
enum page_entry_size pe_size, pfn_t pfn);
|
2016-05-12 16:29:18 +00:00
|
|
|
int dax_delete_mapping_entry(struct address_space *mapping, pgoff_t index);
|
2016-08-10 15:22:44 +00:00
|
|
|
int dax_invalidate_mapping_entry_sync(struct address_space *mapping,
|
|
|
|
pgoff_t index);
|
2016-01-22 23:10:40 +00:00
|
|
|
static inline bool dax_mapping(struct address_space *mapping)
|
|
|
|
{
|
|
|
|
return mapping->host && IS_DAX(mapping->host);
|
|
|
|
}
|
2016-02-26 23:19:55 +00:00
|
|
|
|
2020-10-13 23:49:13 +00:00
|
|
|
#ifdef CONFIG_DEV_DAX_HMEM_DEVICES
|
|
|
|
void hmem_register_device(int target_nid, struct resource *r);
|
|
|
|
#else
|
|
|
|
static inline void hmem_register_device(int target_nid, struct resource *r)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2015-09-08 21:58:40 +00:00
|
|
|
#endif
|