xfs: move most of xfs_sb.h to xfs_format.h
authorChristoph Hellwig <hch@lst.de>
Fri, 28 Nov 2014 03:27:09 +0000 (14:27 +1100)
committerDave Chinner <david@fromorbit.com>
Fri, 28 Nov 2014 03:27:09 +0000 (14:27 +1100)
More on-disk format consolidation.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
56 files changed:
fs/xfs/libxfs/xfs_attr.c
fs/xfs/libxfs/xfs_attr_remote.c
fs/xfs/libxfs/xfs_bmap_btree.c
fs/xfs/libxfs/xfs_btree.c
fs/xfs/libxfs/xfs_da_btree.c
fs/xfs/libxfs/xfs_da_format.c
fs/xfs/libxfs/xfs_dir2.c
fs/xfs/libxfs/xfs_dir2_block.c
fs/xfs/libxfs/xfs_dir2_data.c
fs/xfs/libxfs/xfs_dir2_leaf.c
fs/xfs/libxfs/xfs_dir2_node.c
fs/xfs/libxfs/xfs_dir2_sf.c
fs/xfs/libxfs/xfs_dquot_buf.c
fs/xfs/libxfs/xfs_format.h
fs/xfs/libxfs/xfs_ialloc_btree.c
fs/xfs/libxfs/xfs_inode_buf.c
fs/xfs/libxfs/xfs_inode_fork.c
fs/xfs/libxfs/xfs_log_rlimit.c
fs/xfs/libxfs/xfs_rtbitmap.c
fs/xfs/libxfs/xfs_sb.h
fs/xfs/libxfs/xfs_symlink_remote.c
fs/xfs/libxfs/xfs_trans_resv.c
fs/xfs/xfs_acl.c
fs/xfs/xfs_aops.c
fs/xfs/xfs_attr_inactive.c
fs/xfs/xfs_attr_list.c
fs/xfs/xfs_bmap_util.c
fs/xfs/xfs_dir2_readdir.c
fs/xfs/xfs_dquot.c
fs/xfs/xfs_dquot_item.c
fs/xfs/xfs_error.c
fs/xfs/xfs_export.c
fs/xfs/xfs_extfree_item.c
fs/xfs/xfs_file.c
fs/xfs/xfs_icreate_item.c
fs/xfs/xfs_inode_item.c
fs/xfs/xfs_ioctl.c
fs/xfs/xfs_ioctl32.c
fs/xfs/xfs_iomap.c
fs/xfs/xfs_iops.c
fs/xfs/xfs_itable.c
fs/xfs/xfs_log.c
fs/xfs/xfs_log_cil.c
fs/xfs/xfs_message.c
fs/xfs/xfs_qm_bhv.c
fs/xfs/xfs_quotaops.c
fs/xfs/xfs_rtalloc.c
fs/xfs/xfs_symlink.c
fs/xfs/xfs_trace.c
fs/xfs/xfs_trans.c
fs/xfs/xfs_trans_ail.c
fs/xfs/xfs_trans_buf.c
fs/xfs/xfs_trans_dquot.c
fs/xfs/xfs_trans_extfree.c
fs/xfs/xfs_trans_inode.c
fs/xfs/xfs_xattr.c

index f782d3617d2f363612ace6f57808832bd27c3e33..0a472fbe06d46431a82cdb1f91aaa68755b2b944 100644 (file)
@@ -22,7 +22,6 @@
 #include "xfs_log_format.h"
 #include "xfs_trans_resv.h"
 #include "xfs_bit.h"
-#include "xfs_sb.h"
 #include "xfs_mount.h"
 #include "xfs_da_format.h"
 #include "xfs_da_btree.h"
index 4edd4a84abe9c30ea5ea7f9fa226068b4cb47acf..20de88d1bf86205d126d5e27b43298af9b836a79 100644 (file)
@@ -23,7 +23,6 @@
 #include "xfs_log_format.h"
 #include "xfs_trans_resv.h"
 #include "xfs_bit.h"
-#include "xfs_sb.h"
 #include "xfs_mount.h"
 #include "xfs_da_format.h"
 #include "xfs_da_btree.h"
index 91588a54a67797f6818c5ac104e605e2cfec9de6..2c44c8e507827cba31851e1bb8248b6293da5bc6 100644 (file)
@@ -22,7 +22,6 @@
 #include "xfs_log_format.h"
 #include "xfs_trans_resv.h"
 #include "xfs_bit.h"
-#include "xfs_sb.h"
 #include "xfs_mount.h"
 #include "xfs_inode.h"
 #include "xfs_trans.h"
index 256d53245c4226c5b8404a6d3adb65b0004f6f80..81cad433df85d6a744c898bb2b43f45588c3fbd5 100644 (file)
@@ -22,7 +22,6 @@
 #include "xfs_log_format.h"
 #include "xfs_trans_resv.h"
 #include "xfs_bit.h"
-#include "xfs_sb.h"
 #include "xfs_mount.h"
 #include "xfs_inode.h"
 #include "xfs_trans.h"
index 2b880617135cdbe3b65a778c83310d30e984115e..c41e7513849edc387f18d36a33df6cc76b6a3988 100644 (file)
@@ -23,7 +23,6 @@
 #include "xfs_log_format.h"
 #include "xfs_trans_resv.h"
 #include "xfs_bit.h"
-#include "xfs_sb.h"
 #include "xfs_mount.h"
 #include "xfs_da_format.h"
 #include "xfs_da_btree.h"
index 927e9eb6d99976161a18490d783212da1dcd8a36..9d624a6229468f721beaba38826008492f325aa0 100644 (file)
@@ -22,7 +22,6 @@
 #include "xfs_format.h"
 #include "xfs_log_format.h"
 #include "xfs_trans_resv.h"
-#include "xfs_sb.h"
 #include "xfs_mount.h"
 #include "xfs_da_format.h"
 #include "xfs_da_btree.h"
index 672a29e626cc91e38a1f93f04143037f9b8bce37..5d892911158ba836846825999532126e4ba1b306 100644 (file)
@@ -21,7 +21,6 @@
 #include "xfs_log_format.h"
 #include "xfs_trans_resv.h"
 #include "xfs_inum.h"
-#include "xfs_sb.h"
 #include "xfs_mount.h"
 #include "xfs_da_format.h"
 #include "xfs_da_btree.h"
index a6b3a6a60e898866ba6d0025b993081f17d9ea17..c2e34c54b7061cfaa9f61d6d8b6446cb0437a5f4 100644 (file)
@@ -21,7 +21,6 @@
 #include "xfs_format.h"
 #include "xfs_log_format.h"
 #include "xfs_trans_resv.h"
-#include "xfs_sb.h"
 #include "xfs_mount.h"
 #include "xfs_da_format.h"
 #include "xfs_da_btree.h"
index 2c8f463c54ed4655954fbd35205749030db77b19..5ff31be9b1cd4537052a853dbf6c77776a83af25 100644 (file)
@@ -21,7 +21,6 @@
 #include "xfs_format.h"
 #include "xfs_log_format.h"
 #include "xfs_trans_resv.h"
-#include "xfs_sb.h"
 #include "xfs_mount.h"
 #include "xfs_da_format.h"
 #include "xfs_da_btree.h"
index 777c48208528cec8fc446df5fbfacde80c004fb6..ed41a0e0da63766aefa7224879cb0635880d880e 100644 (file)
@@ -21,7 +21,6 @@
 #include "xfs_format.h"
 #include "xfs_log_format.h"
 #include "xfs_trans_resv.h"
-#include "xfs_sb.h"
 #include "xfs_mount.h"
 #include "xfs_da_format.h"
 #include "xfs_da_btree.h"
index c0a0e194fbf77cc16997a4cbf8a38f5e248e6ebb..78ceda1bcd34bf24e738c0beeb6a107cfdb4c904 100644 (file)
@@ -21,7 +21,6 @@
 #include "xfs_format.h"
 #include "xfs_log_format.h"
 #include "xfs_trans_resv.h"
-#include "xfs_sb.h"
 #include "xfs_mount.h"
 #include "xfs_da_format.h"
 #include "xfs_da_btree.h"
index ab99dbc00988b56d95bd310af3aea1cb4e2af5d5..2baedc40591fbb1715c40f07f742c6b90f047997 100644 (file)
@@ -20,7 +20,6 @@
 #include "xfs_format.h"
 #include "xfs_log_format.h"
 #include "xfs_trans_resv.h"
-#include "xfs_sb.h"
 #include "xfs_mount.h"
 #include "xfs_da_format.h"
 #include "xfs_da_btree.h"
index cd6892667ba18c5ac3f5d5813abd23855da893bb..6fbf2d853a54e178d0699fa90cb03ad8647a349e 100644 (file)
@@ -22,7 +22,6 @@
 #include "xfs_format.h"
 #include "xfs_log_format.h"
 #include "xfs_trans_resv.h"
-#include "xfs_sb.h"
 #include "xfs_mount.h"
 #include "xfs_inode.h"
 #include "xfs_quota.h"
index 9b6e4247ca280eddd20abb5c0632a635f23739a9..70ca740f34ac5972e4ebb095c1778440471719bd 100644 (file)
@@ -33,6 +33,585 @@ struct xfs_inode;
 struct xfs_buf;
 struct xfs_ifork;
 
+/*
+ * Super block
+ * Fits into a sector-sized buffer at address 0 of each allocation group.
+ * Only the first of these is ever updated except during growfs.
+ */
+#define        XFS_SB_MAGIC            0x58465342      /* 'XFSB' */
+#define        XFS_SB_VERSION_1        1               /* 5.3, 6.0.1, 6.1 */
+#define        XFS_SB_VERSION_2        2               /* 6.2 - attributes */
+#define        XFS_SB_VERSION_3        3               /* 6.2 - new inode version */
+#define        XFS_SB_VERSION_4        4               /* 6.2+ - bitmask version */
+#define        XFS_SB_VERSION_5        5               /* CRC enabled filesystem */
+#define        XFS_SB_VERSION_NUMBITS          0x000f
+#define        XFS_SB_VERSION_ALLFBITS         0xfff0
+#define        XFS_SB_VERSION_ATTRBIT          0x0010
+#define        XFS_SB_VERSION_NLINKBIT         0x0020
+#define        XFS_SB_VERSION_QUOTABIT         0x0040
+#define        XFS_SB_VERSION_ALIGNBIT         0x0080
+#define        XFS_SB_VERSION_DALIGNBIT        0x0100
+#define        XFS_SB_VERSION_SHAREDBIT        0x0200
+#define XFS_SB_VERSION_LOGV2BIT                0x0400
+#define XFS_SB_VERSION_SECTORBIT       0x0800
+#define        XFS_SB_VERSION_EXTFLGBIT        0x1000
+#define        XFS_SB_VERSION_DIRV2BIT         0x2000
+#define        XFS_SB_VERSION_BORGBIT          0x4000  /* ASCII only case-insens. */
+#define        XFS_SB_VERSION_MOREBITSBIT      0x8000
+
+/*
+ * Supported feature bit list is just all bits in the versionnum field because
+ * we've used them all up and understand them all. Except, of course, for the
+ * shared superblock bit, which nobody knows what it does and so is unsupported.
+ */
+#define        XFS_SB_VERSION_OKBITS           \
+       ((XFS_SB_VERSION_NUMBITS | XFS_SB_VERSION_ALLFBITS) & \
+               ~XFS_SB_VERSION_SHAREDBIT)
+
+/*
+ * There are two words to hold XFS "feature" bits: the original
+ * word, sb_versionnum, and sb_features2.  Whenever a bit is set in
+ * sb_features2, the feature bit XFS_SB_VERSION_MOREBITSBIT must be set.
+ *
+ * These defines represent bits in sb_features2.
+ */
+#define XFS_SB_VERSION2_RESERVED1BIT   0x00000001
+#define XFS_SB_VERSION2_LAZYSBCOUNTBIT 0x00000002      /* Superblk counters */
+#define XFS_SB_VERSION2_RESERVED4BIT   0x00000004
+#define XFS_SB_VERSION2_ATTR2BIT       0x00000008      /* Inline attr rework */
+#define XFS_SB_VERSION2_PARENTBIT      0x00000010      /* parent pointers */
+#define XFS_SB_VERSION2_PROJID32BIT    0x00000080      /* 32 bit project id */
+#define XFS_SB_VERSION2_CRCBIT         0x00000100      /* metadata CRCs */
+#define XFS_SB_VERSION2_FTYPE          0x00000200      /* inode type in dir */
+
+#define        XFS_SB_VERSION2_OKBITS          \
+       (XFS_SB_VERSION2_LAZYSBCOUNTBIT | \
+        XFS_SB_VERSION2_ATTR2BIT       | \
+        XFS_SB_VERSION2_PROJID32BIT    | \
+        XFS_SB_VERSION2_FTYPE)
+
+/*
+ * Superblock - in core version.  Must match the ondisk version below.
+ * Must be padded to 64 bit alignment.
+ */
+typedef struct xfs_sb {
+       __uint32_t      sb_magicnum;    /* magic number == XFS_SB_MAGIC */
+       __uint32_t      sb_blocksize;   /* logical block size, bytes */
+       xfs_rfsblock_t  sb_dblocks;     /* number of data blocks */
+       xfs_rfsblock_t  sb_rblocks;     /* number of realtime blocks */
+       xfs_rtblock_t   sb_rextents;    /* number of realtime extents */
+       uuid_t          sb_uuid;        /* file system unique id */
+       xfs_fsblock_t   sb_logstart;    /* starting block of log if internal */
+       xfs_ino_t       sb_rootino;     /* root inode number */
+       xfs_ino_t       sb_rbmino;      /* bitmap inode for realtime extents */
+       xfs_ino_t       sb_rsumino;     /* summary inode for rt bitmap */
+       xfs_agblock_t   sb_rextsize;    /* realtime extent size, blocks */
+       xfs_agblock_t   sb_agblocks;    /* size of an allocation group */
+       xfs_agnumber_t  sb_agcount;     /* number of allocation groups */
+       xfs_extlen_t    sb_rbmblocks;   /* number of rt bitmap blocks */
+       xfs_extlen_t    sb_logblocks;   /* number of log blocks */
+       __uint16_t      sb_versionnum;  /* header version == XFS_SB_VERSION */
+       __uint16_t      sb_sectsize;    /* volume sector size, bytes */
+       __uint16_t      sb_inodesize;   /* inode size, bytes */
+       __uint16_t      sb_inopblock;   /* inodes per block */
+       char            sb_fname[12];   /* file system name */
+       __uint8_t       sb_blocklog;    /* log2 of sb_blocksize */
+       __uint8_t       sb_sectlog;     /* log2 of sb_sectsize */
+       __uint8_t       sb_inodelog;    /* log2 of sb_inodesize */
+       __uint8_t       sb_inopblog;    /* log2 of sb_inopblock */
+       __uint8_t       sb_agblklog;    /* log2 of sb_agblocks (rounded up) */
+       __uint8_t       sb_rextslog;    /* log2 of sb_rextents */
+       __uint8_t       sb_inprogress;  /* mkfs is in progress, don't mount */
+       __uint8_t       sb_imax_pct;    /* max % of fs for inode space */
+                                       /* statistics */
+       /*
+        * These fields must remain contiguous.  If you really
+        * want to change their layout, make sure you fix the
+        * code in xfs_trans_apply_sb_deltas().
+        */
+       __uint64_t      sb_icount;      /* allocated inodes */
+       __uint64_t      sb_ifree;       /* free inodes */
+       __uint64_t      sb_fdblocks;    /* free data blocks */
+       __uint64_t      sb_frextents;   /* free realtime extents */
+       /*
+        * End contiguous fields.
+        */
+       xfs_ino_t       sb_uquotino;    /* user quota inode */
+       xfs_ino_t       sb_gquotino;    /* group quota inode */
+       __uint16_t      sb_qflags;      /* quota flags */
+       __uint8_t       sb_flags;       /* misc. flags */
+       __uint8_t       sb_shared_vn;   /* shared version number */
+       xfs_extlen_t    sb_inoalignmt;  /* inode chunk alignment, fsblocks */
+       __uint32_t      sb_unit;        /* stripe or raid unit */
+       __uint32_t      sb_width;       /* stripe or raid width */
+       __uint8_t       sb_dirblklog;   /* log2 of dir block size (fsbs) */
+       __uint8_t       sb_logsectlog;  /* log2 of the log sector size */
+       __uint16_t      sb_logsectsize; /* sector size for the log, bytes */
+       __uint32_t      sb_logsunit;    /* stripe unit size for the log */
+       __uint32_t      sb_features2;   /* additional feature bits */
+
+       /*
+        * bad features2 field as a result of failing to pad the sb
+        * structure to 64 bits. Some machines will be using this field
+        * for features2 bits. Easiest just to mark it bad and not use
+        * it for anything else.
+        */
+       __uint32_t      sb_bad_features2;
+
+       /* version 5 superblock fields start here */
+
+       /* feature masks */
+       __uint32_t      sb_features_compat;
+       __uint32_t      sb_features_ro_compat;
+       __uint32_t      sb_features_incompat;
+       __uint32_t      sb_features_log_incompat;
+
+       __uint32_t      sb_crc;         /* superblock crc */
+       __uint32_t      sb_pad;
+
+       xfs_ino_t       sb_pquotino;    /* project quota inode */
+       xfs_lsn_t       sb_lsn;         /* last write sequence */
+
+       /* must be padded to 64 bit alignment */
+} xfs_sb_t;
+
+#define XFS_SB_CRC_OFF         offsetof(struct xfs_sb, sb_crc)
+
+/*
+ * Superblock - on disk version.  Must match the in core version above.
+ * Must be padded to 64 bit alignment.
+ */
+typedef struct xfs_dsb {
+       __be32          sb_magicnum;    /* magic number == XFS_SB_MAGIC */
+       __be32          sb_blocksize;   /* logical block size, bytes */
+       __be64          sb_dblocks;     /* number of data blocks */
+       __be64          sb_rblocks;     /* number of realtime blocks */
+       __be64          sb_rextents;    /* number of realtime extents */
+       uuid_t          sb_uuid;        /* file system unique id */
+       __be64          sb_logstart;    /* starting block of log if internal */
+       __be64          sb_rootino;     /* root inode number */
+       __be64          sb_rbmino;      /* bitmap inode for realtime extents */
+       __be64          sb_rsumino;     /* summary inode for rt bitmap */
+       __be32          sb_rextsize;    /* realtime extent size, blocks */
+       __be32          sb_agblocks;    /* size of an allocation group */
+       __be32          sb_agcount;     /* number of allocation groups */
+       __be32          sb_rbmblocks;   /* number of rt bitmap blocks */
+       __be32          sb_logblocks;   /* number of log blocks */
+       __be16          sb_versionnum;  /* header version == XFS_SB_VERSION */
+       __be16          sb_sectsize;    /* volume sector size, bytes */
+       __be16          sb_inodesize;   /* inode size, bytes */
+       __be16          sb_inopblock;   /* inodes per block */
+       char            sb_fname[12];   /* file system name */
+       __u8            sb_blocklog;    /* log2 of sb_blocksize */
+       __u8            sb_sectlog;     /* log2 of sb_sectsize */
+       __u8            sb_inodelog;    /* log2 of sb_inodesize */
+       __u8            sb_inopblog;    /* log2 of sb_inopblock */
+       __u8            sb_agblklog;    /* log2 of sb_agblocks (rounded up) */
+       __u8            sb_rextslog;    /* log2 of sb_rextents */
+       __u8            sb_inprogress;  /* mkfs is in progress, don't mount */
+       __u8            sb_imax_pct;    /* max % of fs for inode space */
+                                       /* statistics */
+       /*
+        * These fields must remain contiguous.  If you really
+        * want to change their layout, make sure you fix the
+        * code in xfs_trans_apply_sb_deltas().
+        */
+       __be64          sb_icount;      /* allocated inodes */
+       __be64          sb_ifree;       /* free inodes */
+       __be64          sb_fdblocks;    /* free data blocks */
+       __be64          sb_frextents;   /* free realtime extents */
+       /*
+        * End contiguous fields.
+        */
+       __be64          sb_uquotino;    /* user quota inode */
+       __be64          sb_gquotino;    /* group quota inode */
+       __be16          sb_qflags;      /* quota flags */
+       __u8            sb_flags;       /* misc. flags */
+       __u8            sb_shared_vn;   /* shared version number */
+       __be32          sb_inoalignmt;  /* inode chunk alignment, fsblocks */
+       __be32          sb_unit;        /* stripe or raid unit */
+       __be32          sb_width;       /* stripe or raid width */
+       __u8            sb_dirblklog;   /* log2 of dir block size (fsbs) */
+       __u8            sb_logsectlog;  /* log2 of the log sector size */
+       __be16          sb_logsectsize; /* sector size for the log, bytes */
+       __be32          sb_logsunit;    /* stripe unit size for the log */
+       __be32          sb_features2;   /* additional feature bits */
+       /*
+        * bad features2 field as a result of failing to pad the sb
+        * structure to 64 bits. Some machines will be using this field
+        * for features2 bits. Easiest just to mark it bad and not use
+        * it for anything else.
+        */
+       __be32          sb_bad_features2;
+
+       /* version 5 superblock fields start here */
+
+       /* feature masks */
+       __be32          sb_features_compat;
+       __be32          sb_features_ro_compat;
+       __be32          sb_features_incompat;
+       __be32          sb_features_log_incompat;
+
+       __le32          sb_crc;         /* superblock crc */
+       __be32          sb_pad;
+
+       __be64          sb_pquotino;    /* project quota inode */
+       __be64          sb_lsn;         /* last write sequence */
+
+       /* must be padded to 64 bit alignment */
+} xfs_dsb_t;
+
+/*
+ * Sequence number values for the fields.
+ */
+typedef enum {
+       XFS_SBS_MAGICNUM, XFS_SBS_BLOCKSIZE, XFS_SBS_DBLOCKS, XFS_SBS_RBLOCKS,
+       XFS_SBS_REXTENTS, XFS_SBS_UUID, XFS_SBS_LOGSTART, XFS_SBS_ROOTINO,
+       XFS_SBS_RBMINO, XFS_SBS_RSUMINO, XFS_SBS_REXTSIZE, XFS_SBS_AGBLOCKS,
+       XFS_SBS_AGCOUNT, XFS_SBS_RBMBLOCKS, XFS_SBS_LOGBLOCKS,
+       XFS_SBS_VERSIONNUM, XFS_SBS_SECTSIZE, XFS_SBS_INODESIZE,
+       XFS_SBS_INOPBLOCK, XFS_SBS_FNAME, XFS_SBS_BLOCKLOG,
+       XFS_SBS_SECTLOG, XFS_SBS_INODELOG, XFS_SBS_INOPBLOG, XFS_SBS_AGBLKLOG,
+       XFS_SBS_REXTSLOG, XFS_SBS_INPROGRESS, XFS_SBS_IMAX_PCT, XFS_SBS_ICOUNT,
+       XFS_SBS_IFREE, XFS_SBS_FDBLOCKS, XFS_SBS_FREXTENTS, XFS_SBS_UQUOTINO,
+       XFS_SBS_GQUOTINO, XFS_SBS_QFLAGS, XFS_SBS_FLAGS, XFS_SBS_SHARED_VN,
+       XFS_SBS_INOALIGNMT, XFS_SBS_UNIT, XFS_SBS_WIDTH, XFS_SBS_DIRBLKLOG,
+       XFS_SBS_LOGSECTLOG, XFS_SBS_LOGSECTSIZE, XFS_SBS_LOGSUNIT,
+       XFS_SBS_FEATURES2, XFS_SBS_BAD_FEATURES2, XFS_SBS_FEATURES_COMPAT,
+       XFS_SBS_FEATURES_RO_COMPAT, XFS_SBS_FEATURES_INCOMPAT,
+       XFS_SBS_FEATURES_LOG_INCOMPAT, XFS_SBS_CRC, XFS_SBS_PAD,
+       XFS_SBS_PQUOTINO, XFS_SBS_LSN,
+       XFS_SBS_FIELDCOUNT
+} xfs_sb_field_t;
+
+/*
+ * Mask values, defined based on the xfs_sb_field_t values.
+ * Only define the ones we're using.
+ */
+#define        XFS_SB_MVAL(x)          (1LL << XFS_SBS_ ## x)
+#define        XFS_SB_UUID             XFS_SB_MVAL(UUID)
+#define        XFS_SB_FNAME            XFS_SB_MVAL(FNAME)
+#define        XFS_SB_ROOTINO          XFS_SB_MVAL(ROOTINO)
+#define        XFS_SB_RBMINO           XFS_SB_MVAL(RBMINO)
+#define        XFS_SB_RSUMINO          XFS_SB_MVAL(RSUMINO)
+#define        XFS_SB_VERSIONNUM       XFS_SB_MVAL(VERSIONNUM)
+#define XFS_SB_UQUOTINO                XFS_SB_MVAL(UQUOTINO)
+#define XFS_SB_GQUOTINO                XFS_SB_MVAL(GQUOTINO)
+#define XFS_SB_QFLAGS          XFS_SB_MVAL(QFLAGS)
+#define XFS_SB_SHARED_VN       XFS_SB_MVAL(SHARED_VN)
+#define XFS_SB_UNIT            XFS_SB_MVAL(UNIT)
+#define XFS_SB_WIDTH           XFS_SB_MVAL(WIDTH)
+#define XFS_SB_ICOUNT          XFS_SB_MVAL(ICOUNT)
+#define XFS_SB_IFREE           XFS_SB_MVAL(IFREE)
+#define XFS_SB_FDBLOCKS                XFS_SB_MVAL(FDBLOCKS)
+#define XFS_SB_FEATURES2       XFS_SB_MVAL(FEATURES2)
+#define XFS_SB_BAD_FEATURES2   XFS_SB_MVAL(BAD_FEATURES2)
+#define XFS_SB_FEATURES_COMPAT XFS_SB_MVAL(FEATURES_COMPAT)
+#define XFS_SB_FEATURES_RO_COMPAT XFS_SB_MVAL(FEATURES_RO_COMPAT)
+#define XFS_SB_FEATURES_INCOMPAT XFS_SB_MVAL(FEATURES_INCOMPAT)
+#define XFS_SB_FEATURES_LOG_INCOMPAT XFS_SB_MVAL(FEATURES_LOG_INCOMPAT)
+#define XFS_SB_CRC             XFS_SB_MVAL(CRC)
+#define XFS_SB_PQUOTINO                XFS_SB_MVAL(PQUOTINO)
+#define        XFS_SB_NUM_BITS         ((int)XFS_SBS_FIELDCOUNT)
+#define        XFS_SB_ALL_BITS         ((1LL << XFS_SB_NUM_BITS) - 1)
+#define        XFS_SB_MOD_BITS         \
+       (XFS_SB_UUID | XFS_SB_ROOTINO | XFS_SB_RBMINO | XFS_SB_RSUMINO | \
+        XFS_SB_VERSIONNUM | XFS_SB_UQUOTINO | XFS_SB_GQUOTINO | \
+        XFS_SB_QFLAGS | XFS_SB_SHARED_VN | XFS_SB_UNIT | XFS_SB_WIDTH | \
+        XFS_SB_ICOUNT | XFS_SB_IFREE | XFS_SB_FDBLOCKS | XFS_SB_FEATURES2 | \
+        XFS_SB_BAD_FEATURES2 | XFS_SB_FEATURES_COMPAT | \
+        XFS_SB_FEATURES_RO_COMPAT | XFS_SB_FEATURES_INCOMPAT | \
+        XFS_SB_FEATURES_LOG_INCOMPAT | XFS_SB_PQUOTINO)
+
+
+/*
+ * Misc. Flags - warning - these will be cleared by xfs_repair unless
+ * a feature bit is set when the flag is used.
+ */
+#define XFS_SBF_NOFLAGS                0x00    /* no flags set */
+#define XFS_SBF_READONLY       0x01    /* only read-only mounts allowed */
+
+/*
+ * define max. shared version we can interoperate with
+ */
+#define XFS_SB_MAX_SHARED_VN   0
+
+#define        XFS_SB_VERSION_NUM(sbp) ((sbp)->sb_versionnum & XFS_SB_VERSION_NUMBITS)
+
+/*
+ * The first XFS version we support is a v4 superblock with V2 directories.
+ */
+static inline bool xfs_sb_good_v4_features(struct xfs_sb *sbp)
+{
+       if (!(sbp->sb_versionnum & XFS_SB_VERSION_DIRV2BIT))
+               return false;
+
+       /* check for unknown features in the fs */
+       if ((sbp->sb_versionnum & ~XFS_SB_VERSION_OKBITS) ||
+           ((sbp->sb_versionnum & XFS_SB_VERSION_MOREBITSBIT) &&
+            (sbp->sb_features2 & ~XFS_SB_VERSION2_OKBITS)))
+               return false;
+
+       return true;
+}
+
+static inline bool xfs_sb_good_version(struct xfs_sb *sbp)
+{
+       if (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_5)
+               return true;
+       if (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4)
+               return xfs_sb_good_v4_features(sbp);
+       return false;
+}
+
+/*
+ * Detect a mismatched features2 field.  Older kernels read/wrote
+ * this into the wrong slot, so to be safe we keep them in sync.
+ */
+static inline bool xfs_sb_has_mismatched_features2(struct xfs_sb *sbp)
+{
+       return sbp->sb_bad_features2 != sbp->sb_features2;
+}
+
+static inline bool xfs_sb_version_hasattr(struct xfs_sb *sbp)
+{
+       return (sbp->sb_versionnum & XFS_SB_VERSION_ATTRBIT);
+}
+
+static inline void xfs_sb_version_addattr(struct xfs_sb *sbp)
+{
+       sbp->sb_versionnum |= XFS_SB_VERSION_ATTRBIT;
+}
+
+static inline bool xfs_sb_version_hasquota(struct xfs_sb *sbp)
+{
+       return (sbp->sb_versionnum & XFS_SB_VERSION_QUOTABIT);
+}
+
+static inline void xfs_sb_version_addquota(struct xfs_sb *sbp)
+{
+       sbp->sb_versionnum |= XFS_SB_VERSION_QUOTABIT;
+}
+
+static inline bool xfs_sb_version_hasalign(struct xfs_sb *sbp)
+{
+       return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_5 ||
+               (sbp->sb_versionnum & XFS_SB_VERSION_ALIGNBIT));
+}
+
+static inline bool xfs_sb_version_hasdalign(struct xfs_sb *sbp)
+{
+       return (sbp->sb_versionnum & XFS_SB_VERSION_DALIGNBIT);
+}
+
+static inline bool xfs_sb_version_haslogv2(struct xfs_sb *sbp)
+{
+       return XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_5 ||
+              (sbp->sb_versionnum & XFS_SB_VERSION_LOGV2BIT);
+}
+
+static inline bool xfs_sb_version_hasextflgbit(struct xfs_sb *sbp)
+{
+       return XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_5 ||
+              (sbp->sb_versionnum & XFS_SB_VERSION_EXTFLGBIT);
+}
+
+static inline bool xfs_sb_version_hassector(struct xfs_sb *sbp)
+{
+       return (sbp->sb_versionnum & XFS_SB_VERSION_SECTORBIT);
+}
+
+static inline bool xfs_sb_version_hasasciici(struct xfs_sb *sbp)
+{
+       return (sbp->sb_versionnum & XFS_SB_VERSION_BORGBIT);
+}
+
+static inline bool xfs_sb_version_hasmorebits(struct xfs_sb *sbp)
+{
+       return XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_5 ||
+              (sbp->sb_versionnum & XFS_SB_VERSION_MOREBITSBIT);
+}
+
+/*
+ * sb_features2 bit version macros.
+ */
+static inline bool xfs_sb_version_haslazysbcount(struct xfs_sb *sbp)
+{
+       return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_5) ||
+              (xfs_sb_version_hasmorebits(sbp) &&
+               (sbp->sb_features2 & XFS_SB_VERSION2_LAZYSBCOUNTBIT));
+}
+
+static inline bool xfs_sb_version_hasattr2(struct xfs_sb *sbp)
+{
+       return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_5) ||
+              (xfs_sb_version_hasmorebits(sbp) &&
+               (sbp->sb_features2 & XFS_SB_VERSION2_ATTR2BIT));
+}
+
+static inline void xfs_sb_version_addattr2(struct xfs_sb *sbp)
+{
+       sbp->sb_versionnum |= XFS_SB_VERSION_MOREBITSBIT;
+       sbp->sb_features2 |= XFS_SB_VERSION2_ATTR2BIT;
+       sbp->sb_bad_features2 |= XFS_SB_VERSION2_ATTR2BIT;
+}
+
+static inline void xfs_sb_version_removeattr2(struct xfs_sb *sbp)
+{
+       sbp->sb_features2 &= ~XFS_SB_VERSION2_ATTR2BIT;
+       sbp->sb_bad_features2 &= ~XFS_SB_VERSION2_ATTR2BIT;
+       if (!sbp->sb_features2)
+               sbp->sb_versionnum &= ~XFS_SB_VERSION_MOREBITSBIT;
+}
+
+static inline bool xfs_sb_version_hasprojid32bit(struct xfs_sb *sbp)
+{
+       return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_5) ||
+              (xfs_sb_version_hasmorebits(sbp) &&
+               (sbp->sb_features2 & XFS_SB_VERSION2_PROJID32BIT));
+}
+
+static inline void xfs_sb_version_addprojid32bit(struct xfs_sb *sbp)
+{
+       sbp->sb_versionnum |= XFS_SB_VERSION_MOREBITSBIT;
+       sbp->sb_features2 |= XFS_SB_VERSION2_PROJID32BIT;
+       sbp->sb_bad_features2 |= XFS_SB_VERSION2_PROJID32BIT;
+}
+
+/*
+ * Extended v5 superblock feature masks. These are to be used for new v5
+ * superblock features only.
+ *
+ * Compat features are new features that old kernels will not notice or affect
+ * and so can mount read-write without issues.
+ *
+ * RO-Compat (read only) are features that old kernels can read but will break
+ * if they write. Hence only read-only mounts of such filesystems are allowed on
+ * kernels that don't support the feature bit.
+ *
+ * InCompat features are features which old kernels will not understand and so
+ * must not mount.
+ *
+ * Log-InCompat features are for changes to log formats or new transactions that
+ * can't be replayed on older kernels. The fields are set when the filesystem is
+ * mounted, and a clean unmount clears the fields.
+ */
+#define XFS_SB_FEAT_COMPAT_ALL 0
+#define XFS_SB_FEAT_COMPAT_UNKNOWN     ~XFS_SB_FEAT_COMPAT_ALL
+static inline bool
+xfs_sb_has_compat_feature(
+       struct xfs_sb   *sbp,
+       __uint32_t      feature)
+{
+       return (sbp->sb_features_compat & feature) != 0;
+}
+
+#define XFS_SB_FEAT_RO_COMPAT_FINOBT   (1 << 0)                /* free inode btree */
+#define XFS_SB_FEAT_RO_COMPAT_ALL \
+               (XFS_SB_FEAT_RO_COMPAT_FINOBT)
+#define XFS_SB_FEAT_RO_COMPAT_UNKNOWN  ~XFS_SB_FEAT_RO_COMPAT_ALL
+static inline bool
+xfs_sb_has_ro_compat_feature(
+       struct xfs_sb   *sbp,
+       __uint32_t      feature)
+{
+       return (sbp->sb_features_ro_compat & feature) != 0;
+}
+
+#define XFS_SB_FEAT_INCOMPAT_FTYPE     (1 << 0)        /* filetype in dirent */
+#define XFS_SB_FEAT_INCOMPAT_ALL \
+               (XFS_SB_FEAT_INCOMPAT_FTYPE)
+
+#define XFS_SB_FEAT_INCOMPAT_UNKNOWN   ~XFS_SB_FEAT_INCOMPAT_ALL
+static inline bool
+xfs_sb_has_incompat_feature(
+       struct xfs_sb   *sbp,
+       __uint32_t      feature)
+{
+       return (sbp->sb_features_incompat & feature) != 0;
+}
+
+#define XFS_SB_FEAT_INCOMPAT_LOG_ALL 0
+#define XFS_SB_FEAT_INCOMPAT_LOG_UNKNOWN       ~XFS_SB_FEAT_INCOMPAT_LOG_ALL
+static inline bool
+xfs_sb_has_incompat_log_feature(
+       struct xfs_sb   *sbp,
+       __uint32_t      feature)
+{
+       return (sbp->sb_features_log_incompat & feature) != 0;
+}
+
+/*
+ * V5 superblock specific feature checks
+ */
+static inline int xfs_sb_version_hascrc(struct xfs_sb *sbp)
+{
+       return XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_5;
+}
+
+static inline int xfs_sb_version_has_pquotino(struct xfs_sb *sbp)
+{
+       return XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_5;
+}
+
+static inline int xfs_sb_version_hasftype(struct xfs_sb *sbp)
+{
+       return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_5 &&
+               xfs_sb_has_incompat_feature(sbp, XFS_SB_FEAT_INCOMPAT_FTYPE)) ||
+              (xfs_sb_version_hasmorebits(sbp) &&
+                (sbp->sb_features2 & XFS_SB_VERSION2_FTYPE));
+}
+
+static inline int xfs_sb_version_hasfinobt(xfs_sb_t *sbp)
+{
+       return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_5) &&
+               (sbp->sb_features_ro_compat & XFS_SB_FEAT_RO_COMPAT_FINOBT);
+}
+
+/*
+ * end of superblock version macros
+ */
+
+static inline bool
+xfs_is_quota_inode(struct xfs_sb *sbp, xfs_ino_t ino)
+{
+       return (ino == sbp->sb_uquotino ||
+               ino == sbp->sb_gquotino ||
+               ino == sbp->sb_pquotino);
+}
+
+#define XFS_SB_DADDR           ((xfs_daddr_t)0) /* daddr in filesystem/ag */
+#define        XFS_SB_BLOCK(mp)        XFS_HDR_BLOCK(mp, XFS_SB_DADDR)
+#define XFS_BUF_TO_SBP(bp)     ((xfs_dsb_t *)((bp)->b_addr))
+
+#define        XFS_HDR_BLOCK(mp,d)     ((xfs_agblock_t)XFS_BB_TO_FSBT(mp,d))
+#define        XFS_DADDR_TO_FSB(mp,d)  XFS_AGB_TO_FSB(mp, \
+                       xfs_daddr_to_agno(mp,d), xfs_daddr_to_agbno(mp,d))
+#define        XFS_FSB_TO_DADDR(mp,fsbno)      XFS_AGB_TO_DADDR(mp, \
+                       XFS_FSB_TO_AGNO(mp,fsbno), XFS_FSB_TO_AGBNO(mp,fsbno))
+
+/*
+ * File system sector to basic block conversions.
+ */
+#define XFS_FSS_TO_BB(mp,sec)  ((sec) << (mp)->m_sectbb_log)
+
+/*
+ * File system block to basic block conversions.
+ */
+#define        XFS_FSB_TO_BB(mp,fsbno) ((fsbno) << (mp)->m_blkbb_log)
+#define        XFS_BB_TO_FSB(mp,bb)    \
+       (((bb) + (XFS_FSB_TO_BB(mp,1) - 1)) >> (mp)->m_blkbb_log)
+#define        XFS_BB_TO_FSBT(mp,bb)   ((bb) >> (mp)->m_blkbb_log)
+
+/*
+ * File system block to byte conversions.
+ */
+#define XFS_FSB_TO_B(mp,fsbno) ((xfs_fsize_t)(fsbno) << (mp)->m_sb.sb_blocklog)
+#define XFS_B_TO_FSB(mp,b)     \
+       ((((__uint64_t)(b)) + (mp)->m_blockmask) >> (mp)->m_sb.sb_blocklog)
+#define XFS_B_TO_FSBT(mp,b)    (((__uint64_t)(b)) >> (mp)->m_sb.sb_blocklog)
+#define XFS_B_FSB_OFFSET(mp,b) ((b) & (mp)->m_blockmask)
+
 /*
  * Allocation group header
  *
index 4e029cc238e683d8cb4413ec7d1010eae4d451ed..964c465ca69c85f405db72b5781f61d48942ab0b 100644 (file)
@@ -22,7 +22,6 @@
 #include "xfs_log_format.h"
 #include "xfs_trans_resv.h"
 #include "xfs_bit.h"
-#include "xfs_sb.h"
 #include "xfs_mount.h"
 #include "xfs_inode.h"
 #include "xfs_btree.h"
index f63c455c3f6964c88515e53a947b3955a92d2298..002b6b3a19885057386d25bb0220dbd11f53ddfe 100644 (file)
@@ -21,7 +21,6 @@
 #include "xfs_format.h"
 #include "xfs_log_format.h"
 #include "xfs_trans_resv.h"
-#include "xfs_sb.h"
 #include "xfs_mount.h"
 #include "xfs_inode.h"
 #include "xfs_error.h"
index ab0659949a47b6dace5278d7283e57dd716415fb..8912d28eb43e731bbd5204ebaff63604e9ef34af 100644 (file)
@@ -23,7 +23,6 @@
 #include "xfs_log_format.h"
 #include "xfs_trans_resv.h"
 #include "xfs_inum.h"
-#include "xfs_sb.h"
 #include "xfs_mount.h"
 #include "xfs_inode.h"
 #include "xfs_trans.h"
index 1c250ee07dca689a5c6b18ca434377b5d1b65560..c10597973333ce44487c4c1c6723dac4ed2d38a3 100644 (file)
@@ -21,7 +21,6 @@
 #include "xfs_format.h"
 #include "xfs_log_format.h"
 #include "xfs_trans_resv.h"
-#include "xfs_sb.h"
 #include "xfs_mount.h"
 #include "xfs_da_format.h"
 #include "xfs_trans_space.h"
index ad3d1dc37d11ac9c448cfd281bdaceabc6ab8b01..9b59ffa1fc198d4934a575af40716837bc54c11b 100644 (file)
@@ -22,7 +22,6 @@
 #include "xfs_log_format.h"
 #include "xfs_trans_resv.h"
 #include "xfs_bit.h"
-#include "xfs_sb.h"
 #include "xfs_mount.h"
 #include "xfs_inode.h"
 #include "xfs_bmap.h"
index 2e739708afd3986ea0fccd5b85ff05834fd2a0bb..8eb1c54bafbf987e8b9bfd98abc858cd081cedd1 100644 (file)
 #ifndef __XFS_SB_H__
 #define        __XFS_SB_H__
 
-/*
- * Super block
- * Fits into a sector-sized buffer at address 0 of each allocation group.
- * Only the first of these is ever updated except during growfs.
- */
-
-struct xfs_buf;
-struct xfs_mount;
-struct xfs_trans;
-
-#define        XFS_SB_MAGIC            0x58465342      /* 'XFSB' */
-#define        XFS_SB_VERSION_1        1               /* 5.3, 6.0.1, 6.1 */
-#define        XFS_SB_VERSION_2        2               /* 6.2 - attributes */
-#define        XFS_SB_VERSION_3        3               /* 6.2 - new inode version */
-#define        XFS_SB_VERSION_4        4               /* 6.2+ - bitmask version */
-#define        XFS_SB_VERSION_5        5               /* CRC enabled filesystem */
-#define        XFS_SB_VERSION_NUMBITS          0x000f
-#define        XFS_SB_VERSION_ALLFBITS         0xfff0
-#define        XFS_SB_VERSION_ATTRBIT          0x0010
-#define        XFS_SB_VERSION_NLINKBIT         0x0020
-#define        XFS_SB_VERSION_QUOTABIT         0x0040
-#define        XFS_SB_VERSION_ALIGNBIT         0x0080
-#define        XFS_SB_VERSION_DALIGNBIT        0x0100
-#define        XFS_SB_VERSION_SHAREDBIT        0x0200
-#define XFS_SB_VERSION_LOGV2BIT                0x0400
-#define XFS_SB_VERSION_SECTORBIT       0x0800
-#define        XFS_SB_VERSION_EXTFLGBIT        0x1000
-#define        XFS_SB_VERSION_DIRV2BIT         0x2000
-#define        XFS_SB_VERSION_BORGBIT          0x4000  /* ASCII only case-insens. */
-#define        XFS_SB_VERSION_MOREBITSBIT      0x8000
-
-/*
- * Supported feature bit list is just all bits in the versionnum field because
- * we've used them all up and understand them all. Except, of course, for the
- * shared superblock bit, which nobody knows what it does and so is unsupported.
- */
-#define        XFS_SB_VERSION_OKBITS           \
-       ((XFS_SB_VERSION_NUMBITS | XFS_SB_VERSION_ALLFBITS) & \
-               ~XFS_SB_VERSION_SHAREDBIT)
-
-/*
- * There are two words to hold XFS "feature" bits: the original
- * word, sb_versionnum, and sb_features2.  Whenever a bit is set in
- * sb_features2, the feature bit XFS_SB_VERSION_MOREBITSBIT must be set.
- *
- * These defines represent bits in sb_features2.
- */
-#define XFS_SB_VERSION2_RESERVED1BIT   0x00000001
-#define XFS_SB_VERSION2_LAZYSBCOUNTBIT 0x00000002      /* Superblk counters */
-#define XFS_SB_VERSION2_RESERVED4BIT   0x00000004
-#define XFS_SB_VERSION2_ATTR2BIT       0x00000008      /* Inline attr rework */
-#define XFS_SB_VERSION2_PARENTBIT      0x00000010      /* parent pointers */
-#define XFS_SB_VERSION2_PROJID32BIT    0x00000080      /* 32 bit project id */
-#define XFS_SB_VERSION2_CRCBIT         0x00000100      /* metadata CRCs */
-#define XFS_SB_VERSION2_FTYPE          0x00000200      /* inode type in dir */
-
-#define        XFS_SB_VERSION2_OKBITS          \
-       (XFS_SB_VERSION2_LAZYSBCOUNTBIT | \
-        XFS_SB_VERSION2_ATTR2BIT       | \
-        XFS_SB_VERSION2_PROJID32BIT    | \
-        XFS_SB_VERSION2_FTYPE)
-
-/*
- * Superblock - in core version.  Must match the ondisk version below.
- * Must be padded to 64 bit alignment.
- */
-typedef struct xfs_sb {
-       __uint32_t      sb_magicnum;    /* magic number == XFS_SB_MAGIC */
-       __uint32_t      sb_blocksize;   /* logical block size, bytes */
-       xfs_rfsblock_t  sb_dblocks;     /* number of data blocks */
-       xfs_rfsblock_t  sb_rblocks;     /* number of realtime blocks */
-       xfs_rtblock_t   sb_rextents;    /* number of realtime extents */
-       uuid_t          sb_uuid;        /* file system unique id */
-       xfs_fsblock_t   sb_logstart;    /* starting block of log if internal */
-       xfs_ino_t       sb_rootino;     /* root inode number */
-       xfs_ino_t       sb_rbmino;      /* bitmap inode for realtime extents */
-       xfs_ino_t       sb_rsumino;     /* summary inode for rt bitmap */
-       xfs_agblock_t   sb_rextsize;    /* realtime extent size, blocks */
-       xfs_agblock_t   sb_agblocks;    /* size of an allocation group */
-       xfs_agnumber_t  sb_agcount;     /* number of allocation groups */
-       xfs_extlen_t    sb_rbmblocks;   /* number of rt bitmap blocks */
-       xfs_extlen_t    sb_logblocks;   /* number of log blocks */
-       __uint16_t      sb_versionnum;  /* header version == XFS_SB_VERSION */
-       __uint16_t      sb_sectsize;    /* volume sector size, bytes */
-       __uint16_t      sb_inodesize;   /* inode size, bytes */
-       __uint16_t      sb_inopblock;   /* inodes per block */
-       char            sb_fname[12];   /* file system name */
-       __uint8_t       sb_blocklog;    /* log2 of sb_blocksize */
-       __uint8_t       sb_sectlog;     /* log2 of sb_sectsize */
-       __uint8_t       sb_inodelog;    /* log2 of sb_inodesize */
-       __uint8_t       sb_inopblog;    /* log2 of sb_inopblock */
-       __uint8_t       sb_agblklog;    /* log2 of sb_agblocks (rounded up) */
-       __uint8_t       sb_rextslog;    /* log2 of sb_rextents */
-       __uint8_t       sb_inprogress;  /* mkfs is in progress, don't mount */
-       __uint8_t       sb_imax_pct;    /* max % of fs for inode space */
-                                       /* statistics */
-       /*
-        * These fields must remain contiguous.  If you really
-        * want to change their layout, make sure you fix the
-        * code in xfs_trans_apply_sb_deltas().
-        */
-       __uint64_t      sb_icount;      /* allocated inodes */
-       __uint64_t      sb_ifree;       /* free inodes */
-       __uint64_t      sb_fdblocks;    /* free data blocks */
-       __uint64_t      sb_frextents;   /* free realtime extents */
-       /*
-        * End contiguous fields.
-        */
-       xfs_ino_t       sb_uquotino;    /* user quota inode */
-       xfs_ino_t       sb_gquotino;    /* group quota inode */
-       __uint16_t      sb_qflags;      /* quota flags */
-       __uint8_t       sb_flags;       /* misc. flags */
-       __uint8_t       sb_shared_vn;   /* shared version number */
-       xfs_extlen_t    sb_inoalignmt;  /* inode chunk alignment, fsblocks */
-       __uint32_t      sb_unit;        /* stripe or raid unit */
-       __uint32_t      sb_width;       /* stripe or raid width */
-       __uint8_t       sb_dirblklog;   /* log2 of dir block size (fsbs) */
-       __uint8_t       sb_logsectlog;  /* log2 of the log sector size */
-       __uint16_t      sb_logsectsize; /* sector size for the log, bytes */
-       __uint32_t      sb_logsunit;    /* stripe unit size for the log */
-       __uint32_t      sb_features2;   /* additional feature bits */
-
-       /*
-        * bad features2 field as a result of failing to pad the sb
-        * structure to 64 bits. Some machines will be using this field
-        * for features2 bits. Easiest just to mark it bad and not use
-        * it for anything else.
-        */
-       __uint32_t      sb_bad_features2;
-
-       /* version 5 superblock fields start here */
-
-       /* feature masks */
-       __uint32_t      sb_features_compat;
-       __uint32_t      sb_features_ro_compat;
-       __uint32_t      sb_features_incompat;
-       __uint32_t      sb_features_log_incompat;
-
-       __uint32_t      sb_crc;         /* superblock crc */
-       __uint32_t      sb_pad;
-
-       xfs_ino_t       sb_pquotino;    /* project quota inode */
-       xfs_lsn_t       sb_lsn;         /* last write sequence */
-
-       /* must be padded to 64 bit alignment */
-} xfs_sb_t;
-
-#define XFS_SB_CRC_OFF         offsetof(struct xfs_sb, sb_crc)
-
-/*
- * Superblock - on disk version.  Must match the in core version above.
- * Must be padded to 64 bit alignment.
- */
-typedef struct xfs_dsb {
-       __be32          sb_magicnum;    /* magic number == XFS_SB_MAGIC */
-       __be32          sb_blocksize;   /* logical block size, bytes */
-       __be64          sb_dblocks;     /* number of data blocks */
-       __be64          sb_rblocks;     /* number of realtime blocks */
-       __be64          sb_rextents;    /* number of realtime extents */
-       uuid_t          sb_uuid;        /* file system unique id */
-       __be64          sb_logstart;    /* starting block of log if internal */
-       __be64          sb_rootino;     /* root inode number */
-       __be64          sb_rbmino;      /* bitmap inode for realtime extents */
-       __be64          sb_rsumino;     /* summary inode for rt bitmap */
-       __be32          sb_rextsize;    /* realtime extent size, blocks */
-       __be32          sb_agblocks;    /* size of an allocation group */
-       __be32          sb_agcount;     /* number of allocation groups */
-       __be32          sb_rbmblocks;   /* number of rt bitmap blocks */
-       __be32          sb_logblocks;   /* number of log blocks */
-       __be16          sb_versionnum;  /* header version == XFS_SB_VERSION */
-       __be16          sb_sectsize;    /* volume sector size, bytes */
-       __be16          sb_inodesize;   /* inode size, bytes */
-       __be16          sb_inopblock;   /* inodes per block */
-       char            sb_fname[12];   /* file system name */
-       __u8            sb_blocklog;    /* log2 of sb_blocksize */
-       __u8            sb_sectlog;     /* log2 of sb_sectsize */
-       __u8            sb_inodelog;    /* log2 of sb_inodesize */
-       __u8            sb_inopblog;    /* log2 of sb_inopblock */
-       __u8            sb_agblklog;    /* log2 of sb_agblocks (rounded up) */
-       __u8            sb_rextslog;    /* log2 of sb_rextents */
-       __u8            sb_inprogress;  /* mkfs is in progress, don't mount */
-       __u8            sb_imax_pct;    /* max % of fs for inode space */
-                                       /* statistics */
-       /*
-        * These fields must remain contiguous.  If you really
-        * want to change their layout, make sure you fix the
-        * code in xfs_trans_apply_sb_deltas().
-        */
-       __be64          sb_icount;      /* allocated inodes */
-       __be64          sb_ifree;       /* free inodes */
-       __be64          sb_fdblocks;    /* free data blocks */
-       __be64          sb_frextents;   /* free realtime extents */
-       /*
-        * End contiguous fields.
-        */
-       __be64          sb_uquotino;    /* user quota inode */
-       __be64          sb_gquotino;    /* group quota inode */
-       __be16          sb_qflags;      /* quota flags */
-       __u8            sb_flags;       /* misc. flags */
-       __u8            sb_shared_vn;   /* shared version number */
-       __be32          sb_inoalignmt;  /* inode chunk alignment, fsblocks */
-       __be32          sb_unit;        /* stripe or raid unit */
-       __be32          sb_width;       /* stripe or raid width */
-       __u8            sb_dirblklog;   /* log2 of dir block size (fsbs) */
-       __u8            sb_logsectlog;  /* log2 of the log sector size */
-       __be16          sb_logsectsize; /* sector size for the log, bytes */
-       __be32          sb_logsunit;    /* stripe unit size for the log */
-       __be32          sb_features2;   /* additional feature bits */
-       /*
-        * bad features2 field as a result of failing to pad the sb
-        * structure to 64 bits. Some machines will be using this field
-        * for features2 bits. Easiest just to mark it bad and not use
-        * it for anything else.
-        */
-       __be32          sb_bad_features2;
-
-       /* version 5 superblock fields start here */
-
-       /* feature masks */
-       __be32          sb_features_compat;
-       __be32          sb_features_ro_compat;
-       __be32          sb_features_incompat;
-       __be32          sb_features_log_incompat;
-
-       __le32          sb_crc;         /* superblock crc */
-       __be32          sb_pad;
-
-       __be64          sb_pquotino;    /* project quota inode */
-       __be64          sb_lsn;         /* last write sequence */
-
-       /* must be padded to 64 bit alignment */
-} xfs_dsb_t;
-
-/*
- * Sequence number values for the fields.
- */
-typedef enum {
-       XFS_SBS_MAGICNUM, XFS_SBS_BLOCKSIZE, XFS_SBS_DBLOCKS, XFS_SBS_RBLOCKS,
-       XFS_SBS_REXTENTS, XFS_SBS_UUID, XFS_SBS_LOGSTART, XFS_SBS_ROOTINO,
-       XFS_SBS_RBMINO, XFS_SBS_RSUMINO, XFS_SBS_REXTSIZE, XFS_SBS_AGBLOCKS,
-       XFS_SBS_AGCOUNT, XFS_SBS_RBMBLOCKS, XFS_SBS_LOGBLOCKS,
-       XFS_SBS_VERSIONNUM, XFS_SBS_SECTSIZE, XFS_SBS_INODESIZE,
-       XFS_SBS_INOPBLOCK, XFS_SBS_FNAME, XFS_SBS_BLOCKLOG,
-       XFS_SBS_SECTLOG, XFS_SBS_INODELOG, XFS_SBS_INOPBLOG, XFS_SBS_AGBLKLOG,
-       XFS_SBS_REXTSLOG, XFS_SBS_INPROGRESS, XFS_SBS_IMAX_PCT, XFS_SBS_ICOUNT,
-       XFS_SBS_IFREE, XFS_SBS_FDBLOCKS, XFS_SBS_FREXTENTS, XFS_SBS_UQUOTINO,
-       XFS_SBS_GQUOTINO, XFS_SBS_QFLAGS, XFS_SBS_FLAGS, XFS_SBS_SHARED_VN,
-       XFS_SBS_INOALIGNMT, XFS_SBS_UNIT, XFS_SBS_WIDTH, XFS_SBS_DIRBLKLOG,
-       XFS_SBS_LOGSECTLOG, XFS_SBS_LOGSECTSIZE, XFS_SBS_LOGSUNIT,
-       XFS_SBS_FEATURES2, XFS_SBS_BAD_FEATURES2, XFS_SBS_FEATURES_COMPAT,
-       XFS_SBS_FEATURES_RO_COMPAT, XFS_SBS_FEATURES_INCOMPAT,
-       XFS_SBS_FEATURES_LOG_INCOMPAT, XFS_SBS_CRC, XFS_SBS_PAD,
-       XFS_SBS_PQUOTINO, XFS_SBS_LSN,
-       XFS_SBS_FIELDCOUNT
-} xfs_sb_field_t;
-
-/*
- * Mask values, defined based on the xfs_sb_field_t values.
- * Only define the ones we're using.
- */
-#define        XFS_SB_MVAL(x)          (1LL << XFS_SBS_ ## x)
-#define        XFS_SB_UUID             XFS_SB_MVAL(UUID)
-#define        XFS_SB_FNAME            XFS_SB_MVAL(FNAME)
-#define        XFS_SB_ROOTINO          XFS_SB_MVAL(ROOTINO)
-#define        XFS_SB_RBMINO           XFS_SB_MVAL(RBMINO)
-#define        XFS_SB_RSUMINO          XFS_SB_MVAL(RSUMINO)
-#define        XFS_SB_VERSIONNUM       XFS_SB_MVAL(VERSIONNUM)
-#define XFS_SB_UQUOTINO                XFS_SB_MVAL(UQUOTINO)
-#define XFS_SB_GQUOTINO                XFS_SB_MVAL(GQUOTINO)
-#define XFS_SB_QFLAGS          XFS_SB_MVAL(QFLAGS)
-#define XFS_SB_SHARED_VN       XFS_SB_MVAL(SHARED_VN)
-#define XFS_SB_UNIT            XFS_SB_MVAL(UNIT)
-#define XFS_SB_WIDTH           XFS_SB_MVAL(WIDTH)
-#define XFS_SB_ICOUNT          XFS_SB_MVAL(ICOUNT)
-#define XFS_SB_IFREE           XFS_SB_MVAL(IFREE)
-#define XFS_SB_FDBLOCKS                XFS_SB_MVAL(FDBLOCKS)
-#define XFS_SB_FEATURES2       XFS_SB_MVAL(FEATURES2)
-#define XFS_SB_BAD_FEATURES2   XFS_SB_MVAL(BAD_FEATURES2)
-#define XFS_SB_FEATURES_COMPAT XFS_SB_MVAL(FEATURES_COMPAT)
-#define XFS_SB_FEATURES_RO_COMPAT XFS_SB_MVAL(FEATURES_RO_COMPAT)
-#define XFS_SB_FEATURES_INCOMPAT XFS_SB_MVAL(FEATURES_INCOMPAT)
-#define XFS_SB_FEATURES_LOG_INCOMPAT XFS_SB_MVAL(FEATURES_LOG_INCOMPAT)
-#define XFS_SB_CRC             XFS_SB_MVAL(CRC)
-#define XFS_SB_PQUOTINO                XFS_SB_MVAL(PQUOTINO)
-#define        XFS_SB_NUM_BITS         ((int)XFS_SBS_FIELDCOUNT)
-#define        XFS_SB_ALL_BITS         ((1LL << XFS_SB_NUM_BITS) - 1)
-#define        XFS_SB_MOD_BITS         \
-       (XFS_SB_UUID | XFS_SB_ROOTINO | XFS_SB_RBMINO | XFS_SB_RSUMINO | \
-        XFS_SB_VERSIONNUM | XFS_SB_UQUOTINO | XFS_SB_GQUOTINO | \
-        XFS_SB_QFLAGS | XFS_SB_SHARED_VN | XFS_SB_UNIT | XFS_SB_WIDTH | \
-        XFS_SB_ICOUNT | XFS_SB_IFREE | XFS_SB_FDBLOCKS | XFS_SB_FEATURES2 | \
-        XFS_SB_BAD_FEATURES2 | XFS_SB_FEATURES_COMPAT | \
-        XFS_SB_FEATURES_RO_COMPAT | XFS_SB_FEATURES_INCOMPAT | \
-        XFS_SB_FEATURES_LOG_INCOMPAT | XFS_SB_PQUOTINO)
-
-
-/*
- * Misc. Flags - warning - these will be cleared by xfs_repair unless
- * a feature bit is set when the flag is used.
- */
-#define XFS_SBF_NOFLAGS                0x00    /* no flags set */
-#define XFS_SBF_READONLY       0x01    /* only read-only mounts allowed */
-
-/*
- * define max. shared version we can interoperate with
- */
-#define XFS_SB_MAX_SHARED_VN   0
-
-#define        XFS_SB_VERSION_NUM(sbp) ((sbp)->sb_versionnum & XFS_SB_VERSION_NUMBITS)
-
-/*
- * The first XFS version we support is a v4 superblock with V2 directories.
- */
-static inline bool xfs_sb_good_v4_features(struct xfs_sb *sbp)
-{
-       if (!(sbp->sb_versionnum & XFS_SB_VERSION_DIRV2BIT))
-               return false;
-
-       /* check for unknown features in the fs */
-       if ((sbp->sb_versionnum & ~XFS_SB_VERSION_OKBITS) ||
-           ((sbp->sb_versionnum & XFS_SB_VERSION_MOREBITSBIT) &&
-            (sbp->sb_features2 & ~XFS_SB_VERSION2_OKBITS)))
-               return false;
-
-       return true;
-}
-
-static inline bool xfs_sb_good_version(struct xfs_sb *sbp)
-{
-       if (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_5)
-               return true;
-       if (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4)
-               return xfs_sb_good_v4_features(sbp);
-       return false;
-}
-
-/*
- * Detect a mismatched features2 field.  Older kernels read/wrote
- * this into the wrong slot, so to be safe we keep them in sync.
- */
-static inline bool xfs_sb_has_mismatched_features2(struct xfs_sb *sbp)
-{
-       return sbp->sb_bad_features2 != sbp->sb_features2;
-}
-
-static inline bool xfs_sb_version_hasattr(struct xfs_sb *sbp)
-{
-       return (sbp->sb_versionnum & XFS_SB_VERSION_ATTRBIT);
-}
-
-static inline void xfs_sb_version_addattr(struct xfs_sb *sbp)
-{
-       sbp->sb_versionnum |= XFS_SB_VERSION_ATTRBIT;
-}
-
-static inline bool xfs_sb_version_hasquota(struct xfs_sb *sbp)
-{
-       return (sbp->sb_versionnum & XFS_SB_VERSION_QUOTABIT);
-}
-
-static inline void xfs_sb_version_addquota(struct xfs_sb *sbp)
-{
-       sbp->sb_versionnum |= XFS_SB_VERSION_QUOTABIT;
-}
-
-static inline bool xfs_sb_version_hasalign(struct xfs_sb *sbp)
-{
-       return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_5 ||
-               (sbp->sb_versionnum & XFS_SB_VERSION_ALIGNBIT));
-}
-
-static inline bool xfs_sb_version_hasdalign(struct xfs_sb *sbp)
-{
-       return (sbp->sb_versionnum & XFS_SB_VERSION_DALIGNBIT);
-}
-
-static inline bool xfs_sb_version_haslogv2(struct xfs_sb *sbp)
-{
-       return XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_5 ||
-              (sbp->sb_versionnum & XFS_SB_VERSION_LOGV2BIT);
-}
-
-static inline bool xfs_sb_version_hasextflgbit(struct xfs_sb *sbp)
-{
-       return XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_5 ||
-              (sbp->sb_versionnum & XFS_SB_VERSION_EXTFLGBIT);
-}
-
-static inline bool xfs_sb_version_hassector(struct xfs_sb *sbp)
-{
-       return (sbp->sb_versionnum & XFS_SB_VERSION_SECTORBIT);
-}
-
-static inline bool xfs_sb_version_hasasciici(struct xfs_sb *sbp)
-{
-       return (sbp->sb_versionnum & XFS_SB_VERSION_BORGBIT);
-}
-
-static inline bool xfs_sb_version_hasmorebits(struct xfs_sb *sbp)
-{
-       return XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_5 ||
-              (sbp->sb_versionnum & XFS_SB_VERSION_MOREBITSBIT);
-}
-
-/*
- * sb_features2 bit version macros.
- */
-static inline bool xfs_sb_version_haslazysbcount(struct xfs_sb *sbp)
-{
-       return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_5) ||
-              (xfs_sb_version_hasmorebits(sbp) &&
-               (sbp->sb_features2 & XFS_SB_VERSION2_LAZYSBCOUNTBIT));
-}
-
-static inline bool xfs_sb_version_hasattr2(struct xfs_sb *sbp)
-{
-       return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_5) ||
-              (xfs_sb_version_hasmorebits(sbp) &&
-               (sbp->sb_features2 & XFS_SB_VERSION2_ATTR2BIT));
-}
-
-static inline void xfs_sb_version_addattr2(struct xfs_sb *sbp)
-{
-       sbp->sb_versionnum |= XFS_SB_VERSION_MOREBITSBIT;
-       sbp->sb_features2 |= XFS_SB_VERSION2_ATTR2BIT;
-       sbp->sb_bad_features2 |= XFS_SB_VERSION2_ATTR2BIT;
-}
-
-static inline void xfs_sb_version_removeattr2(struct xfs_sb *sbp)
-{
-       sbp->sb_features2 &= ~XFS_SB_VERSION2_ATTR2BIT;
-       sbp->sb_bad_features2 &= ~XFS_SB_VERSION2_ATTR2BIT;
-       if (!sbp->sb_features2)
-               sbp->sb_versionnum &= ~XFS_SB_VERSION_MOREBITSBIT;
-}
-
-static inline bool xfs_sb_version_hasprojid32bit(struct xfs_sb *sbp)
-{
-       return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_5) ||
-              (xfs_sb_version_hasmorebits(sbp) &&
-               (sbp->sb_features2 & XFS_SB_VERSION2_PROJID32BIT));
-}
-
-static inline void xfs_sb_version_addprojid32bit(struct xfs_sb *sbp)
-{
-       sbp->sb_versionnum |= XFS_SB_VERSION_MOREBITSBIT;
-       sbp->sb_features2 |= XFS_SB_VERSION2_PROJID32BIT;
-       sbp->sb_bad_features2 |= XFS_SB_VERSION2_PROJID32BIT;
-}
-
-/*
- * Extended v5 superblock feature masks. These are to be used for new v5
- * superblock features only.
- *
- * Compat features are new features that old kernels will not notice or affect
- * and so can mount read-write without issues.
- *
- * RO-Compat (read only) are features that old kernels can read but will break
- * if they write. Hence only read-only mounts of such filesystems are allowed on
- * kernels that don't support the feature bit.
- *
- * InCompat features are features which old kernels will not understand and so
- * must not mount.
- *
- * Log-InCompat features are for changes to log formats or new transactions that
- * can't be replayed on older kernels. The fields are set when the filesystem is
- * mounted, and a clean unmount clears the fields.
- */
-#define XFS_SB_FEAT_COMPAT_ALL 0
-#define XFS_SB_FEAT_COMPAT_UNKNOWN     ~XFS_SB_FEAT_COMPAT_ALL
-static inline bool
-xfs_sb_has_compat_feature(
-       struct xfs_sb   *sbp,
-       __uint32_t      feature)
-{
-       return (sbp->sb_features_compat & feature) != 0;
-}
-
-#define XFS_SB_FEAT_RO_COMPAT_FINOBT   (1 << 0)                /* free inode btree */
-#define XFS_SB_FEAT_RO_COMPAT_ALL \
-               (XFS_SB_FEAT_RO_COMPAT_FINOBT)
-#define XFS_SB_FEAT_RO_COMPAT_UNKNOWN  ~XFS_SB_FEAT_RO_COMPAT_ALL
-static inline bool
-xfs_sb_has_ro_compat_feature(
-       struct xfs_sb   *sbp,
-       __uint32_t      feature)
-{
-       return (sbp->sb_features_ro_compat & feature) != 0;
-}
-
-#define XFS_SB_FEAT_INCOMPAT_FTYPE     (1 << 0)        /* filetype in dirent */
-#define XFS_SB_FEAT_INCOMPAT_ALL \
-               (XFS_SB_FEAT_INCOMPAT_FTYPE)
-
-#define XFS_SB_FEAT_INCOMPAT_UNKNOWN   ~XFS_SB_FEAT_INCOMPAT_ALL
-static inline bool
-xfs_sb_has_incompat_feature(
-       struct xfs_sb   *sbp,
-       __uint32_t      feature)
-{
-       return (sbp->sb_features_incompat & feature) != 0;
-}
-
-#define XFS_SB_FEAT_INCOMPAT_LOG_ALL 0
-#define XFS_SB_FEAT_INCOMPAT_LOG_UNKNOWN       ~XFS_SB_FEAT_INCOMPAT_LOG_ALL
-static inline bool
-xfs_sb_has_incompat_log_feature(
-       struct xfs_sb   *sbp,
-       __uint32_t      feature)
-{
-       return (sbp->sb_features_log_incompat & feature) != 0;
-}
-
-/*
- * V5 superblock specific feature checks
- */
-static inline int xfs_sb_version_hascrc(struct xfs_sb *sbp)
-{
-       return XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_5;
-}
-
-static inline int xfs_sb_version_has_pquotino(struct xfs_sb *sbp)
-{
-       return XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_5;
-}
-
-static inline int xfs_sb_version_hasftype(struct xfs_sb *sbp)
-{
-       return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_5 &&
-               xfs_sb_has_incompat_feature(sbp, XFS_SB_FEAT_INCOMPAT_FTYPE)) ||
-              (xfs_sb_version_hasmorebits(sbp) &&
-                (sbp->sb_features2 & XFS_SB_VERSION2_FTYPE));
-}
-
-static inline int xfs_sb_version_hasfinobt(xfs_sb_t *sbp)
-{
-       return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_5) &&
-               (sbp->sb_features_ro_compat & XFS_SB_FEAT_RO_COMPAT_FINOBT);
-}
-
-/*
- * end of superblock version macros
- */
-
-static inline bool
-xfs_is_quota_inode(struct xfs_sb *sbp, xfs_ino_t ino)
-{
-       return (ino == sbp->sb_uquotino ||
-               ino == sbp->sb_gquotino ||
-               ino == sbp->sb_pquotino);
-}
-
-#define XFS_SB_DADDR           ((xfs_daddr_t)0) /* daddr in filesystem/ag */
-#define        XFS_SB_BLOCK(mp)        XFS_HDR_BLOCK(mp, XFS_SB_DADDR)
-#define XFS_BUF_TO_SBP(bp)     ((xfs_dsb_t *)((bp)->b_addr))
-
-#define        XFS_HDR_BLOCK(mp,d)     ((xfs_agblock_t)XFS_BB_TO_FSBT(mp,d))
-#define        XFS_DADDR_TO_FSB(mp,d)  XFS_AGB_TO_FSB(mp, \
-                       xfs_daddr_to_agno(mp,d), xfs_daddr_to_agbno(mp,d))
-#define        XFS_FSB_TO_DADDR(mp,fsbno)      XFS_AGB_TO_DADDR(mp, \
-                       XFS_FSB_TO_AGNO(mp,fsbno), XFS_FSB_TO_AGBNO(mp,fsbno))
-
-/*
- * File system sector to basic block conversions.
- */
-#define XFS_FSS_TO_BB(mp,sec)  ((sec) << (mp)->m_sectbb_log)
-
-/*
- * File system block to basic block conversions.
- */
-#define        XFS_FSB_TO_BB(mp,fsbno) ((fsbno) << (mp)->m_blkbb_log)
-#define        XFS_BB_TO_FSB(mp,bb)    \
-       (((bb) + (XFS_FSB_TO_BB(mp,1) - 1)) >> (mp)->m_blkbb_log)
-#define        XFS_BB_TO_FSBT(mp,bb)   ((bb) >> (mp)->m_blkbb_log)
-
-/*
- * File system block to byte conversions.
- */
-#define XFS_FSB_TO_B(mp,fsbno) ((xfs_fsize_t)(fsbno) << (mp)->m_sb.sb_blocklog)
-#define XFS_B_TO_FSB(mp,b)     \
-       ((((__uint64_t)(b)) + (mp)->m_blockmask) >> (mp)->m_sb.sb_blocklog)
-#define XFS_B_TO_FSBT(mp,b)    (((__uint64_t)(b)) >> (mp)->m_sb.sb_blocklog)
-#define XFS_B_FSB_OFFSET(mp,b) ((b) & (mp)->m_blockmask)
-
 /*
  * perag get/put wrappers for ref counting
  */
index 87ee2996379c367d459d30f73a61a110bdbb1a64..c80c5236c3da73ba0c22b5abb1f441848e0ea689 100644 (file)
@@ -22,7 +22,6 @@
 #include "xfs_log_format.h"
 #include "xfs_shared.h"
 #include "xfs_trans_resv.h"
-#include "xfs_sb.h"
 #include "xfs_mount.h"
 #include "xfs_bmap_btree.h"
 #include "xfs_inode.h"
index f2a03e5dec96a38964df8750de290416c1aa9ee1..6c1330f29050e4036d7974cdd2cf4fd54549880c 100644 (file)
@@ -22,7 +22,6 @@
 #include "xfs_format.h"
 #include "xfs_log_format.h"
 #include "xfs_trans_resv.h"
-#include "xfs_sb.h"
 #include "xfs_mount.h"
 #include "xfs_da_format.h"
 #include "xfs_da_btree.h"
index 66cd043d91651ab835b2279a086fa79c7312f4ce..4b641676f258d7ac76c4462a562cc4406b89d882 100644 (file)
@@ -19,7 +19,6 @@
 #include "xfs_format.h"
 #include "xfs_log_format.h"
 #include "xfs_trans_resv.h"
-#include "xfs_sb.h"
 #include "xfs_mount.h"
 #include "xfs_inode.h"
 #include "xfs_acl.h"
index 183b634dc432ee56c1892b0a8ab76dc08e66b4f0..18e2f3bbae5e7a52a962190d97ea1902a24734f2 100644 (file)
@@ -20,7 +20,6 @@
 #include "xfs_format.h"
 #include "xfs_log_format.h"
 #include "xfs_trans_resv.h"
-#include "xfs_sb.h"
 #include "xfs_mount.h"
 #include "xfs_inode.h"
 #include "xfs_trans.h"
index b466388358a2f97a0ab23af555650c87b6054322..83af4c14963579b3a8377e43c54e4cd0825ca236 100644 (file)
@@ -23,7 +23,6 @@
 #include "xfs_log_format.h"
 #include "xfs_trans_resv.h"
 #include "xfs_bit.h"
-#include "xfs_sb.h"
 #include "xfs_mount.h"
 #include "xfs_da_format.h"
 #include "xfs_da_btree.h"
index 13dce2b196828740aef1304400be2a181601d048..a43d370d2c5887c689844a66c787785fef608808 100644 (file)
@@ -22,7 +22,6 @@
 #include "xfs_log_format.h"
 #include "xfs_trans_resv.h"
 #include "xfs_bit.h"
-#include "xfs_sb.h"
 #include "xfs_mount.h"
 #include "xfs_da_format.h"
 #include "xfs_da_btree.h"
index 6df4730ef5c308bfbd33c143c2d0faab309b411d..a68110eed65ef0578fbd1774f2f281a5b6a4d574 100644 (file)
@@ -23,7 +23,6 @@
 #include "xfs_log_format.h"
 #include "xfs_trans_resv.h"
 #include "xfs_bit.h"
-#include "xfs_sb.h"
 #include "xfs_mount.h"
 #include "xfs_da_format.h"
 #include "xfs_inode.h"
index 09b0eb723590a9a889a1ef7fe9263fb67002f16a..b5a10d2e9aefa813ebc66900d665772b292b2cef 100644 (file)
@@ -22,7 +22,6 @@
 #include "xfs_log_format.h"
 #include "xfs_trans_resv.h"
 #include "xfs_bit.h"
-#include "xfs_sb.h"
 #include "xfs_mount.h"
 #include "xfs_da_format.h"
 #include "xfs_da_btree.h"
index 222168493ac48820fafa2a491c1d804833428c8f..02c01bbbc7899410e9d23f423c51086d23afa940 100644 (file)
@@ -22,7 +22,6 @@
 #include "xfs_shared.h"
 #include "xfs_trans_resv.h"
 #include "xfs_bit.h"
-#include "xfs_sb.h"
 #include "xfs_mount.h"
 #include "xfs_inode.h"
 #include "xfs_bmap.h"
index 1f87bc8166f37bcdaee49821bd05446bc598ecee..814cff94e78f6752bb9bf70d61697320c409f9e7 100644 (file)
@@ -20,7 +20,6 @@
 #include "xfs_format.h"
 #include "xfs_log_format.h"
 #include "xfs_trans_resv.h"
-#include "xfs_sb.h"
 #include "xfs_mount.h"
 #include "xfs_inode.h"
 #include "xfs_quota.h"
index f5d90eda78fb6f8a81a675eaa0e0bb6857881a8d..3ee186ac10938855965a5907c93de487e83851bf 100644 (file)
@@ -20,7 +20,6 @@
 #include "xfs_fs.h"
 #include "xfs_log_format.h"
 #include "xfs_trans_resv.h"
-#include "xfs_sb.h"
 #include "xfs_mount.h"
 #include "xfs_error.h"
 
index 73172e1bd399410ebc6ff276e86fae4216139860..0a0a6fa11ce14885addd81a767b7edf46d45ea44 100644 (file)
@@ -19,7 +19,6 @@
 #include "xfs_format.h"
 #include "xfs_log_format.h"
 #include "xfs_trans_resv.h"
-#include "xfs_sb.h"
 #include "xfs_mount.h"
 #include "xfs_da_format.h"
 #include "xfs_dir2.h"
