#include "bmap_repair.h"
#include "rt.h"
+/* inode types */
+enum xr_ino_type {
+ XR_INO_UNKNOWN, /* unknown */
+ XR_INO_DIR, /* directory */
+ XR_INO_RTDATA, /* realtime file */
+ XR_INO_RTBITMAP, /* realtime bitmap inode */
+ XR_INO_RTSUM, /* realtime summary inode */
+ XR_INO_DATA, /* regular file */
+ XR_INO_SYMLINK, /* symlink */
+ XR_INO_CHRDEV, /* character device */
+ XR_INO_BLKDEV, /* block device */
+ XR_INO_SOCK, /* socket */
+ XR_INO_FIFO, /* fifo */
+ XR_INO_UQUOTA, /* user quota inode */
+ XR_INO_GQUOTA, /* group quota inode */
+ XR_INO_PQUOTA, /* project quota inode */
+ XR_INO_RTRMAP, /* realtime rmap */
+ XR_INO_RTREFC, /* realtime refcount */
+};
+
/*
* gettext lookups for translations of strings use mutexes internally to
* the library. Hence when we come through here doing parallel scans in
static inline bool
is_reflink_type(
struct xfs_mount *mp,
- int type)
+ enum xr_ino_type type)
{
if (type == XR_INO_DATA && xfs_has_reflink(mp))
return true;
xfs_mount_t *mp,
xfs_bmbt_rec_t *rp,
xfs_extnum_t *numrecs,
- int type,
+ enum xr_ino_type type,
xfs_ino_t ino,
xfs_rfsblock_t *tot,
blkmap_t **blkmapp,
xfs_agnumber_t agno,
xfs_agino_t ino,
struct xfs_dinode *dip,
- int type,
+ enum xr_ino_type type,
int *dirty,
xfs_rfsblock_t *tot,
uint64_t *nex,
xfs_agnumber_t agno,
xfs_agino_t ino,
struct xfs_dinode *dip,
- int type,
+ enum xr_ino_type type,
int *dirty,
xfs_rfsblock_t *tot,
uint64_t *nex,
xfs_agnumber_t agno,
xfs_agino_t ino,
struct xfs_dinode *dip,
- int type,
+ enum xr_ino_type type,
int *dirty,
xfs_rfsblock_t *tot,
xfs_extnum_t *nex,
xfs_agnumber_t agno,
xfs_agino_t ino,
struct xfs_dinode *dip,
- int type,
+ enum xr_ino_type type,
int *dirty,
xfs_rfsblock_t *tot,
xfs_extnum_t *nex,
struct xfs_mount *mp,
xfs_ino_t lino,
struct xfs_dinode *dino,
- uint ino_type,
+ enum xr_ino_type ino_type,
struct blkmap *blkmap)
{
xfs_fsblock_t fsbno;
xfs_mount_t *mp,
struct xfs_dinode *dino,
xfs_ino_t lino,
- int type)
+ enum xr_ino_type type)
{
/*
* must also have a zero size
}
static int
-process_misc_ino_types_blocks(xfs_rfsblock_t totblocks, xfs_ino_t lino, int type)
+process_misc_ino_types_blocks(
+ xfs_rfsblock_t totblocks,
+ xfs_ino_t lino,
+ enum xr_ino_type type)
{
/*
* you can not enforce all misc types have zero data fork blocks
struct xfs_mount *mp,
struct xfs_dinode *dinoc,
xfs_ino_t lino,
- int *type,
+ enum xr_ino_type *type,
int *dirty,
int expected_type,
const char *tag)
xfs_mount_t *mp,
struct xfs_dinode *dinoc,
xfs_ino_t lino,
- int *type,
+ enum xr_ino_type *type,
int *dirty)
{
if (lino == mp->m_sb.sb_rootino) {
xfs_mount_t *mp,
struct xfs_dinode *dino,
xfs_ino_t lino,
- int type)
+ enum xr_ino_type type)
{
xfs_fsize_t size = be64_to_cpu(dino->di_size);
xfs_agnumber_t agno,
xfs_agino_t ino,
struct xfs_dinode **dinop,
- int type,
+ enum xr_ino_type type,
int *dirty,
xfs_rfsblock_t *totblocks,
xfs_extnum_t *nextents,
xfs_ino_t *parent, /* out -- parent if ino is a dir */
struct xfs_buf **ino_bpp)
{
+ enum xr_ino_type type = XR_INO_UNKNOWN;
xfs_rfsblock_t totblocks = 0;
xfs_rfsblock_t atotblocks = 0;
int di_mode;
- int type;
int retval = 0;
xfs_extnum_t nextents;
xfs_extnum_t anextents;
*dirty = *isa_dir = 0;
*used = is_used;
- type = XR_INO_UNKNOWN;
lino = XFS_AGINO_TO_INO(mp, agno, ino);
di_mode = be16_to_cpu(dino->di_mode);
* inode definitions
*/
-/* inode types */
-
-#define XR_INO_UNKNOWN 0 /* unknown */
-#define XR_INO_DIR 1 /* directory */
-#define XR_INO_RTDATA 2 /* realtime file */
-#define XR_INO_RTBITMAP 3 /* realtime bitmap inode */
-#define XR_INO_RTSUM 4 /* realtime summary inode */
-#define XR_INO_DATA 5 /* regular file */
-#define XR_INO_SYMLINK 6 /* symlink */
-#define XR_INO_CHRDEV 7 /* character device */
-#define XR_INO_BLKDEV 8 /* block device */
-#define XR_INO_SOCK 9 /* socket */
-#define XR_INO_FIFO 10 /* fifo */
-#define XR_INO_UQUOTA 12 /* user quota inode */
-#define XR_INO_GQUOTA 13 /* group quota inode */
-#define XR_INO_PQUOTA 14 /* project quota inode */
-#define XR_INO_RTRMAP 15 /* realtime rmap */
-#define XR_INO_RTREFC 16 /* realtime refcount */
-
/* inode allocation tree */
/*