]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfsprogs: remove unused macros
authorEric Sandeen <sandeen@redhat.com>
Wed, 1 Aug 2018 22:06:44 +0000 (17:06 -0500)
committerEric Sandeen <sandeen@redhat.com>
Wed, 1 Aug 2018 22:06:44 +0000 (17:06 -0500)
A lot of dead macros are lying around xfsprogs; some are just
ancient cruft while others are the result of shifting libxfs
interfaces, but we can remove them.

(I've left a few unused macros in place where they exist with
other macros for symmetry or completeness.)

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
14 files changed:
db/btblock.c
db/metadump.c
db/symlink.c
estimate/xfs_estimate.c
fsr/xfs_fsr.c
include/xfs_trace.h
libxfs/libxfs_api_defs.h
libxlog/xfs_log_recover.c
repair/attr_repair.c
repair/incore.h
repair/incore_ext.c
repair/scan.c
repair/slab.c
repair/xfs_repair.c

index ae9248bff9fbaeea004213f33c32c454374fa4df..cbd299062833d463eb8b38035bfd2b60d0f2d3ea 100644 (file)
@@ -716,8 +716,6 @@ const field_t       rmapbt_key_flds[] = {
 #undef HI_KOFF
 #undef KOFF
 
-#define        ROFF(f) bitize(offsetof(struct xfs_rmap_rec, rm_ ## f))
-
 #define RMAPBT_STARTBLOCK_BITOFF       0
 #define RMAPBT_BLOCKCOUNT_BITOFF       (RMAPBT_STARTBLOCK_BITOFF + RMAPBT_STARTBLOCK_BITLEN)
 #define RMAPBT_OWNER_BITOFF            (RMAPBT_BLOCKCOUNT_BITOFF + RMAPBT_BLOCKCOUNT_BITLEN)
@@ -740,7 +738,6 @@ const field_t       rmapbt_rec_flds[] = {
          TYP_NONE },
        { NULL }
 };
