aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorEric Sandeen <sandeen@sandeen.net>2007-02-10 02:37:40 -0500
committerTim Shimmin <tes@sgi.com>2007-02-10 02:37:40 -0500
commit6be145bfb1ce93b2dbb854fee66fbb8d04916339 (patch)
treee723cab2dbc3a067a9d154070ad98b51b3a7fca7 /fs
parent2c36ddeda7f04c085d9a612cf8dab5f0a1cd5224 (diff)
[XFS] Remove a bunch of unused functions from XFS.
Patch provided by Eric Sandeen (sandeen@sandeen.net). SGI-PV: 960897 SGI-Modid: xfs-linux-melb:xfs-kern:28038a Signed-off-by: Eric Sandeen <sandeen@sandeen.net> Signed-off-by: David Chinner <dgc@sgi.com> Signed-off-by: Tim Shimmin <tes@sgi.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/xfs/xfs_bmap.c36
-rw-r--r--fs/xfs/xfs_bmap_btree.c76
-rw-r--r--fs/xfs/xfs_bmap_btree.h13
-rw-r--r--fs/xfs/xfs_da_btree.c15
-rw-r--r--fs/xfs/xfs_da_btree.h1
-rw-r--r--fs/xfs/xfs_error.c26
-rw-r--r--fs/xfs/xfs_error.h1
-rw-r--r--fs/xfs/xfs_rtalloc.c108
-rw-r--r--fs/xfs/xfs_rtalloc.h18
9 files changed, 0 insertions, 294 deletions
diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c
index 27d36dc69ded..87795188cedf 100644
--- a/fs/xfs/xfs_bmap.c
+++ b/fs/xfs/xfs_bmap.c
@@ -185,16 +185,6 @@ xfs_bmap_btree_to_extents(
185 int *logflagsp, /* inode logging flags */ 185 int *logflagsp, /* inode logging flags */
186 int whichfork); /* data or attr fork */ 186 int whichfork); /* data or attr fork */
187 187
188#ifdef DEBUG
189/*
190 * Check that the extents list for the inode ip is in the right order.
191 */
192STATIC void
193xfs_bmap_check_extents(
194 xfs_inode_t *ip, /* incore inode pointer */
195 int whichfork); /* data or attr fork */
196#endif
197
198/* 188/*
199 * Called by xfs_bmapi to update file extent records and the btree 189 * Called by xfs_bmapi to update file extent records and the btree
200 * after removing space (or undoing a delayed allocation). 190 * after removing space (or undoing a delayed allocation).
@@ -6045,32 +6035,6 @@ xfs_bmap_eof(
6045} 6035}
6046 6036
6047#ifdef DEBUG 6037#ifdef DEBUG
6048/*
6049 * Check that the extents list for the inode ip is in the right order.
6050 */
6051STATIC void
6052xfs_bmap_check_extents(
6053 xfs_inode_t *ip, /* incore inode pointer */
6054 int whichfork) /* data or attr fork */
6055{
6056 xfs_bmbt_rec_t *ep; /* current extent entry */
6057 xfs_extnum_t idx; /* extent record index */
6058 xfs_ifork_t *ifp; /* inode fork pointer */
6059 xfs_extnum_t nextents; /* number of extents in list */
6060 xfs_bmbt_rec_t *nextp; /* next extent entry */
6061
6062 ifp = XFS_IFORK_PTR(ip, whichfork);
6063 ASSERT(ifp->if_flags & XFS_IFEXTENTS);
6064 nextents = ifp->if_bytes / (uint)sizeof(xfs_bmbt_rec_t);
6065 ep = xfs_iext_get_ext(ifp, 0);
6066 for (idx = 0; idx < nextents - 1; idx++) {
6067 nextp = xfs_iext_get_ext(ifp, idx + 1);
6068 xfs_btree_check_rec(XFS_BTNUM_BMAP, (void *)ep,
6069 (void *)(nextp));
6070 ep = nextp;
6071 }
6072}
6073
6074STATIC 6038STATIC
6075xfs_buf_t * 6039xfs_buf_t *
6076xfs_bmap_get_bp( 6040xfs_bmap_get_bp(
diff --git a/fs/xfs/xfs_bmap_btree.c b/fs/xfs/xfs_bmap_btree.c
index 29b496594a7e..0bf192fea3eb 100644
--- a/fs/xfs/xfs_bmap_btree.c
+++ b/fs/xfs/xfs_bmap_btree.c
@@ -678,47 +678,6 @@ error0:
678 return error; 678 return error;
679} 679}
680 680
681#ifdef DEBUG
682/*
683 * Get the data from the pointed-to record.
684 */
685int
686xfs_bmbt_get_rec(
687 xfs_btree_cur_t *cur,
688 xfs_fileoff_t *off,
689 xfs_fsblock_t *bno,
690 xfs_filblks_t *len,
691 xfs_exntst_t *state,
692 int *stat)
693{
694 xfs_bmbt_block_t *block;
695 xfs_buf_t *bp;
696#ifdef DEBUG
697 int error;
698#endif
699 int ptr;
700 xfs_bmbt_rec_t *rp;
701
702 block = xfs_bmbt_get_block(cur, 0, &bp);
703 ptr = cur->bc_ptrs[0];
704#ifdef DEBUG
705 if ((error = xfs_btree_check_lblock(cur, block, 0, bp)))
706 return error;
707#endif
708 if (ptr > be16_to_cpu(block->bb_numrecs) || ptr <= 0) {
709 *stat = 0;
710 return 0;
711 }
712 rp = XFS_BMAP_REC_IADDR(block, ptr, cur);
713 *off = xfs_bmbt_disk_get_startoff(rp);
714 *bno = xfs_bmbt_disk_get_startblock(rp);
715 *len = xfs_bmbt_disk_get_blockcount(rp);
716 *state = xfs_bmbt_disk_get_state(rp);
717 *stat = 1;
718 return 0;
719}
720#endif
721
722/* 681/*
723 * Insert one record/level. Return information to the caller 682 * Insert one record/level. Return information to the caller
724 * allowing the next level up to proceed if necessary. 683 * allowing the next level up to proceed if necessary.
@@ -2016,30 +1975,6 @@ xfs_bmbt_disk_get_blockcount(
2016} 1975}
2017 1976
2018/* 1977/*
2019 * Extract the startblock field from an on disk bmap extent record.
2020 */
2021xfs_fsblock_t
2022xfs_bmbt_disk_get_startblock(
2023 xfs_bmbt_rec_t *r)
2024{
2025#if XFS_BIG_BLKNOS
2026 return (((xfs_fsblock_t)INT_GET(r->l0, ARCH_CONVERT) & XFS_MASK64LO(9)) << 43) |
2027 (((xfs_fsblock_t)INT_GET(r->l1, ARCH_CONVERT)) >> 21);
2028#else
2029#ifdef DEBUG
2030 xfs_dfsbno_t b;
2031
2032 b = (((xfs_dfsbno_t)INT_GET(r->l0, ARCH_CONVERT) & XFS_MASK64LO(9)) << 43) |
2033 (((xfs_dfsbno_t)INT_GET(r->l1, ARCH_CONVERT)) >> 21);
2034 ASSERT((b >> 32) == 0 || ISNULLDSTARTBLOCK(b));
2035 return (xfs_fsblock_t)b;
2036#else /* !DEBUG */
2037 return (xfs_fsblock_t)(((xfs_dfsbno_t)INT_GET(r->l1, ARCH_CONVERT)) >> 21);
2038#endif /* DEBUG */
2039#endif /* XFS_BIG_BLKNOS */
2040}
2041
2042/*
2043 * Extract the startoff field from a disk format bmap extent record. 1978 * Extract the startoff field from a disk format bmap extent record.
2044 */ 1979 */
2045xfs_fileoff_t 1980xfs_fileoff_t
@@ -2049,17 +1984,6 @@ xfs_bmbt_disk_get_startoff(
2049 return ((xfs_fileoff_t)INT_GET(r->l0, ARCH_CONVERT) & 1984 return ((xfs_fileoff_t)INT_GET(r->l0, ARCH_CONVERT) &
2050 XFS_MASK64LO(64 - BMBT_EXNTFLAG_BITLEN)) >> 9; 1985 XFS_MASK64LO(64 - BMBT_EXNTFLAG_BITLEN)) >> 9;
2051} 1986}
2052
2053xfs_exntst_t
2054xfs_bmbt_disk_get_state(
2055 xfs_bmbt_rec_t *r)
2056{
2057 int ext_flag;
2058
2059 ext_flag = (int)((INT_GET(r->l0, ARCH_CONVERT)) >> (64 - BMBT_EXNTFLAG_BITLEN));
2060 return xfs_extent_state(xfs_bmbt_disk_get_blockcount(r),
2061 ext_flag);
2062}
2063#endif /* XFS_NATIVE_HOST */ 1987#endif /* XFS_NATIVE_HOST */
2064 1988
2065 1989
diff --git a/fs/xfs/xfs_bmap_btree.h b/fs/xfs/xfs_bmap_btree.h
index 153480f5bc63..a77b1b753d0c 100644
--- a/fs/xfs/xfs_bmap_btree.h
+++ b/fs/xfs/xfs_bmap_btree.h
@@ -291,15 +291,11 @@ extern xfs_exntst_t xfs_bmbt_get_state(xfs_bmbt_rec_t *r);
291 291
292#ifndef XFS_NATIVE_HOST 292#ifndef XFS_NATIVE_HOST
293extern void xfs_bmbt_disk_get_all(xfs_bmbt_rec_t *r, xfs_bmbt_irec_t *s); 293extern void xfs_bmbt_disk_get_all(xfs_bmbt_rec_t *r, xfs_bmbt_irec_t *s);
294extern xfs_exntst_t xfs_bmbt_disk_get_state(xfs_bmbt_rec_t *r);
295extern xfs_filblks_t xfs_bmbt_disk_get_blockcount(xfs_bmbt_rec_t *r); 294extern xfs_filblks_t xfs_bmbt_disk_get_blockcount(xfs_bmbt_rec_t *r);
296extern xfs_fsblock_t xfs_bmbt_disk_get_startblock(xfs_bmbt_rec_t *r);
297extern xfs_fileoff_t xfs_bmbt_disk_get_startoff(xfs_bmbt_rec_t *r); 295extern xfs_fileoff_t xfs_bmbt_disk_get_startoff(xfs_bmbt_rec_t *r);
298#else 296#else
299#define xfs_bmbt_disk_get_all(r, s) xfs_bmbt_get_all(r, s) 297#define xfs_bmbt_disk_get_all(r, s) xfs_bmbt_get_all(r, s)
300#define xfs_bmbt_disk_get_state(r) xfs_bmbt_get_state(r)
301#define xfs_bmbt_disk_get_blockcount(r) xfs_bmbt_get_blockcount(r) 298#define xfs_bmbt_disk_get_blockcount(r) xfs_bmbt_get_blockcount(r)
302#define xfs_bmbt_disk_get_startblock(r) xfs_bmbt_get_blockcount(r)
303#define xfs_bmbt_disk_get_startoff(r) xfs_bmbt_get_startoff(r) 299#define xfs_bmbt_disk_get_startoff(r) xfs_bmbt_get_startoff(r)
304#endif /* XFS_NATIVE_HOST */ 300#endif /* XFS_NATIVE_HOST */
305 301
@@ -340,15 +336,6 @@ extern void xfs_bmbt_to_bmdr(xfs_bmbt_block_t *, int, xfs_bmdr_block_t *, int);
340extern int xfs_bmbt_update(struct xfs_btree_cur *, xfs_fileoff_t, 336extern int xfs_bmbt_update(struct xfs_btree_cur *, xfs_fileoff_t,
341 xfs_fsblock_t, xfs_filblks_t, xfs_exntst_t); 337 xfs_fsblock_t, xfs_filblks_t, xfs_exntst_t);
342 338
343#ifdef DEBUG
344/*
345 * Get the data from the pointed-to record.
346 */
347extern int xfs_bmbt_get_rec(struct xfs_btree_cur *, xfs_fileoff_t *,
348 xfs_fsblock_t *, xfs_filblks_t *,
349 xfs_exntst_t *, int *);
350#endif
351
352#endif /* __KERNEL__ */ 339#endif /* __KERNEL__ */
353 340
354#endif /* __XFS_BMAP_BTREE_H__ */ 341#endif /* __XFS_BMAP_BTREE_H__ */
diff --git a/fs/xfs/xfs_da_btree.c b/fs/xfs/xfs_da_btree.c
index cccf69edb81b..aea37df4aa62 100644
--- a/fs/xfs/xfs_da_btree.c
+++ b/fs/xfs/xfs_da_btree.c
@@ -2165,21 +2165,6 @@ xfs_da_reada_buf(
2165 return rval; 2165 return rval;
2166} 2166}
2167 2167
2168/*
2169 * Calculate the number of bits needed to hold i different values.
2170 */
2171uint
2172xfs_da_log2_roundup(uint i)
2173{
2174 uint rval;
2175
2176 for (rval = 0; rval < NBBY * sizeof(i); rval++) {
2177 if ((1 << rval) >= i)
2178 break;
2179 }
2180 return(rval);
2181}
2182
2183kmem_zone_t *xfs_da_state_zone; /* anchor for state struct zone */ 2168kmem_zone_t *xfs_da_state_zone; /* anchor for state struct zone */
2184kmem_zone_t *xfs_dabuf_zone; /* dabuf zone */ 2169kmem_zone_t *xfs_dabuf_zone; /* dabuf zone */
2185 2170
diff --git a/fs/xfs/xfs_da_btree.h b/fs/xfs/xfs_da_btree.h
index 4ab865ec8b82..44dabf02f2a3 100644
--- a/fs/xfs/xfs_da_btree.h
+++ b/fs/xfs/xfs_da_btree.h
@@ -249,7 +249,6 @@ int xfs_da_shrink_inode(xfs_da_args_t *args, xfs_dablk_t dead_blkno,
249 xfs_dabuf_t *dead_buf); 249 xfs_dabuf_t *dead_buf);
250 250
251uint xfs_da_hashname(const uchar_t *name_string, int name_length); 251uint xfs_da_hashname(const uchar_t *name_string, int name_length);
252uint xfs_da_log2_roundup(uint i);
253xfs_da_state_t *xfs_da_state_alloc(void); 252xfs_da_state_t *xfs_da_state_alloc(void);
254void xfs_da_state_free(xfs_da_state_t *state); 253void xfs_da_state_free(xfs_da_state_t *state);
255 254
diff --git a/fs/xfs/xfs_error.c b/fs/xfs/xfs_error.c
index b95681b03d81..b1af54464f00 100644
--- a/fs/xfs/xfs_error.c
+++ b/fs/xfs/xfs_error.c
@@ -132,32 +132,6 @@ xfs_errortag_add(int error_tag, xfs_mount_t *mp)
132} 132}
133 133
134int 134int
135xfs_errortag_clear(int error_tag, xfs_mount_t *mp)
136{
137 int i;
138 int64_t fsid;
139
140 memcpy(&fsid, mp->m_fixedfsid, sizeof(xfs_fsid_t));
141
142 for (i = 0; i < XFS_NUM_INJECT_ERROR; i++) {
143 if (xfs_etest_fsid[i] == fsid && xfs_etest[i] == error_tag) {
144 xfs_etest[i] = 0;
145 xfs_etest_fsid[i] = 0LL;
146 kmem_free(xfs_etest_fsname[i],
147 strlen(xfs_etest_fsname[i]) + 1);
148 xfs_etest_fsname[i] = NULL;
149 cmn_err(CE_WARN, "Cleared XFS error tag #%d",
150 error_tag);
151 return 0;
152 }
153 }
154
155 cmn_err(CE_WARN, "XFS error tag %d not on", error_tag);
156
157 return 1;
158}
159
160int
161xfs_errortag_clearall_umount(int64_t fsid, char *fsname, int loud) 135xfs_errortag_clearall_umount(int64_t fsid, char *fsname, int loud)
162{ 136{
163 int i; 137 int i;
diff --git a/fs/xfs/xfs_error.h b/fs/xfs/xfs_error.h
index 86d22efdd56c..5599ada456a1 100644
--- a/fs/xfs/xfs_error.h
+++ b/fs/xfs/xfs_error.h
@@ -144,7 +144,6 @@ extern void xfs_error_test_init(void);
144#endif /* __ANSI_CPP__ */ 144#endif /* __ANSI_CPP__ */
145 145
146extern int xfs_errortag_add(int error_tag, xfs_mount_t *mp); 146extern int xfs_errortag_add(int error_tag, xfs_mount_t *mp);
147extern int xfs_errortag_clear(int error_tag, xfs_mount_t *mp);
148extern int xfs_errortag_clearall(xfs_mount_t *mp); 147extern int xfs_errortag_clearall(xfs_mount_t *mp);
149extern int xfs_errortag_clearall_umount(int64_t fsid, char *fsname, int loud); 148extern int xfs_errortag_clearall_umount(int64_t fsid, char *fsname, int loud);
150#else 149#else
diff --git a/fs/xfs/xfs_rtalloc.c b/fs/xfs/xfs_rtalloc.c
index dcf57dc071ac..6fff19dc3cf9 100644
--- a/fs/xfs/xfs_rtalloc.c
+++ b/fs/xfs/xfs_rtalloc.c
@@ -913,57 +913,6 @@ xfs_rtcheck_alloc_range(
913} 913}
914#endif 914#endif
915 915
916#ifdef DEBUG
917/*
918 * Check whether the given block in the bitmap has the given value.
919 */
920STATIC int /* 1 for matches, 0 for not */
921xfs_rtcheck_bit(
922 xfs_mount_t *mp, /* file system mount structure */
923 xfs_trans_t *tp, /* transaction pointer */
924 xfs_rtblock_t start, /* bit (block) to check */
925 int val) /* 1 for free, 0 for allocated */
926{
927 int bit; /* bit number in the word */
928 xfs_rtblock_t block; /* bitmap block number */
929 xfs_buf_t *bp; /* buf for the block */
930 xfs_rtword_t *bufp; /* pointer into the buffer */
931 /* REFERENCED */
932 int error; /* error value */
933 xfs_rtword_t wdiff; /* difference between bit & expected */
934 int word; /* word number in the buffer */
935 xfs_rtword_t wval; /* word value from buffer */
936
937 block = XFS_BITTOBLOCK(mp, start);
938 error = xfs_rtbuf_get(mp, tp, block, 0, &bp);
939 bufp = (xfs_rtword_t *)XFS_BUF_PTR(bp);
940 word = XFS_BITTOWORD(mp, start);
941 bit = (int)(start & (XFS_NBWORD - 1));
942 wval = bufp[word];
943 xfs_trans_brelse(tp, bp);
944 wdiff = (wval ^ -val) & ((xfs_rtword_t)1 << bit);
945 return !wdiff;
946}
947#endif /* DEBUG */
948
949#if 0
950/*
951 * Check that the given extent (block range) is free already.
952 */
953STATIC int /* error */
954xfs_rtcheck_free_range(
955 xfs_mount_t *mp, /* file system mount point */
956 xfs_trans_t *tp, /* transaction pointer */
957 xfs_rtblock_t bno, /* starting block number of extent */
958 xfs_extlen_t len, /* length of extent */
959 int *stat) /* out: 1 for free, 0 for not */
960{
961 xfs_rtblock_t new; /* dummy for xfs_rtcheck_range */
962
963 return xfs_rtcheck_range(mp, tp, bno, len, 1, &new, stat);
964}
965#endif
966
967/* 916/*
968 * Check that the given range is either all allocated (val = 0) or 917 * Check that the given range is either all allocated (val = 0) or
969 * all free (val = 1). 918 * all free (val = 1).
@@ -2382,60 +2331,3 @@ xfs_rtpick_extent(
2382 *pick = b; 2331 *pick = b;
2383 return 0; 2332 return 0;
2384} 2333}
2385
2386#ifdef DEBUG
2387/*
2388 * Debug code: print out the value of a range in the bitmap.
2389 */
2390void
2391xfs_rtprint_range(
2392 xfs_mount_t *mp, /* file system mount structure */
2393 xfs_trans_t *tp, /* transaction pointer */
2394 xfs_rtblock_t start, /* starting block to print */
2395 xfs_extlen_t len) /* length to print */
2396{
2397 xfs_extlen_t i; /* block number in the extent */
2398
2399 cmn_err(CE_DEBUG, "%Ld: ", (long long)start);
2400 for (i = 0; i < len; i++)
2401 cmn_err(CE_DEBUG, "%d", xfs_rtcheck_bit(mp, tp, start + i, 1));
2402 cmn_err(CE_DEBUG, "\n");
2403}
2404
2405/*
2406 * Debug code: print the summary file.
2407 */
2408void
2409xfs_rtprint_summary(
2410 xfs_mount_t *mp, /* file system mount structure */
2411 xfs_trans_t *tp) /* transaction pointer */
2412{
2413 xfs_suminfo_t c; /* summary data */
2414 xfs_rtblock_t i; /* bitmap block number */
2415 int l; /* summary information level */
2416 int p; /* flag for printed anything */
2417 xfs_fsblock_t sb; /* summary block number */
2418 xfs_buf_t *sumbp; /* summary block buffer */
2419
2420 sumbp = NULL;
2421 for (l = 0; l < mp->m_rsumlevels; l++) {
2422 for (p = 0, i = 0; i < mp->m_sb.sb_rbmblocks; i++) {
2423 (void)xfs_rtget_summary(mp, tp, l, i, &sumbp, &sb, &c);
2424 if (c) {
2425 if (!p) {
2426 cmn_err(CE_DEBUG, "%Ld-%Ld:", 1LL << l,
2427 XFS_RTMIN((1LL << l) +
2428 ((1LL << l) - 1LL),
2429 mp->m_sb.sb_rextents));
2430 p = 1;
2431 }
2432 cmn_err(CE_DEBUG, " %Ld:%d", (long long)i, c);
2433 }
2434 }
2435 if (p)
2436 cmn_err(CE_DEBUG, "\n");
2437 }
2438 if (sumbp)
2439 xfs_trans_brelse(tp, sumbp);
2440}
2441#endif /* DEBUG */
diff --git a/fs/xfs/xfs_rtalloc.h b/fs/xfs/xfs_rtalloc.h
index 0e0b4d2ec202..799c1f871263 100644
--- a/fs/xfs/xfs_rtalloc.h
+++ b/fs/xfs/xfs_rtalloc.h
@@ -134,24 +134,6 @@ xfs_rtpick_extent(
134 xfs_rtblock_t *pick); /* result rt extent */ 134 xfs_rtblock_t *pick); /* result rt extent */
135 135
136/* 136/*
137 * Debug code: print out the value of a range in the bitmap.
138 */
139void
140xfs_rtprint_range(
141 struct xfs_mount *mp, /* file system mount structure */
142 struct xfs_trans *tp, /* transaction pointer */
143 xfs_rtblock_t start, /* starting block to print */
144 xfs_extlen_t len); /* length to print */
145
146/*
147 * Debug code: print the summary file.
148 */
149void
150xfs_rtprint_summary(
151 struct xfs_mount *mp, /* file system mount structure */
152 struct xfs_trans *tp); /* transaction pointer */
153
154/*
155 * Grow the realtime area of the filesystem. 137 * Grow the realtime area of the filesystem.
156 */ 138 */
157int 139int