|
@@ -320,6 +320,58 @@ typedef struct xfs_mod_sb {
|
|
|
int64_t msb_delta; /* Change to make to specified field */
|
|
|
} xfs_mod_sb_t;
|
|
|
|
|
|
+/*
|
|
|
+ * Per-ag incore structure, copies of information in agf and agi, to improve the
|
|
|
+ * performance of allocation group selection. This is defined for the kernel
|
|
|
+ * only, and hence is defined here instead of in xfs_ag.h. You need the struct
|
|
|
+ * xfs_mount to be defined to look up a xfs_perag anyway (via mp->m_perag_tree),
|
|
|
+ * so this doesn't introduce any strange header file dependencies.
|
|
|
+ */
|
|
|
+typedef struct xfs_perag {
|
|
|
+ struct xfs_mount *pag_mount; /* owner filesystem */
|
|
|
+ xfs_agnumber_t pag_agno; /* AG this structure belongs to */
|
|
|
+ atomic_t pag_ref; /* perag reference count */
|
|
|
+ char pagf_init; /* this agf's entry is initialized */
|
|
|
+ char pagi_init; /* this agi's entry is initialized */
|
|
|
+ char pagf_metadata; /* the agf is preferred to be metadata */
|
|
|
+ char pagi_inodeok; /* The agi is ok for inodes */
|
|
|
+ __uint8_t pagf_levels[XFS_BTNUM_AGF];
|
|
|
+ /* # of levels in bno & cnt btree */
|
|
|
+ __uint32_t pagf_flcount; /* count of blocks in freelist */
|
|
|
+ xfs_extlen_t pagf_freeblks; /* total free blocks */
|
|
|
+ xfs_extlen_t pagf_longest; /* longest free space */
|
|
|
+ __uint32_t pagf_btreeblks; /* # of blocks held in AGF btrees */
|
|
|
+ xfs_agino_t pagi_freecount; /* number of free inodes */
|
|
|
+ xfs_agino_t pagi_count; /* number of allocated inodes */
|
|
|
+
|
|
|
+ /*
|
|
|
+ * Inode allocation search lookup optimisation.
|
|
|
+ * If the pagino matches, the search for new inodes
|
|
|
+ * doesn't need to search the near ones again straight away
|
|
|
+ */
|
|
|
+ xfs_agino_t pagl_pagino;
|
|
|
+ xfs_agino_t pagl_leftrec;
|
|
|
+ xfs_agino_t pagl_rightrec;
|
|
|
+ spinlock_t pagb_lock; /* lock for pagb_tree */
|
|
|
+ struct rb_root pagb_tree; /* ordered tree of busy extents */
|
|
|
+
|
|
|
+ atomic_t pagf_fstrms; /* # of filestreams active in this AG */
|
|
|
+
|
|
|
+ spinlock_t pag_ici_lock; /* incore inode cache lock */
|
|
|
+ struct radix_tree_root pag_ici_root; /* incore inode cache root */
|
|
|
+ int pag_ici_reclaimable; /* reclaimable inodes */
|
|
|
+ struct mutex pag_ici_reclaim_lock; /* serialisation point */
|
|
|
+ unsigned long pag_ici_reclaim_cursor; /* reclaim restart point */
|
|
|
+
|
|
|
+ /* buffer cache index */
|
|
|
+ spinlock_t pag_buf_lock; /* lock for pag_buf_tree */
|
|
|
+ struct rb_root pag_buf_tree; /* ordered tree of active buffers */
|
|
|
+
|
|
|
+ /* for rcu-safe freeing */
|
|
|
+ struct rcu_head rcu_head;
|
|
|
+ int pagb_count; /* pagb slots in use */
|
|
|
+} xfs_perag_t;
|
|
|
+
|
|
|
extern int xfs_log_sbcount(xfs_mount_t *);
|
|
|
extern __uint64_t xfs_default_resblks(xfs_mount_t *mp);
|
|
|
extern int xfs_mountfs(xfs_mount_t *mp);
|