def _get_obj_location(ds, srcfile, hash_str):
    """Determine the location of a metadata object in a dataset's object store

    Parameters
    ----------
    ds : Dataset
      The reference dataset whose store shall be used.
    srcfile : Path
      The path of the object's sourcefile (to determine the correct
      file extension.
    hash_str : str
      The hash the object should be stored under.

    Returns
    -------
    Path
      pathlib Path instance to the absolute location for the metadata object
    """
    objpath = ds.pathobj / '.datalad' / 'metadata' / 'objects' / hash_str[:2
        ] / (hash_str[2:] + srcfile.suffix)
    return objpath
