Merge tag 'fsnotify_for_v6.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux.git] / fs / xfs / xfs_mount.h
index 96496f39f551ae29ed10ce4c0f9107287bc69e2a..db9dade7d22a19f1b1abe3f20405dc0397ea2711 100644 (file)
@@ -71,6 +71,40 @@ struct xfs_inodegc {
        unsigned int            cpu;
 };
 
+/*
+ * Container for each type of groups, used to look up individual groups and
+ * describes the geometry.
+ */
+struct xfs_groups {
+       struct xarray           xa;
+
+       /*
+        * Maximum capacity of the group in FSBs.
+        *
+        * Each group is laid out densely in the daddr space.  For the
+        * degenerate case of a pre-rtgroups filesystem, the incore rtgroup
+        * pretends to have a zero-block and zero-blklog rtgroup.
+        */
+       uint32_t                blocks;
+
+       /*
+        * Log(2) of the logical size of each group.
+        *
+        * Compared to the blocks field above this is rounded up to the next
+        * power of two, and thus lays out the xfs_fsblock_t/xfs_rtblock_t
+        * space sparsely with a hole from blocks to (1 << blklog) at the end
+        * of each group.
+        */
+       uint8_t                 blklog;
+
+       /*
+        * Mask to extract the group-relative block number from a FSB.
+        * For a pre-rtgroups filesystem we pretend to have one very large
+        * rtgroup, so this mask must be 64-bit.
+        */
+       uint64_t                blkmask;
+};
+
 /*
  * The struct xfsmount layout is optimised to separate read-mostly variables
  * from variables that are frequently modified. We put the read-mostly variables
@@ -85,27 +119,20 @@ typedef struct xfs_mount {
        struct super_block      *m_super;
        struct xfs_ail          *m_ail;         /* fs active log item list */
        struct xfs_buf          *m_sb_bp;       /* buffer for superblock */
+       struct xfs_buf          *m_rtsb_bp;     /* realtime superblock */
        char                    *m_rtname;      /* realtime device name */
        char                    *m_logname;     /* external log device name */
        struct xfs_da_geometry  *m_dir_geo;     /* directory block geometry */
        struct xfs_da_geometry  *m_attr_geo;    /* attribute block geometry */
        struct xlog             *m_log;         /* log specific stuff */
-       struct xfs_inode        *m_rbmip;       /* pointer to bitmap inode */
-       struct xfs_inode        *m_rsumip;      /* pointer to summary inode */
        struct xfs_inode        *m_rootip;      /* pointer to root directory */
+       struct xfs_inode        *m_metadirip;   /* ptr to metadata directory */
+       struct xfs_inode        *m_rtdirip;     /* ptr to realtime metadir */
        struct xfs_quotainfo    *m_quotainfo;   /* disk quota information */
        struct xfs_buftarg      *m_ddev_targp;  /* data device */
        struct xfs_buftarg      *m_logdev_targp;/* log device */
        struct xfs_buftarg      *m_rtdev_targp; /* rt device */
        void __percpu           *m_inodegc;     /* percpu inodegc structures */
-
-       /*
-        * Optional cache of rt summary level per bitmap block with the
-        * invariant that m_rsum_cache[bbno] > the maximum i for which
-        * rsum[i][bbno] != 0, or 0 if rsum[i][bbno] == 0 for all i.
-        * Reads and writes are serialized by the rsumip inode lock.
-        */
-       uint8_t                 *m_rsum_cache;
        struct xfs_mru_cache    *m_filestream;  /* per-mount filestream data */
        struct workqueue_struct *m_buf_workqueue;
        struct workqueue_struct *m_unwritten_workqueue;
