Skip to content

Commit 183d988

Browse files
Christoph Hellwigcmaiolino
authored andcommitted
xfs: constify feature checks
They will eventually be needed to be const for zoned growfs, but even now having such simpler helpers as const as possible is a good thing. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Darrick J. Wong <[email protected]> Reviewed-by: Carlos Maiolino <[email protected]> Signed-off-by: Carlos Maiolino <[email protected]>
1 parent dd324cb commit 183d988

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

fs/xfs/libxfs/xfs_rtgroup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ struct xfs_rtginode_ops {
338338
unsigned int fmt_mask; /* all valid data fork formats */
339339

340340
/* Does the fs have this feature? */
341-
bool (*enabled)(struct xfs_mount *mp);
341+
bool (*enabled)(const struct xfs_mount *mp);
342342

343343
/* Create this rtgroup metadata inode and initialize it. */
344344
int (*create)(struct xfs_rtgroup *rtg,

fs/xfs/scrub/scrub.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ struct xchk_meta_ops {
9696
int (*repair_eval)(struct xfs_scrub *sc);
9797

9898
/* Decide if we even have this piece of metadata. */
99-
bool (*has)(struct xfs_mount *);
99+
bool (*has)(const struct xfs_mount *);
100100

101101
/* type describing required/allowed inputs */
102102
enum xchk_type type;

fs/xfs/xfs_mount.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ typedef struct xfs_mount {
357357
#define XFS_FEAT_NOUUID (1ULL << 63) /* ignore uuid during mount */
358358

359359
#define __XFS_HAS_FEAT(name, NAME) \
360-
static inline bool xfs_has_ ## name (struct xfs_mount *mp) \
360+
static inline bool xfs_has_ ## name (const struct xfs_mount *mp) \
361361
{ \
362362
return mp->m_features & XFS_FEAT_ ## NAME; \
363363
}
@@ -393,25 +393,25 @@ __XFS_HAS_FEAT(large_extent_counts, NREXT64)
393393
__XFS_HAS_FEAT(exchange_range, EXCHANGE_RANGE)
394394
__XFS_HAS_FEAT(metadir, METADIR)
395395

396-
static inline bool xfs_has_rtgroups(struct xfs_mount *mp)
396+
static inline bool xfs_has_rtgroups(const struct xfs_mount *mp)
397397
{
398398
/* all metadir file systems also allow rtgroups */
399399
return xfs_has_metadir(mp);
400400
}
401401

402-
static inline bool xfs_has_rtsb(struct xfs_mount *mp)
402+
static inline bool xfs_has_rtsb(const struct xfs_mount *mp)
403403
{
404404
/* all rtgroups filesystems with an rt section have an rtsb */
405405
return xfs_has_rtgroups(mp) && xfs_has_realtime(mp);
406406
}
407407

408-
static inline bool xfs_has_rtrmapbt(struct xfs_mount *mp)
408+
static inline bool xfs_has_rtrmapbt(const struct xfs_mount *mp)
409409
{
410410
return xfs_has_rtgroups(mp) && xfs_has_realtime(mp) &&
411411
xfs_has_rmapbt(mp);
412412
}
413413

414-
static inline bool xfs_has_rtreflink(struct xfs_mount *mp)
414+
static inline bool xfs_has_rtreflink(const struct xfs_mount *mp)
415415
{
416416
return xfs_has_metadir(mp) && xfs_has_realtime(mp) &&
417417
xfs_has_reflink(mp);

0 commit comments

Comments
 (0)