index e751c607400009c83f811a198e77e1399f7532bb..cb7fe64cdbfa0d2cb41c4389ab1b03005c0bbe36 100644 (file)
@@ -20,7 +20,6 @@
 #include "xfs_format.h"
 #include "xfs_log_format.h"
 #include "xfs_trans_resv.h"
-#include "xfs_sb.h"
 #include "xfs_mount.h"
 #include "xfs_trans.h"
 #include "xfs_trans_priv.h"
index 69b7dd3165425c8af6386feb06ed1b27b0b0d0c9..e2b1a8116f1ca731dfbf61d1703a962eced6c264 100644 (file)
@@ -21,7 +21,6 @@
 #include "xfs_format.h"
 #include "xfs_log_format.h"
 #include "xfs_trans_resv.h"
-#include "xfs_sb.h"
 #include "xfs_mount.h"
 #include "xfs_da_format.h"
 #include "xfs_da_btree.h"
index 131b0432f77ec88f035cdebca73f39b0b687b71c..d45ca72af6fbcbc6bb0d97a91b6467a930ace4a2 100644 (file)
@@ -22,7 +22,6 @@
 #include "xfs_log_format.h"
 #include "xfs_trans_resv.h"
 #include "xfs_bit.h"
-#include "xfs_sb.h"
 #include "xfs_mount.h"
 #include "xfs_trans.h"
 #include "xfs_trans_priv.h"
