Re: [PATCH v2 24/30] xfs: scrub directory metadata

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

 



On Mon, Oct 16, 2017 at 05:14:33PM -0700, Darrick J. Wong wrote:
> Scrub the hash tree and all the entries in a directory.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx>
> ---
> v2: use helpers to extract DT_ codes, #define buffer size magic numbers
> ---
....
> diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h
> index e0792d0..0ae0b92 100644
> --- a/fs/xfs/xfs_mount.h
> +++ b/fs/xfs/xfs_mount.h
> @@ -446,4 +446,21 @@ int	xfs_zero_extent(struct xfs_inode *ip, xfs_fsblock_t start_fsb,
>  struct xfs_error_cfg * xfs_error_get_cfg(struct xfs_mount *mp,
>  		int error_class, int error);
>  
> +/*
> + * The Linux API doesn't pass down the total size of the buffer
> + * we read into down to the filesystem.  With the filldir concept
> + * it's not needed for correct information, but the XFS dir2 leaf
> + * code wants an estimate of the buffer size to calculate it's
> + * readahead window and size the buffers used for mapping to
> + * physical blocks.
> + *
> + * Try to give it an estimate that's good enough, maybe at some
> + * point we can change the ->readdir prototype to include the
> + * buffer size.  For now we use the current glibc buffer size.
> + * musl libc hardcodes 2k and dietlibc uses PAGE_SIZE.
> + */
> +#define XFS_READDIR_BUFSIZE	(32768)
> +
> +unsigned char xfs_dir3_get_dtype(struct xfs_mount *mp, uint8_t filetype);
> +
>  #endif	/* __XFS_MOUNT_H__ */

I think these belong in xfs_dir2.h, next to the declaration of
xfs_mode_to_ftype()....

Other than that,

Reviewed-by: Dave Chinner <dchinner@xxxxxxxxxx>

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx
--
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