From 0c1d6bf173a51afd708e6b45d66b2f5655778206 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Fri, 15 Nov 2019 17:16:23 -0500 Subject: [PATCH] xfs: add a xfs_valid_startblock helper Source kernel commit: eb77b23b565e7e1d2cc3a7d9e4cc186fb54e81a8 Add a helper that validates the startblock is valid. This checks for a non-zero block on the main device, but skips that check for blocks on the realtime device. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong Signed-off-by: Eric Sandeen br_startblock); } +/* + * Check the mapping for obviously garbage allocations that could trash the + * filesystem immediately. + */ +#define xfs_valid_startblock(ip, startblock) \ + ((startblock) != 0 || XFS_IS_REALTIME_INODE(ip)) + void xfs_trim_extent(struct xfs_bmbt_irec *irec, xfs_fileoff_t bno, xfs_filblks_t len); int xfs_bmap_add_attrfork(struct xfs_inode *ip, int size, int rsvd); -- 2.50.1