index 0bd3af61e09c9b7f5de392504dcaaad9512202b2..bf13a5a7e2f4ffd90d1ae65402a240ac81e80349 100644 (file)
@@ -20,7 +20,6 @@
 #include "xfs_format.h"
 #include "xfs_log_format.h"
 #include "xfs_trans_resv.h"
-#include "xfs_sb.h"
 #include "xfs_mount.h"
 #include "xfs_inode.h"
 #include "xfs_trans.h"
index d2175b60f2322c7887e9e5996caf41ad18715d19..a1831980a68e13adec9ac54a322cb835f81bb969 100644 (file)
@@ -21,7 +21,6 @@
 #include "xfs_format.h"
 #include "xfs_log_format.h"
 #include "xfs_trans_resv.h"
-#include "xfs_sb.h"
 #include "xfs_mount.h"
 #include "xfs_inode.h"
 #include "xfs_ioctl.h"
index 9a36ee0113d149cf6a9b6b7725fe2d1e258db6aa..ec6772866f3d227d6fe916a74dd9fe331c855ecc 100644 (file)
@@ -25,7 +25,6 @@
 #include "xfs_format.h"
 #include "xfs_log_format.h"
 #include "xfs_trans_resv.h"
-#include "xfs_sb.h"
 #include "xfs_mount.h"
 #include "xfs_inode.h"
 #include "xfs_itable.h"
index 7ab365a960172aaacaed19244219fdc91cab8cc6..2262ce32926a580dbaa5c7318b8dd013b459f177 100644 (file)
@@ -21,7 +21,6 @@
 #include "xfs_format.h"
 #include "xfs_log_format.h"
 #include "xfs_trans_resv.h"
-#include "xfs_sb.h"
 #include "xfs_mount.h"
 #include "xfs_inode.h"
 #include "xfs_btree.h"
index 55aa9e8d79b97f08d170fb278115e5426b62fffd..f14a3e5e4a0aeb149191e7c17d140f2700c2240e 100644 (file)
@@ -21,7 +21,6 @@
 #include "xfs_format.h"
 #include "xfs_log_format.h"
 #include "xfs_trans_resv.h"
-#include "xfs_sb.h"
 #include "xfs_mount.h"
 #include "xfs_da_format.h"
 #include "xfs_inode.h"
index 2b92694926df0a975cd8a9f1eb4306c8a2463c97..584feee3edb7bf30798570ad556f75c483e580af 100644 (file)
@@ -22,7 +22,6 @@
 #include "xfs_log_format.h"
 #include "xfs_trans_resv.h"
 #include "xfs_inum.h"
-#include "xfs_sb.h"
 #include "xfs_mount.h"
 #include "xfs_inode.h"
 #include "xfs_btree.h"
index 765f32ebed4c9c52ae83afc4e4089b5eb33102a5..bfeb442ef8272307ee23b4bb629601e5d2afd9d0 100644 (file)
@@ -21,7 +21,6 @@
 #include "xfs_format.h"
 #include "xfs_log_format.h"
 #include "xfs_trans_resv.h"
-#include "xfs_sb.h"
 #include "xfs_mount.h"
 #include "xfs_error.h"
 #include "xfs_trans.h"
index 951c08fac0e7aff4b220083cbe070ecea73ecda0..45cc0ce18adf04cac50fe801884439a246285443 100644 (file)
@@ -21,7 +21,6 @@
 #include "xfs_log_format.h"
 #include "xfs_shared.h"
 #include "xfs_trans_resv.h"
-#include "xfs_sb.h"
 #include "xfs_mount.h"
 #include "xfs_error.h"
 #include "xfs_alloc.h"
index 8abc2d5643e1ee6929af1bdbcdf10d75b68d1877..d8b67547ab343ab9eded15a2d56113d001b73224 100644 (file)
@@ -20,7 +20,6 @@
 #include "xfs_format.h"
 #include "xfs_log_format.h"
 #include "xfs_trans_resv.h"
-#include "xfs_sb.h"
 #include "xfs_mount.h"
 
 /*
index b781dc57e7a61f002e8411b2b1c93c1890d913ae..3e52d5de7ae1e64dcd62c9faf29d10620ac2fe67 100644 (file)
@@ -20,7 +20,6 @@
 #include "xfs_format.h"
 #include "xfs_log_format.h"
 #include "xfs_trans_resv.h"
-#include "xfs_sb.h"
 #include "xfs_quota.h"
 #include "xfs_mount.h"
 #include "xfs_inode.h"
index 7638439940266ad3da711812e28928183657b612..7542bbeca6a12b18ae1162a51a8dd97f6c35790e 100644 (file)
@@ -19,7 +19,6 @@
 #include "xfs_format.h"
 #include "xfs_log_format.h"
 #include "xfs_trans_resv.h"
-#include "xfs_sb.h"
 #include "xfs_mount.h"
 #include "xfs_inode.h"
 #include "xfs_quota.h"
index cb93a7231baf58a322042b310328a4561bca096a..f2079b6911cc84dd50122380eb1b540a6ae9612c 100644 (file)
@@ -22,7 +22,6 @@
 #include "xfs_log_format.h"
 #include "xfs_trans_resv.h"
 #include "xfs_bit.h"
-#include "xfs_sb.h"
 #include "xfs_mount.h"
 #include "xfs_inode.h"
 #include "xfs_bmap.h"
index 99bc12927999d4a9e5a9f20fc8dc0bb7c2ef7b37..25791df6f638c7a77421840e07b35204a5589f3f 100644 (file)
@@ -23,7 +23,6 @@
 #include "xfs_log_format.h"
 #include "xfs_trans_resv.h"
 #include "xfs_bit.h"
-#include "xfs_sb.h"
 #include "xfs_mount.h"
 #include "xfs_da_format.h"
 #include "xfs_da_btree.h"
index 017051a10d1ca2f29d50645e4b41bf2799bada33..13a029806805fe680a919923841c636dcc64934a 100644 (file)
@@ -21,7 +21,6 @@
 #include "xfs_format.h"
 #include "xfs_log_format.h"
 #include "xfs_trans_resv.h"
-#include "xfs_sb.h"
 #include "xfs_mount.h"
 #include "xfs_da_format.h"
 #include "xfs_inode.h"
index 02df25d607d8c570cd38821aea2951b5b9276c8f..fa3135b9bf04b4adf1e6581165b8f5e159d4b9a3 100644 (file)
@@ -22,7 +22,6 @@
 #include "xfs_format.h"
 #include "xfs_log_format.h"
 #include "xfs_trans_resv.h"
-#include "xfs_sb.h"
 #include "xfs_mount.h"
 #include "xfs_inode.h"
 #include "xfs_extent_busy.h"
index dd828d6fa15ad220069db37a2b62c595c66a88dc..573aefb5a5731d37fa79fa6fb8a522fb29a43848 100644 (file)
@@ -21,7 +21,6 @@
 #include "xfs_format.h"
 #include "xfs_log_format.h"
 #include "xfs_trans_resv.h"
-#include "xfs_sb.h"
 #include "xfs_mount.h"
 #include "xfs_trans.h"
 #include "xfs_trans_priv.h"
index f9192b03d57049d276030ff0207d512c6d3a839f..d3d80bef59e196b2129e60bcfb8b3c62e4c85b00 100644 (file)
@@ -21,7 +21,6 @@
 #include "xfs_format.h"
 #include "xfs_log_format.h"
 #include "xfs_trans_resv.h"
-#include "xfs_sb.h"
 #include "xfs_mount.h"
 #include "xfs_inode.h"
 #include "xfs_trans.h"
index 6320e287e5270ac9d23d3394094de51afa6655e3..76a16df55ef72ef11274cd2e25dc07bc8326dfdd 100644 (file)
@@ -21,7 +21,6 @@
 #include "xfs_format.h"
 #include "xfs_log_format.h"
 #include "xfs_trans_resv.h"
-#include "xfs_sb.h"
 #include "xfs_mount.h"
 #include "xfs_inode.h"
 #include "xfs_error.h"
index a0aaa3e3d2b01f2b6ff37514b8b4a54c10e51632..284397dd7990d83cb7be11be4a0424bbd7cc1a9c 100644 (file)
@@ -21,7 +21,6 @@
 #include "xfs_format.h"
 #include "xfs_log_format.h"
 #include "xfs_trans_resv.h"
-#include "xfs_sb.h"
 #include "xfs_mount.h"
 #include "xfs_trans.h"
 #include "xfs_trans_priv.h"
index 592904b0262b8c48a14d493a3df751972593e030..17280cd71934b3eff4ea11f44639d763042238a2 100644 (file)
@@ -21,7 +21,6 @@
 #include "xfs_format.h"
 #include "xfs_log_format.h"
 #include "xfs_trans_resv.h"
-#include "xfs_sb.h"
 #include "xfs_mount.h"
 #include "xfs_inode.h"
 #include "xfs_trans.h"
index 30c6158a037cd9099cd836b9666ddeb6ba69fb81..69f6e475de97cacba39f85cdd0c2058539260447 100644 (file)
@@ -20,7 +20,6 @@
 #include "xfs_format.h"
 #include "xfs_log_format.h"
 #include "xfs_trans_resv.h"
-#include "xfs_sb.h"
 #include "xfs_mount.h"
 #include "xfs_da_format.h"
 #include "xfs_inode.h"