@@ -120,9 +147,11 @@ typedef struct xfs_mount {
        uint8_t                 m_agno_log;     /* log #ag's */
        uint8_t                 m_sectbb_log;   /* sectlog - BBSHIFT */
        int8_t                  m_rtxblklog;    /* log2 of rextsize, if possible */
+
        uint                    m_blockmask;    /* sb_blocksize-1 */
        uint                    m_blockwsize;   /* sb_blocksize in words */
-       uint                    m_blockwmask;   /* blockwsize-1 */
+       /* number of rt extents per rt bitmap block if rtgroups enabled */
+       unsigned int            m_rtx_per_rbmblock;
        uint                    m_alloc_mxr[2]; /* max alloc btree records */
        uint                    m_alloc_mnr[2]; /* min alloc btree records */
        uint                    m_bmap_dmxr[2]; /* max bmap btree records */
@@ -146,7 +175,7 @@ typedef struct xfs_mount {
        uint                    m_allocsize_blocks; /* min write size blocks */
        int                     m_logbufs;      /* number of log buffers */
        int                     m_logbsize;     /* size of each log buffer */
-       uint                    m_rsumlevels;   /* rt summary levels */
+       unsigned int            m_rsumlevels;   /* rt summary levels */
        xfs_filblks_t           m_rsumblocks;   /* size of rt summary, FSBs */
        int                     m_fixedfsid[2]; /* unchanged for life of FS */
        uint                    m_qflags;       /* quota status flags */
@@ -208,7 +237,7 @@ typedef struct xfs_mount {
         */
        atomic64_t              m_allocbt_blks;
 
-       struct xarray           m_perags;       /* per-ag accounting info */
+       struct xfs_groups       m_groups[XG_TYPE_MAX];
        uint64_t                m_resblks;      /* total reserved blocks */
        uint64_t                m_resblks_avail;/* available reserved blocks */
        uint64_t                m_resblks_save; /* reserved blks @ remount,ro */
@@ -224,6 +253,7 @@ typedef struct xfs_mount {
 #endif
        xfs_agnumber_t          m_agfrotor;     /* last ag where space found */
        atomic_t                m_agirotor;     /* last ag dir inode alloced */
+       atomic_t                m_rtgrotor;     /* last rtgroup rtpicked */
 
        /* Memory shrinker to throttle and reprioritize inodegc */
        struct shrinker         *m_inodegc_shrinker;
@@ -298,6 +328,7 @@ typedef struct xfs_mount {
 #define XFS_FEAT_NEEDSREPAIR   (1ULL << 25)    /* needs xfs_repair */
 #define XFS_FEAT_NREXT64       (1ULL << 26)    /* large extent counters */
 #define XFS_FEAT_EXCHANGE_RANGE        (1ULL << 27)    /* exchange range */
+#define XFS_FEAT_METADIR       (1ULL << 28)    /* metadata directory tree */
 
 /* Mount features */
 #define XFS_FEAT_NOATTR2       (1ULL << 48)    /* disable attr2 creation */
@@ -353,6 +384,19 @@ __XFS_HAS_FEAT(bigtime, BIGTIME)
 __XFS_HAS_FEAT(needsrepair, NEEDSREPAIR)
 __XFS_HAS_FEAT(large_extent_counts, NREXT64)
 __XFS_HAS_FEAT(exchange_range, EXCHANGE_RANGE)
+__XFS_HAS_FEAT(metadir, METADIR)
+
+static inline bool xfs_has_rtgroups(struct xfs_mount *mp)
+{
+       /* all metadir file systems also allow rtgroups */
+       return xfs_has_metadir(mp);
+}
+
+static inline bool xfs_has_rtsb(struct xfs_mount *mp)
+{
+       /* all rtgroups filesystems with an rt section have an rtsb */
+       return xfs_has_rtgroups(mp) && xfs_has_realtime(mp);
+}
 
 /*
  * Some features are always on for v5 file systems, allow the compiler to
@@ -433,18 +477,30 @@ __XFS_HAS_FEAT(nouuid, NOUUID)
  */
 #define XFS_OPSTATE_BLOCKGC_ENABLED    6
 
+/* Kernel has logged a warning about pNFS being used on this fs. */
+#define XFS_OPSTATE_WARNED_PNFS                7
 /* Kernel has logged a warning about online fsck being used on this fs. */
-#define XFS_OPSTATE_WARNED_SCRUB       7
+#define XFS_OPSTATE_WARNED_SCRUB       8
 /* Kernel has logged a warning about shrink being used on this fs. */
-#define XFS_OPSTATE_WARNED_SHRINK      8
+#define XFS_OPSTATE_WARNED_SHRINK      9
 /* Kernel has logged a warning about logged xattr updates being used. */
-#define XFS_OPSTATE_WARNED_LARP                9
+#define XFS_OPSTATE_WARNED_LARP                10
 /* Mount time quotacheck is running */
-#define XFS_OPSTATE_QUOTACHECK_RUNNING 10
+#define XFS_OPSTATE_QUOTACHECK_RUNNING 11
 /* Do we want to clear log incompat flags? */
-#define XFS_OPSTATE_UNSET_LOG_INCOMPAT 11
+#define XFS_OPSTATE_UNSET_LOG_INCOMPAT 12
 /* Filesystem can use logged extended attributes */
-#define XFS_OPSTATE_USE_LARP           12
+#define XFS_OPSTATE_USE_LARP           13
+/* Kernel has logged a warning about blocksize > pagesize on this fs. */
+#define XFS_OPSTATE_WARNED_LBS         14
+/* Kernel has logged a warning about exchange-range being used on this fs. */
+#define XFS_OPSTATE_WARNED_EXCHRANGE   15
+/* Kernel has logged a warning about parent pointers being used on this fs. */
+#define XFS_OPSTATE_WARNED_PPTR                16
+/* Kernel has logged a warning about metadata dirs being used on this fs. */
+#define XFS_OPSTATE_WARNED_METADIR     17
+/* Filesystem should use qflags to determine quotaon status */
+#define XFS_OPSTATE_RESUMING_QUOTAON   18
 
 #define __XFS_IS_OPSTATE(name, NAME) \
 static inline bool xfs_is_ ## name (struct xfs_mount *mp) \
@@ -469,9 +525,24 @@ __XFS_IS_OPSTATE(inodegc_enabled, INODEGC_ENABLED)
 __XFS_IS_OPSTATE(blockgc_enabled, BLOCKGC_ENABLED)
 #ifdef CONFIG_XFS_QUOTA
 __XFS_IS_OPSTATE(quotacheck_running, QUOTACHECK_RUNNING)
+__XFS_IS_OPSTATE(resuming_quotaon, RESUMING_QUOTAON)
 #else
-# define xfs_is_quotacheck_running(mp) (false)
-#endif
+static inline bool xfs_is_quotacheck_running(struct xfs_mount *mp)
+{
+       return false;
+}
+static inline bool xfs_is_resuming_quotaon(struct xfs_mount *mp)
+{
+       return false;
+}
+static inline void xfs_set_resuming_quotaon(struct xfs_mount *m)
+{
+}
+static inline bool xfs_clear_resuming_quotaon(struct xfs_mount *mp)
+{
+       return false;
+}
+#endif /* CONFIG_XFS_QUOTA */
 __XFS_IS_OPSTATE(done_with_log_incompat, UNSET_LOG_INCOMPAT)
 __XFS_IS_OPSTATE(using_logged_xattrs, USE_LARP)
 
This page took 0.031452 seconds and 4 git commands to generate.