Re: [PATCH 10/27] xfs_scrub: add file space map iteration functions

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

 



On 1/5/18 7:52 PM, Darrick J. Wong wrote:


> + * These routines provide a simple interface to query the block
> + * mappings of the fork of a given inode via GETBMAPX and call a
> + * function to iterate each mapping result.
> + */
> +
> +#define BMAP_NR		2048
> +
> +/* Iterate all the extent block mappings between the key and fork end. */
> +bool
> +xfs_iterate_filemaps(
> +	struct scrub_ctx	*ctx,
> +	const char		*descr,
> +	int			fd,
> +	int			whichfork,
> +	struct xfs_bmap		*key,

<coverity pass>

Ok key is an xfs_bmap:

/* inode fork block mapping */
struct xfs_bmap {
        uint64_t        bm_offset;      /* file offset of segment in bytes */
        uint64_t        bm_physical;    /* physical starting byte  */
        uint64_t        bm_length;      /* length of segment, bytes */
        uint32_t        bm_flags;       /* output flags */
};

> +	xfs_bmap_iter_fn	fn,
> +	void			*arg)
> +{
> +	struct fsxattr		fsx;
> +	struct getbmapx		*map
map is a getbmapx ...

struct getbmapx {
        __s64           bmv_offset;     /* file offset of segment in blocks */
        __s64           bmv_block;      /* starting block (64-bit daddr_t)  */
        __s64           bmv_length;     /* length of segment, blocks        */
        __s32           bmv_count;      /* # of entries in array incl. 1st  */
        __s32           bmv_entries;    /* # of entries filled in (output). */
        __s32           bmv_iflags;     /* input flags (1st structure)      */
        __s32           bmv_oflags;     /* output flags (after 1st structure)*/
        __s32           bmv_unused1;    /* future use                       */
        __s32           bmv_unused2;    /* future use                       */
};

...

> +out:
> +	memcpy(key, map, sizeof(struct getbmapx));

so I don't think that fits, right?


-Eric
--
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