Re: [PATCH v2 26/27] xfsprogs: implement the upper half of parent pointers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Jun 10, 2018 at 8:07 AM, Allison Henderson
<allison.henderson@xxxxxxxxxx> wrote:
> From: "Darrick J. Wong" <darrick.wong@xxxxxxxxxx>
>
> Add ioctl definitions to libxfs, build the necessary helpers into
> libfrog and libhandle to iterate parents (and parent paths), then wire
> up xfs_scrub to be able to query parent pointers from userspace.  The
> goal of this patch is to exercise userspace, and is nowhere near a
> complete solution.  A basic xfs_io parent command implementation
> replaces ... whatever that is that's there now.
>
> Totally missing: actual support in libxfs for working with parent ptrs
> straight off the disk (mkfs, xfs_db, xfs_repair).
>
> [achender: Minor syntax adjustments to sew solution in actual support
>            in libxfs for working with parent ptrs]
>
> Signed-off-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx>
> Signed-off-by: Allison Henderson <allison.henderson@xxxxxxxxxx>
> ---

While I'm going through unmodified code, a nit picking comment to
Darrick:

> +
> +/* Construct a description for an inode. */
> +void
> +xfs_scrub_ino_descr(
> +       struct scrub_ctx        *ctx,
> +       struct xfs_handle       *handle,
> +       char                    *buf,
> +       size_t                  buflen)
> +{
> +       uint64_t                ino;
> +       xfs_agnumber_t          agno;
> +       xfs_agino_t             agino;
> +       int                     ret;
> +
> +       ret = handle_to_path(handle, sizeof(struct xfs_handle), buf, buflen);
> +       if (ret >= 0)
> +               return;
> +
> +       ino = handle->ha_fid.fid_ino;
> +       agno = ino / (1ULL << (ctx->inopblog + ctx->agblklog));
> +       agino = ino % (1ULL << (ctx->inopblog + ctx->agblklog));
> +       snprintf(buf, buflen, _("inode %"PRIu64" (%u/%u)"), ino, agno,
> +                       agino);
> +}
> +

If we are not using XFS_INO_ macros, at lease let's keep the aritmetic
consistent with the arithmetic used by the macros?

Thanks,
Amir.
--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux