From: Christoph Hellwig <hch@infradead.org>
To: Shiyang Ruan <ruansy.fnst@fujitsu.com>
Cc: linux-kernel@vger.kernel.org, linux-xfs@vger.kernel.org,
nvdimm@lists.linux.dev, linux-mm@kvack.org,
linux-fsdevel@vger.kernel.org, djwong@kernel.org,
dan.j.williams@intel.com, david@fromorbit.com, hch@infradead.org,
jane.chu@oracle.com
Subject: Re: [PATCH v8 8/9] xfs: Implement ->notify_failure() for XFS
Date: Tue, 14 Dec 2021 07:54:05 -0800 [thread overview]
Message-ID: <Ybi+HYoI2i3dVToz@infradead.org> (raw)
In-Reply-To: <20211202084856.1285285-9-ruansy.fnst@fujitsu.com>
> + // TODO check and try to fix metadata
Please avoid //-style comments.
> +static u64
> +xfs_dax_ddev_offset(
> + struct xfs_mount *mp,
> + struct dax_device *dax_dev,
> + u64 disk_offset)
> +{
> + xfs_buftarg_t *targp;
> +
> + if (mp->m_ddev_targp->bt_daxdev == dax_dev)
> + targp = mp->m_ddev_targp;
> + else if (mp->m_logdev_targp->bt_daxdev == dax_dev)
> + targp = mp->m_logdev_targp;
> + else
> + targp = mp->m_rtdev_targp;
> +
> + return disk_offset - targp->bt_dax_part_off;
This is only called for the data device. So I think we can simplify
this and open code the logic in xfs_dax_notify_ddev_failure.
> +void
> +xfs_notify_failure_register(
> + struct xfs_mount *mp,
> + struct dax_device *dax_dev)
> +{
> + if (dax_dev && !fs_dax_get_holder(dax_dev))
> + fs_dax_register_holder(dax_dev, mp, &xfs_dax_holder_operations);
> +}
> +
> +void
> +xfs_notify_failure_unregister(
> + struct dax_device *dax_dev)
> +{
> + if (dax_dev)
> + fs_dax_unregister_holder(dax_dev);
> +}
Why do we need these wrappers? Also instead of the fs_dax_get_holder
here, fs_dax_register_holder needs to return an error if there already
is a holder.
next prev parent reply other threads:[~2021-12-14 15:54 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-02 8:48 [RESEND PATCH v8 0/9] fsdax: introduce fs query to support reflink Shiyang Ruan
2021-12-02 8:48 ` [PATCH v8 1/9] dax: Use percpu rwsem for dax_{read,write}_lock() Shiyang Ruan
2021-12-14 15:40 ` Christoph Hellwig
2021-12-15 2:06 ` Shiyang Ruan
2021-12-16 7:46 ` Christoph Hellwig
2021-12-02 8:48 ` [PATCH v8 2/9] dax: Introduce holder for dax_device Shiyang Ruan
2021-12-15 3:09 ` Dan Williams
2021-12-02 8:48 ` [PATCH v8 3/9] mm: factor helpers for memory_failure_dev_pagemap Shiyang Ruan
2021-12-02 8:48 ` [PATCH v8 4/9] pagemap,pmem: Introduce ->memory_failure() Shiyang Ruan
2021-12-02 8:48 ` [PATCH v8 5/9] fsdax: Introduce dax_lock_mapping_entry() Shiyang Ruan
2021-12-14 15:42 ` Christoph Hellwig
2021-12-02 8:48 ` [PATCH v8 6/9] mm: Introduce mf_dax_kill_procs() for fsdax case Shiyang Ruan
2021-12-14 15:47 ` Christoph Hellwig
2021-12-02 8:48 ` [PATCH v8 7/9] dax: add dax holder helper for filesystems Shiyang Ruan
2021-12-14 15:47 ` Christoph Hellwig
2021-12-15 2:21 ` Shiyang Ruan
2021-12-16 7:46 ` Christoph Hellwig
2021-12-02 8:48 ` [PATCH v8 8/9] xfs: Implement ->notify_failure() for XFS Shiyang Ruan
2021-12-14 15:54 ` Christoph Hellwig [this message]
2021-12-14 16:01 ` Darrick J. Wong
2021-12-02 8:48 ` [PATCH v8 9/9] fsdax: set a CoW flag when associate reflink mappings Shiyang Ruan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Ybi+HYoI2i3dVToz@infradead.org \
--to=hch@infradead.org \
--cc=dan.j.williams@intel.com \
--cc=david@fromorbit.com \
--cc=djwong@kernel.org \
--cc=jane.chu@oracle.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-xfs@vger.kernel.org \
--cc=nvdimm@lists.linux.dev \
--cc=ruansy.fnst@fujitsu.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.