[ndctl PATCH v2] Expose ndctl_bus_nfit_translate_spa as a public function.
by Tsaur, Erwin
The motivation is to allow access to ACPI defined NVDIMM Root Device
_DSM Function Index 5(Translate SPA). The rest of the _DSM functions,
which are mostly ARS related, are already public.
Basically move ndctl_bus_nfit_translate_spa declaration from private.h
to libndctl.h.
Changes from V1:
- Group function declaration in libndctl.h with other ndctl_bus_* functions.
Reviewed-by: Dan Williams <dan.j.williams(a)intel.com>
Reviewed-by: Verma, Vishal L <vishal.l.verma(a)intel.com>
---
ndctl/lib/libndctl.sym | 4 ++++
ndctl/lib/nfit.c | 2 +-
ndctl/lib/private.h | 2 --
ndctl/libndctl.h | 2 ++
4 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/ndctl/lib/libndctl.sym b/ndctl/lib/libndctl.sym
index 0a82616..58afb74 100644
--- a/ndctl/lib/libndctl.sym
+++ b/ndctl/lib/libndctl.sym
@@ -451,3 +451,7 @@ LIBNDCTL_25 {
ndctl_bus_clear_fw_activate_nosuspend;
ndctl_bus_activate_firmware;
} LIBNDCTL_24;
+
+LIBNDCTL_26 {
+ ndctl_bus_nfit_translate_spa;
+} LIBNDCTL_25;
diff --git a/ndctl/lib/nfit.c b/ndctl/lib/nfit.c
index 6f68fcf..d85682f 100644
--- a/ndctl/lib/nfit.c
+++ b/ndctl/lib/nfit.c
@@ -114,7 +114,7 @@ static int is_valid_spa(struct ndctl_bus *bus, unsigned long long spa)
*
* If success, returns zero, store dimm's @handle, and @dpa.
*/
-int ndctl_bus_nfit_translate_spa(struct ndctl_bus *bus,
+NDCTL_EXPORT int ndctl_bus_nfit_translate_spa(struct ndctl_bus *bus,
unsigned long long address, unsigned int *handle, unsigned long long *dpa)
{
diff --git a/ndctl/lib/private.h b/ndctl/lib/private.h
index ede1300..8f4510e 100644
--- a/ndctl/lib/private.h
+++ b/ndctl/lib/private.h
@@ -370,8 +370,6 @@ static inline int check_kmod(struct kmod_ctx *kmod_ctx)
return kmod_ctx ? 0 : -ENXIO;
}
-int ndctl_bus_nfit_translate_spa(struct ndctl_bus *bus, unsigned long long addr,
- unsigned int *handle, unsigned long long *dpa);
struct ndctl_cmd *ndctl_bus_cmd_new_err_inj(struct ndctl_bus *bus);
struct ndctl_cmd *ndctl_bus_cmd_new_err_inj_clr(struct ndctl_bus *bus);
struct ndctl_cmd *ndctl_bus_cmd_new_err_inj_stat(struct ndctl_bus *bus,
diff --git a/ndctl/libndctl.h b/ndctl/libndctl.h
index 60e1288..87d07b7 100644
--- a/ndctl/libndctl.h
+++ b/ndctl/libndctl.h
@@ -152,6 +152,8 @@ int ndctl_bus_clear_fw_activate_noidle(struct ndctl_bus *bus);
int ndctl_bus_set_fw_activate_nosuspend(struct ndctl_bus *bus);
int ndctl_bus_clear_fw_activate_nosuspend(struct ndctl_bus *bus);
int ndctl_bus_activate_firmware(struct ndctl_bus *bus, enum ndctl_fwa_method method);
+int ndctl_bus_nfit_translate_spa(struct ndctl_bus *bus, unsigned long long addr,
+ unsigned int *handle, unsigned long long *dpa);
struct ndctl_dimm;
struct ndctl_dimm *ndctl_dimm_get_first(struct ndctl_bus *bus);
--
2.30.0
1 year, 3 months
[RFC PATCH v1 0/6] badblocks improvement for multiple bad block ranges
by Coly Li
This is the first completed effort to improve badblocks code to handle
multiple ranges in bad block table.
There is neither in-memory nor on-disk format change in this series, all
existing API and data structures are consistent. This series just only
improve the code algorithm to handle more corner cases, the interfaces
are same and consistency to all existing callers (md raid and nvdimm
drivers).
The original motivation of the change is from the requirement from our
customer, that current badblocks routines don't handle multiple ranges.
For example if the bad block setting range covers multiple ranges from
bad block table, only the first two bad block ranges merged and rested
ranges are intact. The expected behavior should be all the covered
ranges to be handled.
All the patches are tested by modified user space code and the code
logic works as expected. Kernel space testing and debugging is on the
way while I am asking help for code review at the same time.
The whole change is divided into 6 patches to make the code review more
clear and easier. If people prefer, I'd like to post a single large
patch finally after the code review accomplished.
Thank you in advance for any review comment and suggestion.
Coly Li (6):
badblocks: add more helper structure and routines in badblocks.h
badblocks: add helper routines for badblock ranges handling
badblocks: improvement badblocks_set() for multiple ranges handling
badblocks: improve badblocks_clear() for multiple ranges handling
badblocks: improve badblocks_check() for multiple ranges handling
badblocks: switch to the improved badblock handling code
block/badblocks.c | 1591 ++++++++++++++++++++++++++++++-------
include/linux/badblocks.h | 32 +
2 files changed, 1332 insertions(+), 291 deletions(-)
--
2.26.2
1 year, 3 months
Re: [PATCH v2 05/10] fsdax: Replace mmap entry in case of CoW
by Christoph Hellwig
On Wed, Mar 03, 2021 at 09:41:54AM +0000, ruansy.fnst(a)fujitsu.com wrote:
>
> > >
> > > if (dirty)
> > > __mark_inode_dirty(mapping->host, I_DIRTY_PAGES);
> >
> > I still think the __mark_inode_dirty should just be moved into the one
> > caller that needs it.
>
> I found that the dirty flag will be used in the next few lines, so I keep
> this function inside. If I move it outside, the drity flag should be passed
> in as well.
>
> @@ -774,6 +780,9 @@ static void *dax_insert_entry(struct xa_state *xas,
> if (dirty)
> xas_set_mark(xas, PAGECACHE_TAG_DIRTY);
>
> + if (cow)
> + xas_set_mark(xas, PAGECACHE_TAG_TOWRITE);
> +
> xas_unlock_irq(xas);
> return entry;
> }
>
>
> So, may I ask what's your purpose for doing in that way?
Oh, true. We can't just move that out as the xas needs to stay
locked.
1 year, 3 months
[PATCH] dax-device: Switch to using the new API kobj_to_dev()
by Jiapeng Chong
Fix the following coccicheck warnings:
./drivers/dax/bus.c:489:60-61: WARNING opportunity for kobj_to_dev().
./drivers/dax/bus.c:1218:60-61: WARNING opportunity for kobj_to_dev().
Reported-by: Abaci Robot <abaci(a)linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong(a)linux.alibaba.com>
---
drivers/dax/bus.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/dax/bus.c b/drivers/dax/bus.c
index 452e85a..37d7cc6 100644
--- a/drivers/dax/bus.c
+++ b/drivers/dax/bus.c
@@ -486,7 +486,7 @@ static ssize_t delete_store(struct device *dev, struct device_attribute *attr,
static umode_t dax_region_visible(struct kobject *kobj, struct attribute *a,
int n)
{
- struct device *dev = container_of(kobj, struct device, kobj);
+ struct device *dev = kobj_to_dev(kobj);
struct dax_region *dax_region = dev_get_drvdata(dev);
if (is_static(dax_region))
@@ -1215,7 +1215,7 @@ static ssize_t numa_node_show(struct device *dev,
static umode_t dev_dax_visible(struct kobject *kobj, struct attribute *a, int n)
{
- struct device *dev = container_of(kobj, struct device, kobj);
+ struct device *dev = kobj_to_dev(kobj);
struct dev_dax *dev_dax = to_dev_dax(dev);
struct dax_region *dax_region = dev_dax->region;
--
1.8.3.1
1 year, 3 months