lkml.org 
[lkml]   [2021]   [Dec]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v8 8/9] xfs: Implement ->notify_failure() for XFS
> +		// 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.

\
 
 \ /
  Last update: 2021-12-14 16:55    [W:0.067 / U:0.596 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site