aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2017-12-06 17:28:03 -0600
committerEric Sandeen <sandeen@redhat.com>2017-12-06 17:28:03 -0600
commit4eee66c596363e9f98ec7098dffd320e1bca8076 (patch)
tree361e9d86c8fe50175ff1f9cd6bfcbccb3dd4aa55
parentdafb318d937656cf2fa2bf058579d4e5b7789377 (diff)
downloadxfsprogs-dev-4eee66c596363e9f98ec7098dffd320e1bca8076.tar.gz
mkfs: tidy up definitions
Put all the internal macro definitions at the top of the file so they can be easily found and remove teh ones that aren't used anymore. Signed-Off-By: Dave Chinner <dchinner@redhat.com> Reviewed-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
-rw-r--r--mkfs/xfs_mkfs.c41
1 files changed, 17 insertions, 24 deletions
diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c
index cc70d110ed..e38810f533 100644
--- a/mkfs/xfs_mkfs.c
+++ b/mkfs/xfs_mkfs.c
@@ -22,6 +22,23 @@
#include "libxcmd.h"
+
+#define TERABYTES(count, blog) ((uint64_t)(count) << (40 - (blog)))
+#define GIGABYTES(count, blog) ((uint64_t)(count) << (30 - (blog)))
+#define MEGABYTES(count, blog) ((uint64_t)(count) << (20 - (blog)))
+
+/*
+ * Use this macro before we have superblock and mount structure to
+ * convert from basic blocks to filesystem blocks.
+ */
+#define DTOBT(d, bl) ((xfs_rfsblock_t)((d) >> ((bl) - BBSHIFT)))
+
+/*
+ * amount (in bytes) we zero at the beginning and end of the device to
+ * remove traces of other filesystems, raid superblocks, etc.
+ */
+#define WHACK_SIZE (128 * 1024)
+
/*
* XXX: The configured block and sector sizes are defined as global variables so
* that they don't need to be passed to getnum/cvtnum().
@@ -873,30 +890,6 @@ struct mkfs_default_params {
struct fsxattr fsx;
};
-#define TERABYTES(count, blog) ((uint64_t)(count) << (40 - (blog)))
-#define GIGABYTES(count, blog) ((uint64_t)(count) << (30 - (blog)))
-#define MEGABYTES(count, blog) ((uint64_t)(count) << (20 - (blog)))
-
-/*
- * Use this macro before we have superblock and mount structure
- */
-#define DTOBT(d, bl) ((xfs_rfsblock_t)((d) >> ((bl) - BBSHIFT)))
-
-/*
- * Use this for block reservations needed for mkfs's conditions
- * (basically no fragmentation).
- */
-#define MKFS_BLOCKRES_INODE \
- ((uint)(mp->m_ialloc_blks + (mp->m_in_maxlevels - 1)))
-#define MKFS_BLOCKRES(rb) \
- ((uint)(MKFS_BLOCKRES_INODE + XFS_DA_NODE_MAXDEPTH + \
- (XFS_BM_MAXLEVELS(mp, XFS_DATA_FORK) - 1) + (rb)))
-
-/* amount (in bytes) we zero at the beginning and end of the device to
- * remove traces of other filesystems, raid superblocks, etc.
- */
-#define WHACK_SIZE (128 * 1024)
-
static void __attribute__((noreturn))
usage( void )
{