at master 2.1 kB view raw
1// SPDX-License-Identifier: GPL-2.0 2/* 3 * Copyright (c) 2000-2003,2005 Silicon Graphics, Inc. 4 * All Rights Reserved. 5 */ 6#ifndef __XFS_RTALLOC_H__ 7#define __XFS_RTALLOC_H__ 8 9/* kernel only definitions and functions */ 10 11struct xfs_mount; 12struct xfs_trans; 13 14#ifdef CONFIG_XFS_RT 15/* rtgroup superblock initialization */ 16int xfs_rtmount_readsb(struct xfs_mount *mp); 17void xfs_rtmount_freesb(struct xfs_mount *mp); 18 19/* 20 * Initialize realtime fields in the mount structure. 21 */ 22int /* error */ 23xfs_rtmount_init( 24 struct xfs_mount *mp); /* file system mount structure */ 25void 26xfs_rtunmount_inodes( 27 struct xfs_mount *mp); 28 29/* 30 * Get the bitmap and summary inodes into the mount structure 31 * at mount time. 32 */ 33int /* error */ 34xfs_rtmount_inodes( 35 struct xfs_mount *mp); /* file system mount structure */ 36 37/* 38 * Grow the realtime area of the filesystem. 39 */ 40int 41xfs_growfs_rt( 42 struct xfs_mount *mp, /* file system mount structure */ 43 xfs_growfs_rt_t *in); /* user supplied growfs struct */ 44 45int xfs_rtalloc_reinit_frextents(struct xfs_mount *mp); 46int xfs_growfs_check_rtgeom(const struct xfs_mount *mp, xfs_rfsblock_t dblocks, 47 xfs_rfsblock_t rblocks, xfs_agblock_t rextsize); 48#else 49# define xfs_growfs_rt(mp,in) (-ENOSYS) 50# define xfs_rtalloc_reinit_frextents(m) (0) 51# define xfs_rtmount_readsb(mp) (0) 52# define xfs_rtmount_freesb(mp) ((void)0) 53static inline int /* error */ 54xfs_rtmount_init( 55 xfs_mount_t *mp) /* file system mount structure */ 56{ 57 if (mp->m_sb.sb_rblocks == 0) 58 return 0; 59 60 xfs_warn(mp, "Not built with CONFIG_XFS_RT"); 61 return -ENOSYS; 62} 63# define xfs_rtmount_inodes(m) (((mp)->m_sb.sb_rblocks == 0)? 0 : (-ENOSYS)) 64# define xfs_rtunmount_inodes(m) 65 66static inline int 67xfs_growfs_check_rtgeom(const struct xfs_mount *mp, 68 xfs_rfsblock_t dblocks, xfs_rfsblock_t rblocks, 69 xfs_extlen_t rextsize) 70{ 71 return 0; 72} 73#endif /* CONFIG_XFS_RT */ 74 75int xfs_rtallocate_rtgs(struct xfs_trans *tp, xfs_fsblock_t bno_hint, 76 xfs_rtxlen_t minlen, xfs_rtxlen_t maxlen, xfs_rtxlen_t prod, 77 bool wasdel, bool initial_user_data, xfs_rtblock_t *bno, 78 xfs_extlen_t *blen); 79 80#endif /* __XFS_RTALLOC_H__ */