-#undef ROFF
 
 /* refcount btree blocks */
 const field_t  refcbt_crc_hfld[] = {
@@ -773,13 +770,11 @@ const field_t     refcbt_crc_flds[] = {
 #define REFCNTBT_COWFLAG_BITOFF                0
 #define REFCNTBT_STARTBLOCK_BITOFF     (REFCNTBT_COWFLAG_BITOFF + REFCNTBT_COWFLAG_BITLEN)
 
-#define        KOFF(f) bitize(offsetof(struct xfs_refcount_key, rc_ ## f))
 const field_t  refcbt_key_flds[] = {
        { "startblock", FLDT_CAGBLOCK, OI(REFCNTBT_STARTBLOCK_BITOFF), C1, 0, TYP_DATA },
        { "cowflag", FLDT_CCOWFLG, OI(REFCNTBT_COWFLAG_BITOFF), C1, 0, TYP_DATA },
        { NULL }
 };
-#undef KOFF
 
 #define        ROFF(f) bitize(offsetof(struct xfs_refcount_rec, rc_ ## f))
 const field_t  refcbt_rec_flds[] = {
index 81469bb63412394ba95a9db2e61b7e3cc58f8bfb..cc2ae9af41608c5686626d0bf7890e49f6cda020 100644 (file)
 
 #define DEFAULT_MAX_EXT_SIZE   MAXEXTLEN
 
-/*
- * It's possible that multiple files in a directory (or attributes
- * in a file) produce the same obfuscated name.  If that happens, we
- * try to create another one.  After several rounds of this though,
- * we just give up and leave the original name as-is.
- */
-#define        DUP_MAX         5       /* Max duplicates before we give up */
-
 /* copy all metadata structures to/from a file */
 
 static int     metadump_f(int argc, char **argv);
index d0d6aa4bcf5cf9970bca407a48a1e83caf0417af..ebf66373d43bad717d11eeef2fc350a772c555a5 100644 (file)
@@ -52,7 +52,6 @@ const struct field    symlink_crc_hfld[] = {
 };
 
 #define        OFF(f)  bitize(offsetof(struct xfs_dsymlink_hdr, sl_ ## f))
-#define        SZOF(f) bitize(sizeof(struct xfs_dsymlink_hdr))
 const struct field     symlink_crc_flds[] = {
        { "magic", FLDT_UINT32X, OI(OFF(magic)), C1, 0, TYP_NONE },
        { "offset", FLDT_UINT32D, OI(OFF(offset)), C1, 0, TYP_NONE },
index 748e460ab694421b794afe89313f5184aa82d6a6..eaa2cbae9852b55dc73f3dee8229b22a518b6d23 100644 (file)
@@ -42,7 +42,6 @@ int ffn(const char *, const struct stat *, int, struct FTW *);
 #define LOGSIZE                1000
 
 #define FBLOCKS(n)     ((n)/blocksize)
-#define RFBYTES(n)     ((n) - (FBLOCKS(n) * blocksize))
 
 unsigned long long dirsize=0;          /* bytes */
 unsigned long long logsize=LOGSIZE*BLOCKSIZE;  /* bytes */
index 7040c8d339046f5f28b1c7fcc018a23ffbbaa55a..e21643aeca1ba04eadcaaee70728635d757715aa 100644 (file)
@@ -52,10 +52,6 @@ static int64_t               minimumfree = 2048;
 #define NULLFD         -1
 #define GRABSZ         64
 #define TARGETRANGE    10
-#define        V_NONE          0
-#define        V_OVERVIEW      1
-#define        V_ALL           2
-#define BUFFER_SIZE    (1<<16)
 #define BUFFER_MAX     (1<<24)
 
 static time_t howlong = 7200;          /* default seconds of reorganizing */
index 246301aa30097b02d48a19aea532f0a9ddc2ddef..56dc53afbfe4c957aca7236fc20727ca2383a9aa 100644 (file)
@@ -11,7 +11,6 @@
 #define trace_xfs_alloc_exact_done(a)          ((void) 0)
 #define trace_xfs_alloc_exact_notfound(a)      ((void) 0)
 #define trace_xfs_alloc_exact_error(a)         ((void) 0)
-#define trace_xfs_alloc_near_nominleft(a)      ((void) 0)
 #define trace_xfs_alloc_near_first(a)          ((void) 0)
 #define trace_xfs_alloc_near_greater(a)                ((void) 0)
 #define trace_xfs_alloc_near_lesser(a)         ((void) 0)
@@ -34,8 +33,6 @@
 #define trace_xfs_alloc_vextent_loopfailed(a)  ((void) 0)
 #define trace_xfs_alloc_vextent_allfailed(a)   ((void) 0)
 
-#define trace_xfs_log_recover_item_reorder_head(a,b,c,d)       ((void) 0)
-#define trace_xfs_log_recover_item_reorder_tail(a,b,c,d)       ((void) 0)
 #define trace_xfs_log_recover_item_add_cont(a,b,c,d)   ((void) 0)
 #define trace_xfs_log_recover_item_add(a,b,c,d)        ((void) 0)
 
 #define trace_xfs_refcount_find_shared_error(...)      ((void) 0)
 
 #define trace_xfs_bmap_remap_alloc(...)                ((void) 0)
-#define trace_xfs_bmap_remap_alloc_error(...)  ((void) 0)
 #define trace_xfs_bmap_deferred(...)           ((void) 0)
 #define trace_xfs_bmap_defer(...)              ((void) 0)
 
index 641d193c60270dd4b4c080d996d35f602583cea1..a1a95a4839babde2f42ae9435631a01838261b57 100644 (file)
@@ -34,7 +34,6 @@
 #define xfs_trans_iget                 libxfs_trans_iget
 #define xfs_trans_ichgtime             libxfs_trans_ichgtime
 #define xfs_trans_ijoin                        libxfs_trans_ijoin
-#define xfs_trans_ijoin_ref            libxfs_trans_ijoin_ref
 #define xfs_trans_init                 libxfs_trans_init
 #define xfs_trans_inode_alloc_buf      libxfs_trans_inode_alloc_buf
 #define xfs_trans_dirty_buf            libxfs_trans_dirty_buf
@@ -58,7 +57,6 @@
 #define xfs_alloc_min_freelist         libxfs_alloc_min_freelist
 #define xfs_alloc_read_agf             libxfs_alloc_read_agf
 #define xfs_bmap_last_offset           libxfs_bmap_last_offset
-#define xfs_bmap_search_extents                libxfs_bmap_search_extents
 #define xfs_iext_lookup_extent         libxfs_iext_lookup_extent
 #define xfs_bmapi_write                        libxfs_bmapi_write
 #define xfs_bmapi_read                 libxfs_bmapi_read
index 9e01e49bdaa4e290317124bb77dfce6c71c59f40..ab56fcd8e44a865a945385e1cc807db2e370ecde 100644 (file)
@@ -1023,8 +1023,6 @@ xlog_recover_add_item(
        list_add_tail(&item->ri_list, head);
 }
 
-#define BLK_AVG(blk1, blk2)    ((blk1+blk2) >> 1)
-
 STATIC int
 xlog_recover_add_to_cont_trans(
        struct xlog             *log,
index d078522bdc617cda3469e9d8df3a4c59c44c0b07..f343fa8febc502a7e5e2386148df8dba16dedad7 100644 (file)
@@ -23,7 +23,6 @@ static int xfs_mac_valid(xfs_mac_label_t *lp);
  * dir v1 code, but that format is no longer supported yb the userspace
  * utilities and hence is now specific to the attribute tree implementation.
  */
-#define XR_DA_LEAF_MAPSIZE     XFS_ATTR_LEAF_MAPSIZE
 
 typedef unsigned char  da_freemap_t;
 
index 50439cd6df83ec903176235db729fdaf879feb04..5b29d5d1efd896b17cdce209a68edb7d4ef5a376 100644 (file)
@@ -101,8 +101,6 @@ typedef struct rt_extent_tree_node  {
 /* separate state bit, OR'ed into high (4th) bit of ex_state field */
 
 #define XR_E_WRITTEN   0x8     /* extent has been written out, can't reclaim */
-#define good_state(state)      (((state) & (~XR_E_WRITTEN)) >= XR_E_UNKNOWN && \
-                               ((state) & (~XR_E_WRITTEN) < XF_E_BAD_STATE))
 #define written(state)         ((state) & XR_E_WRITTEN)
 #define set_written(state)     (state) &= XR_E_WRITTEN
 
index a8a4a37be847b940455082c72a0000eee05940be..0624d6daea7002ae793601bd03213224fc63789c 100644 (file)
@@ -254,14 +254,6 @@ get_bno_extent(xfs_agnumber_t agno, extent_tree_node_t *ext)
        return;
 }
 
-/*
- * normalizing constant for bcnt size -> address conversion (see avl ops)
- * used by the AVL tree code to convert sizes and must be used when
- * doing an AVL search in the tree (e.g. avl_findrange(s))
- */
-#define MAXBCNT                0xFFFFFFFF
-#define BCNT_ADDR(cnt) ((unsigned int) MAXBCNT - (cnt))
-
 /*
  * the next 4 routines manage the trees of free extents -- 2 trees
  * per AG.  The first tree is sorted by block number.  The second
index 7b67112351e1f15f692c440ad7404faedcfa4334..4b44a12b861cf35ac6ad8c7855fa0132d79be664 100644 (file)
@@ -2486,8 +2486,6 @@ out_free_sb:
                do_error(_("can't get %s for ag %d\n"), objname, agno);
 }
 
-#define SCAN_THREADS 32
-
 void
 scan_ags(
        struct xfs_mount        *mp,
index b4e69e2219f3e2777c20a215b3cbb0c0957fd77f..ba5c232776564a4ada7b90b8b8aab3fe736e412e 100644 (file)
@@ -87,7 +87,6 @@ struct xfs_bag {
        size_t                  bg_inuse;       /* number of slots in use */
        void                    **bg_ptrs;      /* pointers */
 };
-#define BAG_SIZE(nr)   (sizeof(struct xfs_bag) + ((nr) * sizeof(void *)))
 #define BAG_END(bag)   (&(bag)->bg_ptrs[(bag)->bg_nr])
 
 /*
index de3b336366e4bf0fdc9ef04fa747ea93dab9a9cb..04c7dc2187133e704e6096f208b5ac46fd52ec8f 100644 (file)
 #include "slab.h"
 #include "rmap.h"
 
-#define        rounddown(x, y) (((x)/(y))*(y))
-
-#define                XR_MAX_SECT_SIZE        (64 * 1024)
-
 /*
  * option tables for getsubopt calls
  */