Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

xfs: add a xfs_rtgroup_raw_size helper

Add a helper to figure the on-disk size of a group, accounting for the
XFS_SB_FEAT_INCOMPAT_ZONE_GAPS feature if needed.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>

authored by

Christoph Hellwig and committed by
Carlos Maiolino
fc633b5c 41263267

+15
+15
fs/xfs/libxfs/xfs_rtgroup.h
··· 371 371 return xfs_groups_to_rfsbs(mp, nr_groups, XG_TYPE_RTG); 372 372 } 373 373 374 + /* 375 + * Return the "raw" size of a group on the hardware device. This includes the 376 + * daddr gaps present for XFS_SB_FEAT_INCOMPAT_ZONE_GAPS file systems. 377 + */ 378 + static inline xfs_rgblock_t 379 + xfs_rtgroup_raw_size( 380 + struct xfs_mount *mp) 381 + { 382 + struct xfs_groups *g = &mp->m_groups[XG_TYPE_RTG]; 383 + 384 + if (g->has_daddr_gaps) 385 + return 1U << g->blklog; 386 + return g->blocks; 387 + } 388 + 374 389 #endif /* __LIBXFS_RTGROUP_H */