xfs
[Top] [All Lists]

[PATCH 02/15] xfs: Introduce new structure members ag_state/agf_state

To: xfs@xxxxxxxxxxx
Subject: [PATCH 02/15] xfs: Introduce new structure members ag_state/agf_state
From: Jeff Liu <jeff.liu@xxxxxxxxxx>
Date: Fri, 16 Nov 2012 14:45:06 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121028 Thunderbird/16.0.2
Introduce new members ag_state && agf_state to struct
xfs_perag and struct xfs_agf separately.

It would be used for two purpose for now:
- get/set state upon a given AG with coming new ioctl(2).
- check whether a given a.g. can be selected for block/inode allocation or not.

Signed-off-by: Jie Liu <jeff.liu@xxxxxxxxxx>
---
 fs/xfs/xfs_ag.h |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/fs/xfs/xfs_ag.h b/fs/xfs/xfs_ag.h
index 44d65c1..fd578e6 100644
--- a/fs/xfs/xfs_ag.h
+++ b/fs/xfs/xfs_ag.h
@@ -69,6 +69,10 @@ typedef struct xfs_agf {
        __be32          agf_freeblks;   /* total free blocks */
        __be32          agf_longest;    /* longest free space */
        __be32          agf_btreeblks;  /* # of blocks held in AGF btrees */
+       /*
+        * A.G state for freespace allocation(allow/deny)
+        */
+       __be32          agf_state;      /* persistent a.g. state */
 } xfs_agf_t;
 
 #define        XFS_AGF_MAGICNUM        0x00000001
@@ -83,7 +87,8 @@ typedef struct xfs_agf {
 #define        XFS_AGF_FREEBLKS        0x00000200
 #define        XFS_AGF_LONGEST         0x00000400
 #define        XFS_AGF_BTREEBLKS       0x00000800
-#define        XFS_AGF_NUM_BITS        12
+#define XFS_AGF_STATE          0x00001000
+#define        XFS_AGF_NUM_BITS        13
 #define        XFS_AGF_ALL_BITS        ((1 << XFS_AGF_NUM_BITS) - 1)
 
 #define XFS_AGF_FLAGS \
@@ -98,7 +103,8 @@ typedef struct xfs_agf {
        { XFS_AGF_FLCOUNT,      "FLCOUNT" }, \
        { XFS_AGF_FREEBLKS,     "FREEBLKS" }, \
        { XFS_AGF_LONGEST,      "LONGEST" }, \
-       { XFS_AGF_BTREEBLKS,    "BTREEBLKS" }
+       { XFS_AGF_BTREEBLKS,    "BTREEBLKS" }, \
+       { XFS_AGF_STATE,        "STATE" }
 
 /* disk block (xfs_daddr_t) in the AG */
 #define XFS_AGF_DADDR(mp)      ((xfs_daddr_t)(1 << (mp)->m_sectbb_log))
@@ -159,7 +165,7 @@ typedef struct xfs_agi {
 #define        XFS_BUF_TO_AGI(bp)      ((xfs_agi_t *)((bp)->b_addr))
 
 extern int xfs_read_agi(struct xfs_mount *mp, struct xfs_trans *tp,
-                               xfs_agnumber_t agno, struct xfs_buf **bpp);
+                       xfs_agnumber_t agno, struct xfs_buf **bpp);
 
 /*
  * The third a.g. block contains the a.g. freelist, an array
@@ -225,6 +231,7 @@ typedef struct xfs_perag {
        struct rcu_head rcu_head;
 #endif
        int             pagb_count;     /* pagb slots in use */
+       __uint32_t      pag_state;      /* persistent a.g. state */
 } xfs_perag_t;
 
 /*
-- 
1.7.4.1

<Prev in Thread] Current Thread [Next in Thread>
  • [PATCH 02/15] xfs: Introduce new structure members ag_state/agf_state, Jeff Liu <=