aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/libxfs
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2014-07-29 19:12:05 -0400
committerDave Chinner <david@fromorbit.com>2014-07-29 19:12:05 -0400
commitd5cf09baced0ef3d2cc118865079f8b129e98e2f (patch)
tree124fb5a2e0d711952cbe7668bb55b7a7aaa5792a /fs/xfs/libxfs
parent74dc93a9087fc71240486d914b4a95f8e510e0e4 (diff)
xfs: require 64-bit sector_t
Trying to support tiny disks only and saving a bit memory might have made sense on an SGI O2 15 years ago, but is pretty pointless today. Remove the rarely tested codepath that uses various smaller in-memory types to reduce our test matrix and make the codebase a little bit smaller and less complicated. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Ben Myers <bpm@sgi.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/xfs/libxfs')
-rw-r--r--fs/xfs/libxfs/xfs_bmap.c8
-rw-r--r--fs/xfs/libxfs/xfs_bmap_btree.c89
-rw-r--r--fs/xfs/libxfs/xfs_btree.c32
-rw-r--r--fs/xfs/libxfs/xfs_btree.h2
-rw-r--r--fs/xfs/libxfs/xfs_da_btree.c2
-rw-r--r--fs/xfs/libxfs/xfs_dir2_sf.c45
-rw-r--r--fs/xfs/libxfs/xfs_format.h14
-rw-r--r--fs/xfs/libxfs/xfs_inode_fork.c4
-rw-r--r--fs/xfs/libxfs/xfs_inum.h4
-rw-r--r--fs/xfs/libxfs/xfs_log_format.h4
-rw-r--r--fs/xfs/libxfs/xfs_sb.h8
11 files changed, 41 insertions, 171 deletions
diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c
index 72a110eb1dda..224963b1efc0 100644
--- a/fs/xfs/libxfs/xfs_bmap.c
+++ b/fs/xfs/libxfs/xfs_bmap.c
@@ -392,7 +392,7 @@ xfs_bmap_check_leaf_extents(
392 pp = XFS_BMAP_BROOT_PTR_ADDR(mp, block, 1, ifp->if_broot_bytes); 392 pp = XFS_BMAP_BROOT_PTR_ADDR(mp, block, 1, ifp->if_broot_bytes);
393 bno = be64_to_cpu(*pp); 393 bno = be64_to_cpu(*pp);
394 394
395 ASSERT(bno != NULLDFSBNO); 395 ASSERT(bno != NULLFSBLOCK);
396 ASSERT(XFS_FSB_TO_AGNO(mp, bno) < mp->m_sb.sb_agcount); 396 ASSERT(XFS_FSB_TO_AGNO(mp, bno) < mp->m_sb.sb_agcount);
397 ASSERT(XFS_FSB_TO_AGBNO(mp, bno) < mp->m_sb.sb_agblocks); 397 ASSERT(XFS_FSB_TO_AGBNO(mp, bno) < mp->m_sb.sb_agblocks);
398 398
@@ -1299,7 +1299,7 @@ xfs_bmap_read_extents(
1299 ASSERT(level > 0); 1299 ASSERT(level > 0);
1300 pp = XFS_BMAP_BROOT_PTR_ADDR(mp, block, 1, ifp->if_broot_bytes); 1300 pp = XFS_BMAP_BROOT_PTR_ADDR(mp, block, 1, ifp->if_broot_bytes);
1301 bno = be64_to_cpu(*pp); 1301 bno = be64_to_cpu(*pp);
1302 ASSERT(bno != NULLDFSBNO); 1302 ASSERT(bno != NULLFSBLOCK);
1303 ASSERT(XFS_FSB_TO_AGNO(mp, bno) < mp->m_sb.sb_agcount); 1303 ASSERT(XFS_FSB_TO_AGNO(mp, bno) < mp->m_sb.sb_agcount);
1304 ASSERT(XFS_FSB_TO_AGBNO(mp, bno) < mp->m_sb.sb_agblocks); 1304 ASSERT(XFS_FSB_TO_AGBNO(mp, bno) < mp->m_sb.sb_agblocks);
1305 /* 1305 /*
@@ -1429,11 +1429,7 @@ xfs_bmap_search_multi_extents(
1429 gotp->br_startoff = 0xffa5a5a5a5a5a5a5LL; 1429 gotp->br_startoff = 0xffa5a5a5a5a5a5a5LL;
1430 gotp->br_blockcount = 0xa55a5a5a5a5a5a5aLL; 1430 gotp->br_blockcount = 0xa55a5a5a5a5a5a5aLL;
1431 gotp->br_state = XFS_EXT_INVALID; 1431 gotp->br_state = XFS_EXT_INVALID;
1432#if XFS_BIG_BLKNOS
1433 gotp->br_startblock = 0xffffa5a5a5a5a5a5LL; 1432 gotp->br_startblock = 0xffffa5a5a5a5a5a5LL;
1434#else
1435 gotp->br_startblock = 0xffffa5a5;
1436#endif
1437 prevp->br_startoff = NULLFILEOFF; 1433 prevp->br_startoff = NULLFILEOFF;
1438 1434
1439 ep = xfs_iext_bno_to_ext(ifp, bno, &lastx); 1435 ep = xfs_iext_bno_to_ext(ifp, bno, &lastx);
diff --git a/fs/xfs/libxfs/xfs_bmap_btree.c b/fs/xfs/libxfs/xfs_bmap_btree.c
index a388de4ceaa1..fba753308f31 100644
--- a/fs/xfs/libxfs/xfs_bmap_btree.c
+++ b/fs/xfs/libxfs/xfs_bmap_btree.c
@@ -111,23 +111,8 @@ __xfs_bmbt_get_all(
111 ext_flag = (int)(l0 >> (64 - BMBT_EXNTFLAG_BITLEN)); 111 ext_flag = (int)(l0 >> (64 - BMBT_EXNTFLAG_BITLEN));
112 s->br_startoff = ((xfs_fileoff_t)l0 & 112 s->br_startoff = ((xfs_fileoff_t)l0 &
113 xfs_mask64lo(64 - BMBT_EXNTFLAG_BITLEN)) >> 9; 113 xfs_mask64lo(64 - BMBT_EXNTFLAG_BITLEN)) >> 9;
114#if XFS_BIG_BLKNOS
115 s->br_startblock = (((xfs_fsblock_t)l0 & xfs_mask64lo(9)) << 43) | 114 s->br_startblock = (((xfs_fsblock_t)l0 & xfs_mask64lo(9)) << 43) |
116 (((xfs_fsblock_t)l1) >> 21); 115 (((xfs_fsblock_t)l1) >> 21);
117#else
118#ifdef DEBUG
119 {
120 xfs_dfsbno_t b;
121
122 b = (((xfs_dfsbno_t)l0 & xfs_mask64lo(9)) << 43) |
123 (((xfs_dfsbno_t)l1) >> 21);
124 ASSERT((b >> 32) == 0 || isnulldstartblock(b));
125 s->br_startblock = (xfs_fsblock_t)b;
126 }
127#else /* !DEBUG */
128 s->br_startblock = (xfs_fsblock_t)(((xfs_dfsbno_t)l1) >> 21);
129#endif /* DEBUG */
130#endif /* XFS_BIG_BLKNOS */
131 s->br_blockcount = (xfs_filblks_t)(l1 & xfs_mask64lo(21)); 116 s->br_blockcount = (xfs_filblks_t)(l1 & xfs_mask64lo(21));
132 /* This is xfs_extent_state() in-line */ 117 /* This is xfs_extent_state() in-line */
133 if (ext_flag) { 118 if (ext_flag) {
@@ -163,21 +148,8 @@ xfs_fsblock_t
163xfs_bmbt_get_startblock( 148xfs_bmbt_get_startblock(
164 xfs_bmbt_rec_host_t *r) 149 xfs_bmbt_rec_host_t *r)
165{ 150{
166#if XFS_BIG_BLKNOS
167 return (((xfs_fsblock_t)r->l0 & xfs_mask64lo(9)) << 43) | 151 return (((xfs_fsblock_t)r->l0 & xfs_mask64lo(9)) << 43) |
168 (((xfs_fsblock_t)r->l1) >> 21); 152 (((xfs_fsblock_t)r->l1) >> 21);
169#else
170#ifdef DEBUG
171 xfs_dfsbno_t b;
172
173 b = (((xfs_dfsbno_t)r->l0 & xfs_mask64lo(9)) << 43) |
174 (((xfs_dfsbno_t)r->l1) >> 21);
175 ASSERT((b >> 32) == 0 || isnulldstartblock(b));
176 return (xfs_fsblock_t)b;
177#else /* !DEBUG */
178 return (xfs_fsblock_t)(((xfs_dfsbno_t)r->l1) >> 21);
179#endif /* DEBUG */
180#endif /* XFS_BIG_BLKNOS */
181} 153}
182 154
183/* 155/*
@@ -241,7 +213,6 @@ xfs_bmbt_set_allf(
241 ASSERT((startoff & xfs_mask64hi(64-BMBT_STARTOFF_BITLEN)) == 0); 213 ASSERT((startoff & xfs_mask64hi(64-BMBT_STARTOFF_BITLEN)) == 0);
242 ASSERT((blockcount & xfs_mask64hi(64-BMBT_BLOCKCOUNT_BITLEN)) == 0); 214 ASSERT((blockcount & xfs_mask64hi(64-BMBT_BLOCKCOUNT_BITLEN)) == 0);
243 215
244#if XFS_BIG_BLKNOS
245 ASSERT((startblock & xfs_mask64hi(64-BMBT_STARTBLOCK_BITLEN)) == 0); 216 ASSERT((startblock & xfs_mask64hi(64-BMBT_STARTBLOCK_BITLEN)) == 0);
246 217
247 r->l0 = ((xfs_bmbt_rec_base_t)extent_flag << 63) | 218 r->l0 = ((xfs_bmbt_rec_base_t)extent_flag << 63) |
@@ -250,23 +221,6 @@ xfs_bmbt_set_allf(
250 r->l1 = ((xfs_bmbt_rec_base_t)startblock << 21) | 221 r->l1 = ((xfs_bmbt_rec_base_t)startblock << 21) |
251 ((xfs_bmbt_rec_base_t)blockcount & 222 ((xfs_bmbt_rec_base_t)blockcount &
252 (xfs_bmbt_rec_base_t)xfs_mask64lo(21)); 223 (xfs_bmbt_rec_base_t)xfs_mask64lo(21));
253#else /* !XFS_BIG_BLKNOS */
254 if (isnullstartblock(startblock)) {
255 r->l0 = ((xfs_bmbt_rec_base_t)extent_flag << 63) |
256 ((xfs_bmbt_rec_base_t)startoff << 9) |
257 (xfs_bmbt_rec_base_t)xfs_mask64lo(9);
258 r->l1 = xfs_mask64hi(11) |
259 ((xfs_bmbt_rec_base_t)startblock << 21) |
260 ((xfs_bmbt_rec_base_t)blockcount &
261 (xfs_bmbt_rec_base_t)xfs_mask64lo(21));
262 } else {
263 r->l0 = ((xfs_bmbt_rec_base_t)extent_flag << 63) |
264 ((xfs_bmbt_rec_base_t)startoff << 9);
265 r->l1 = ((xfs_bmbt_rec_base_t)startblock << 21) |
266 ((xfs_bmbt_rec_base_t)blockcount &
267 (xfs_bmbt_rec_base_t)xfs_mask64lo(21));
268 }
269#endif /* XFS_BIG_BLKNOS */
270} 224}
271 225
272/* 226/*
@@ -298,8 +252,6 @@ xfs_bmbt_disk_set_allf(
298 ASSERT(state == XFS_EXT_NORM || state == XFS_EXT_UNWRITTEN); 252 ASSERT(state == XFS_EXT_NORM || state == XFS_EXT_UNWRITTEN);
299 ASSERT((startoff & xfs_mask64hi(64-BMBT_STARTOFF_BITLEN)) == 0); 253 ASSERT((startoff & xfs_mask64hi(64-BMBT_STARTOFF_BITLEN)) == 0);
300 ASSERT((blockcount & xfs_mask64hi(64-BMBT_BLOCKCOUNT_BITLEN)) == 0); 254 ASSERT((blockcount & xfs_mask64hi(64-BMBT_BLOCKCOUNT_BITLEN)) == 0);
301
302#if XFS_BIG_BLKNOS
303 ASSERT((startblock & xfs_mask64hi(64-BMBT_STARTBLOCK_BITLEN)) == 0); 255 ASSERT((startblock & xfs_mask64hi(64-BMBT_STARTBLOCK_BITLEN)) == 0);
304 256
305 r->l0 = cpu_to_be64( 257 r->l0 = cpu_to_be64(
@@ -310,26 +262,6 @@ xfs_bmbt_disk_set_allf(
310 ((xfs_bmbt_rec_base_t)startblock << 21) | 262 ((xfs_bmbt_rec_base_t)startblock << 21) |
311 ((xfs_bmbt_rec_base_t)blockcount & 263 ((xfs_bmbt_rec_base_t)blockcount &
312 (xfs_bmbt_rec_base_t)xfs_mask64lo(21))); 264 (xfs_bmbt_rec_base_t)xfs_mask64lo(21)));
313#else /* !XFS_BIG_BLKNOS */
314 if (isnullstartblock(startblock)) {
315 r->l0 = cpu_to_be64(
316 ((xfs_bmbt_rec_base_t)extent_flag << 63) |
317 ((xfs_bmbt_rec_base_t)startoff << 9) |
318 (xfs_bmbt_rec_base_t)xfs_mask64lo(9));
319 r->l1 = cpu_to_be64(xfs_mask64hi(11) |
320 ((xfs_bmbt_rec_base_t)startblock << 21) |
321 ((xfs_bmbt_rec_base_t)blockcount &
322 (xfs_bmbt_rec_base_t)xfs_mask64lo(21)));
323 } else {
324 r->l0 = cpu_to_be64(
325 ((xfs_bmbt_rec_base_t)extent_flag << 63) |
326 ((xfs_bmbt_rec_base_t)startoff << 9));
327 r->l1 = cpu_to_be64(
328 ((xfs_bmbt_rec_base_t)startblock << 21) |
329 ((xfs_bmbt_rec_base_t)blockcount &
330 (xfs_bmbt_rec_base_t)xfs_mask64lo(21)));
331 }
332#endif /* XFS_BIG_BLKNOS */
333} 265}
334 266
335/* 267/*
@@ -365,24 +297,11 @@ xfs_bmbt_set_startblock(
365 xfs_bmbt_rec_host_t *r, 297 xfs_bmbt_rec_host_t *r,
366 xfs_fsblock_t v) 298 xfs_fsblock_t v)
367{ 299{
368#if XFS_BIG_BLKNOS
369 ASSERT((v & xfs_mask64hi(12)) == 0); 300 ASSERT((v & xfs_mask64hi(12)) == 0);
370 r->l0 = (r->l0 & (xfs_bmbt_rec_base_t)xfs_mask64hi(55)) | 301 r->l0 = (r->l0 & (xfs_bmbt_rec_base_t)xfs_mask64hi(55)) |
371 (xfs_bmbt_rec_base_t)(v >> 43); 302 (xfs_bmbt_rec_base_t)(v >> 43);
372 r->l1 = (r->l1 & (xfs_bmbt_rec_base_t)xfs_mask64lo(21)) | 303 r->l1 = (r->l1 & (xfs_bmbt_rec_base_t)xfs_mask64lo(21)) |
373 (xfs_bmbt_rec_base_t)(v << 21); 304 (xfs_bmbt_rec_base_t)(v << 21);
374#else /* !XFS_BIG_BLKNOS */
375 if (isnullstartblock(v)) {
376 r->l0 |= (xfs_bmbt_rec_base_t)xfs_mask64lo(9);
377 r->l1 = (xfs_bmbt_rec_base_t)xfs_mask64hi(11) |
378 ((xfs_bmbt_rec_base_t)v << 21) |
379 (r->l1 & (xfs_bmbt_rec_base_t)xfs_mask64lo(21));
380 } else {
381 r->l0 &= ~(xfs_bmbt_rec_base_t)xfs_mask64lo(9);
382 r->l1 = ((xfs_bmbt_rec_base_t)v << 21) |
383 (r->l1 & (xfs_bmbt_rec_base_t)xfs_mask64lo(21));
384 }
385#endif /* XFS_BIG_BLKNOS */
386} 305}
387 306
388/* 307/*
@@ -438,8 +357,8 @@ xfs_bmbt_to_bmdr(
438 cpu_to_be64(XFS_BUF_DADDR_NULL)); 357 cpu_to_be64(XFS_BUF_DADDR_NULL));
439 } else 358 } else
440 ASSERT(rblock->bb_magic == cpu_to_be32(XFS_BMAP_MAGIC)); 359 ASSERT(rblock->bb_magic == cpu_to_be32(XFS_BMAP_MAGIC));
441 ASSERT(rblock->bb_u.l.bb_leftsib == cpu_to_be64(NULLDFSBNO)); 360 ASSERT(rblock->bb_u.l.bb_leftsib == cpu_to_be64(NULLFSBLOCK));
442 ASSERT(rblock->bb_u.l.bb_rightsib == cpu_to_be64(NULLDFSBNO)); 361 ASSERT(rblock->bb_u.l.bb_rightsib == cpu_to_be64(NULLFSBLOCK));
443 ASSERT(rblock->bb_level != 0); 362 ASSERT(rblock->bb_level != 0);
444 dblock->bb_level = rblock->bb_level; 363 dblock->bb_level = rblock->bb_level;
445 dblock->bb_numrecs = rblock->bb_numrecs; 364 dblock->bb_numrecs = rblock->bb_numrecs;
@@ -763,11 +682,11 @@ xfs_bmbt_verify(
763 682
764 /* sibling pointer verification */ 683 /* sibling pointer verification */
765 if (!block->bb_u.l.bb_leftsib || 684 if (!block->bb_u.l.bb_leftsib ||
766 (block->bb_u.l.bb_leftsib != cpu_to_be64(NULLDFSBNO) && 685 (block->bb_u.l.bb_leftsib != cpu_to_be64(NULLFSBLOCK) &&
767 !XFS_FSB_SANITY_CHECK(mp, be64_to_cpu(block->bb_u.l.bb_leftsib)))) 686 !XFS_FSB_SANITY_CHECK(mp, be64_to_cpu(block->bb_u.l.bb_leftsib))))
768 return false; 687 return false;
769 if (!block->bb_u.l.bb_rightsib || 688 if (!block->bb_u.l.bb_rightsib ||
770 (block->bb_u.l.bb_rightsib != cpu_to_be64(NULLDFSBNO) && 689 (block->bb_u.l.bb_rightsib != cpu_to_be64(NULLFSBLOCK) &&
771 !XFS_FSB_SANITY_CHECK(mp, be64_to_cpu(block->bb_u.l.bb_rightsib)))) 690 !XFS_FSB_SANITY_CHECK(mp, be64_to_cpu(block->bb_u.l.bb_rightsib))))
772 return false; 691 return false;
773 692
diff --git a/fs/xfs/libxfs/xfs_btree.c b/fs/xfs/libxfs/xfs_btree.c
index 0097c42f1f10..2435928b0765 100644
--- a/fs/xfs/libxfs/xfs_btree.c
+++ b/fs/xfs/libxfs/xfs_btree.c
@@ -77,11 +77,11 @@ xfs_btree_check_lblock(
77 be16_to_cpu(block->bb_numrecs) <= 77 be16_to_cpu(block->bb_numrecs) <=
78 cur->bc_ops->get_maxrecs(cur, level) && 78 cur->bc_ops->get_maxrecs(cur, level) &&
79 block->bb_u.l.bb_leftsib && 79 block->bb_u.l.bb_leftsib &&
80 (block->bb_u.l.bb_leftsib == cpu_to_be64(NULLDFSBNO) || 80 (block->bb_u.l.bb_leftsib == cpu_to_be64(NULLFSBLOCK) ||
81 XFS_FSB_SANITY_CHECK(mp, 81 XFS_FSB_SANITY_CHECK(mp,
82 be64_to_cpu(block->bb_u.l.bb_leftsib))) && 82 be64_to_cpu(block->bb_u.l.bb_leftsib))) &&
83 block->bb_u.l.bb_rightsib && 83 block->bb_u.l.bb_rightsib &&
84 (block->bb_u.l.bb_rightsib == cpu_to_be64(NULLDFSBNO) || 84 (block->bb_u.l.bb_rightsib == cpu_to_be64(NULLFSBLOCK) ||
85 XFS_FSB_SANITY_CHECK(mp, 85 XFS_FSB_SANITY_CHECK(mp,
86 be64_to_cpu(block->bb_u.l.bb_rightsib))); 86 be64_to_cpu(block->bb_u.l.bb_rightsib)));
87 87
@@ -166,12 +166,12 @@ xfs_btree_check_block(
166int /* error (0 or EFSCORRUPTED) */ 166int /* error (0 or EFSCORRUPTED) */
167xfs_btree_check_lptr( 167xfs_btree_check_lptr(
168 struct xfs_btree_cur *cur, /* btree cursor */ 168 struct xfs_btree_cur *cur, /* btree cursor */
169 xfs_dfsbno_t bno, /* btree block disk address */ 169 xfs_fsblock_t bno, /* btree block disk address */
170 int level) /* btree block level */ 170 int level) /* btree block level */
171{ 171{
172 XFS_WANT_CORRUPTED_RETURN( 172 XFS_WANT_CORRUPTED_RETURN(
173 level > 0 && 173 level > 0 &&
174 bno != NULLDFSBNO && 174 bno != NULLFSBLOCK &&
175 XFS_FSB_SANITY_CHECK(cur->bc_mp, bno)); 175 XFS_FSB_SANITY_CHECK(cur->bc_mp, bno));
176 return 0; 176 return 0;
177} 177}
@@ -594,7 +594,7 @@ xfs_btree_islastblock(
594 block = xfs_btree_get_block(cur, level, &bp); 594 block = xfs_btree_get_block(cur, level, &bp);
595 xfs_btree_check_block(cur, block, level, bp); 595 xfs_btree_check_block(cur, block, level, bp);
596 if (cur->bc_flags & XFS_BTREE_LONG_PTRS) 596 if (cur->bc_flags & XFS_BTREE_LONG_PTRS)
597 return block->bb_u.l.bb_rightsib == cpu_to_be64(NULLDFSBNO); 597 return block->bb_u.l.bb_rightsib == cpu_to_be64(NULLFSBLOCK);
598 else 598 else
599 return block->bb_u.s.bb_rightsib == cpu_to_be32(NULLAGBLOCK); 599 return block->bb_u.s.bb_rightsib == cpu_to_be32(NULLAGBLOCK);
600} 600}
@@ -770,16 +770,16 @@ xfs_btree_readahead_lblock(
770 struct xfs_btree_block *block) 770 struct xfs_btree_block *block)
771{ 771{
772 int rval = 0; 772 int rval = 0;
773 xfs_dfsbno_t left = be64_to_cpu(block->bb_u.l.bb_leftsib); 773 xfs_fsblock_t left = be64_to_cpu(block->bb_u.l.bb_leftsib);
774 xfs_dfsbno_t right = be64_to_cpu(block->bb_u.l.bb_rightsib); 774 xfs_fsblock_t right = be64_to_cpu(block->bb_u.l.bb_rightsib);
775 775
776 if ((lr & XFS_BTCUR_LEFTRA) && left != NULLDFSBNO) { 776 if ((lr & XFS_BTCUR_LEFTRA) && left != NULLFSBLOCK) {
777 xfs_btree_reada_bufl(cur->bc_mp, left, 1, 777 xfs_btree_reada_bufl(cur->bc_mp, left, 1,
778 cur->bc_ops->buf_ops); 778 cur->bc_ops->buf_ops);
779 rval++; 779 rval++;
780 } 780 }
781 781
782 if ((lr & XFS_BTCUR_RIGHTRA) && right != NULLDFSBNO) { 782 if ((lr & XFS_BTCUR_RIGHTRA) && right != NULLFSBLOCK) {
783 xfs_btree_reada_bufl(cur->bc_mp, right, 1, 783 xfs_btree_reada_bufl(cur->bc_mp, right, 1,
784 cur->bc_ops->buf_ops); 784 cur->bc_ops->buf_ops);
785 rval++; 785 rval++;
@@ -851,7 +851,7 @@ xfs_btree_ptr_to_daddr(
851 union xfs_btree_ptr *ptr) 851 union xfs_btree_ptr *ptr)
852{ 852{
853 if (cur->bc_flags & XFS_BTREE_LONG_PTRS) { 853 if (cur->bc_flags & XFS_BTREE_LONG_PTRS) {
854 ASSERT(ptr->l != cpu_to_be64(NULLDFSBNO)); 854 ASSERT(ptr->l != cpu_to_be64(NULLFSBLOCK));
855 855
856 return XFS_FSB_TO_DADDR(cur->bc_mp, be64_to_cpu(ptr->l)); 856 return XFS_FSB_TO_DADDR(cur->bc_mp, be64_to_cpu(ptr->l));
857 } else { 857 } else {
@@ -899,9 +899,9 @@ xfs_btree_setbuf(
899 899
900 b = XFS_BUF_TO_BLOCK(bp); 900 b = XFS_BUF_TO_BLOCK(bp);
901 if (cur->bc_flags & XFS_BTREE_LONG_PTRS) { 901 if (cur->bc_flags & XFS_BTREE_LONG_PTRS) {
902 if (b->bb_u.l.bb_leftsib == cpu_to_be64(NULLDFSBNO)) 902 if (b->bb_u.l.bb_leftsib == cpu_to_be64(NULLFSBLOCK))
903 cur->bc_ra[lev] |= XFS_BTCUR_LEFTRA; 903 cur->bc_ra[lev] |= XFS_BTCUR_LEFTRA;
904 if (b->bb_u.l.bb_rightsib == cpu_to_be64(NULLDFSBNO)) 904 if (b->bb_u.l.bb_rightsib == cpu_to_be64(NULLFSBLOCK))
905 cur->bc_ra[lev] |= XFS_BTCUR_RIGHTRA; 905 cur->bc_ra[lev] |= XFS_BTCUR_RIGHTRA;
906 } else { 906 } else {
907 if (b->bb_u.s.bb_leftsib == cpu_to_be32(NULLAGBLOCK)) 907 if (b->bb_u.s.bb_leftsib == cpu_to_be32(NULLAGBLOCK))
@@ -917,7 +917,7 @@ xfs_btree_ptr_is_null(
917 union xfs_btree_ptr *ptr) 917 union xfs_btree_ptr *ptr)
918{ 918{
919 if (cur->bc_flags & XFS_BTREE_LONG_PTRS) 919 if (cur->bc_flags & XFS_BTREE_LONG_PTRS)
920 return ptr->l == cpu_to_be64(NULLDFSBNO); 920 return ptr->l == cpu_to_be64(NULLFSBLOCK);
921 else 921 else
922 return ptr->s == cpu_to_be32(NULLAGBLOCK); 922 return ptr->s == cpu_to_be32(NULLAGBLOCK);
923} 923}
@@ -928,7 +928,7 @@ xfs_btree_set_ptr_null(
928 union xfs_btree_ptr *ptr) 928 union xfs_btree_ptr *ptr)
929{ 929{
930 if (cur->bc_flags & XFS_BTREE_LONG_PTRS) 930 if (cur->bc_flags & XFS_BTREE_LONG_PTRS)
931 ptr->l = cpu_to_be64(NULLDFSBNO); 931 ptr->l = cpu_to_be64(NULLFSBLOCK);
932 else 932 else
933 ptr->s = cpu_to_be32(NULLAGBLOCK); 933 ptr->s = cpu_to_be32(NULLAGBLOCK);
934} 934}
@@ -996,8 +996,8 @@ xfs_btree_init_block_int(
996 buf->bb_numrecs = cpu_to_be16(numrecs); 996 buf->bb_numrecs = cpu_to_be16(numrecs);
997 997
998 if (flags & XFS_BTREE_LONG_PTRS) { 998 if (flags & XFS_BTREE_LONG_PTRS) {
999 buf->bb_u.l.bb_leftsib = cpu_to_be64(NULLDFSBNO); 999 buf->bb_u.l.bb_leftsib = cpu_to_be64(NULLFSBLOCK);
1000 buf->bb_u.l.bb_rightsib = cpu_to_be64(NULLDFSBNO); 1000 buf->bb_u.l.bb_rightsib = cpu_to_be64(NULLFSBLOCK);
1001 if (flags & XFS_BTREE_CRC_BLOCKS) { 1001 if (flags & XFS_BTREE_CRC_BLOCKS) {
1002 buf->bb_u.l.bb_blkno = cpu_to_be64(blkno); 1002 buf->bb_u.l.bb_blkno = cpu_to_be64(blkno);
1003 buf->bb_u.l.bb_owner = cpu_to_be64(owner); 1003 buf->bb_u.l.bb_owner = cpu_to_be64(owner);
diff --git a/fs/xfs/libxfs/xfs_btree.h b/fs/xfs/libxfs/xfs_btree.h
index a04b69422f67..8f18bab73ea5 100644
--- a/fs/xfs/libxfs/xfs_btree.h
+++ b/fs/xfs/libxfs/xfs_btree.h
@@ -258,7 +258,7 @@ xfs_btree_check_block(
258int /* error (0 or EFSCORRUPTED) */ 258int /* error (0 or EFSCORRUPTED) */
259xfs_btree_check_lptr( 259xfs_btree_check_lptr(
260 struct xfs_btree_cur *cur, /* btree cursor */ 260 struct xfs_btree_cur *cur, /* btree cursor */
261 xfs_dfsbno_t ptr, /* btree block disk address */ 261 xfs_fsblock_t ptr, /* btree block disk address */
262 int level); /* btree block level */ 262 int level); /* btree block level */
263 263
264/* 264/*
diff --git a/fs/xfs/libxfs/xfs_da_btree.c b/fs/xfs/libxfs/xfs_da_btree.c
index 8d809873525b..2c42ae28d027 100644
--- a/fs/xfs/libxfs/xfs_da_btree.c
+++ b/fs/xfs/libxfs/xfs_da_btree.c
@@ -2004,7 +2004,7 @@ xfs_da_grow_inode_int(
2004 struct xfs_trans *tp = args->trans; 2004 struct xfs_trans *tp = args->trans;
2005 struct xfs_inode *dp = args->dp; 2005 struct xfs_inode *dp = args->dp;
2006 int w = args->whichfork; 2006 int w = args->whichfork;
2007 xfs_drfsbno_t nblks = dp->i_d.di_nblocks; 2007 xfs_rfsblock_t nblks = dp->i_d.di_nblocks;
2008 struct xfs_bmbt_irec map, *mapp; 2008 struct xfs_bmbt_irec map, *mapp;
2009 int nmap, error, got, i, mapi; 2009 int nmap, error, got, i, mapi;
2010 2010
diff --git a/fs/xfs/libxfs/xfs_dir2_sf.c b/fs/xfs/libxfs/xfs_dir2_sf.c
index 8f4f26af35e1..5079e051ef08 100644
--- a/fs/xfs/libxfs/xfs_dir2_sf.c
+++ b/fs/xfs/libxfs/xfs_dir2_sf.c
@@ -51,10 +51,9 @@ static void xfs_dir2_sf_check(xfs_da_args_t *args);
51#else 51#else
52#define xfs_dir2_sf_check(args) 52#define xfs_dir2_sf_check(args)
53#endif /* DEBUG */ 53#endif /* DEBUG */
54#if XFS_BIG_INUMS 54
55static void xfs_dir2_sf_toino4(xfs_da_args_t *args); 55static void xfs_dir2_sf_toino4(xfs_da_args_t *args);
56static void xfs_dir2_sf_toino8(xfs_da_args_t *args); 56static void xfs_dir2_sf_toino8(xfs_da_args_t *args);
57#endif /* XFS_BIG_INUMS */
58 57
59/* 58/*
60 * Given a block directory (dp/block), calculate its size as a shortform (sf) 59 * Given a block directory (dp/block), calculate its size as a shortform (sf)
@@ -117,10 +116,10 @@ xfs_dir2_block_sfsize(
117 isdotdot = 116 isdotdot =
118 dep->namelen == 2 && 117 dep->namelen == 2 &&
119 dep->name[0] == '.' && dep->name[1] == '.'; 118 dep->name[0] == '.' && dep->name[1] == '.';
120#if XFS_BIG_INUMS 119
121 if (!isdot) 120 if (!isdot)
122 i8count += be64_to_cpu(dep->inumber) > XFS_DIR2_MAX_SHORT_INUM; 121 i8count += be64_to_cpu(dep->inumber) > XFS_DIR2_MAX_SHORT_INUM;
123#endif 122
124 /* take into account the file type field */ 123 /* take into account the file type field */
125 if (!isdot && !isdotdot) { 124 if (!isdot && !isdotdot) {
126 count++; 125 count++;
@@ -318,7 +317,7 @@ xfs_dir2_sf_addname(
318 */ 317 */
319 incr_isize = dp->d_ops->sf_entsize(sfp, args->namelen); 318 incr_isize = dp->d_ops->sf_entsize(sfp, args->namelen);
320 objchange = 0; 319 objchange = 0;
321#if XFS_BIG_INUMS 320
322 /* 321 /*
323 * Do we have to change to 8 byte inodes? 322 * Do we have to change to 8 byte inodes?
324 */ 323 */
@@ -332,7 +331,7 @@ xfs_dir2_sf_addname(
332 (uint)sizeof(xfs_dir2_ino4_t)); 331 (uint)sizeof(xfs_dir2_ino4_t));
333 objchange = 1; 332 objchange = 1;
334 } 333 }
335#endif 334
336 new_isize = (int)dp->i_d.di_size + incr_isize; 335 new_isize = (int)dp->i_d.di_size + incr_isize;
337 /* 336 /*
338 * Won't fit as shortform any more (due to size), 337 * Won't fit as shortform any more (due to size),
@@ -370,10 +369,8 @@ xfs_dir2_sf_addname(
370 */ 369 */
371 else { 370 else {
372 ASSERT(pick == 2); 371 ASSERT(pick == 2);
373#if XFS_BIG_INUMS
374 if (objchange) 372 if (objchange)
375 xfs_dir2_sf_toino8(args); 373 xfs_dir2_sf_toino8(args);
376#endif
377 xfs_dir2_sf_addname_hard(args, objchange, new_isize); 374 xfs_dir2_sf_addname_hard(args, objchange, new_isize);
378 } 375 }
379 xfs_trans_log_inode(args->trans, dp, XFS_ILOG_CORE | XFS_ILOG_DDATA); 376 xfs_trans_log_inode(args->trans, dp, XFS_ILOG_CORE | XFS_ILOG_DDATA);
@@ -425,10 +422,8 @@ xfs_dir2_sf_addname_easy(
425 * Update the header and inode. 422 * Update the header and inode.
426 */ 423 */
427 sfp->count++; 424 sfp->count++;
428#if XFS_BIG_INUMS
429 if (args->inumber > XFS_DIR2_MAX_SHORT_INUM) 425 if (args->inumber > XFS_DIR2_MAX_SHORT_INUM)
430 sfp->i8count++; 426 sfp->i8count++;
431#endif
432 dp->i_d.di_size = new_isize; 427 dp->i_d.di_size = new_isize;
433 xfs_dir2_sf_check(args); 428 xfs_dir2_sf_check(args);
434} 429}
@@ -516,10 +511,8 @@ xfs_dir2_sf_addname_hard(
516 dp->d_ops->sf_put_ino(sfp, sfep, args->inumber); 511 dp->d_ops->sf_put_ino(sfp, sfep, args->inumber);
517 dp->d_ops->sf_put_ftype(sfep, args->filetype); 512 dp->d_ops->sf_put_ftype(sfep, args->filetype);
518 sfp->count++; 513 sfp->count++;
519#if XFS_BIG_INUMS
520 if (args->inumber > XFS_DIR2_MAX_SHORT_INUM && !objchange) 514 if (args->inumber > XFS_DIR2_MAX_SHORT_INUM && !objchange)
521 sfp->i8count++; 515 sfp->i8count++;
522#endif
523 /* 516 /*
524 * If there's more left to copy, do that. 517 * If there's more left to copy, do that.
525 */ 518 */
@@ -593,13 +586,8 @@ xfs_dir2_sf_addname_pick(
593 /* 586 /*
594 * If changing the inode number size, do it the hard way. 587 * If changing the inode number size, do it the hard way.
595 */ 588 */
596#if XFS_BIG_INUMS 589 if (objchange)
597 if (objchange) {
598 return 2; 590 return 2;
599 }
600#else
601 ASSERT(objchange == 0);
602#endif
603 /* 591 /*
604 * If it won't fit at the end then do it the hard way (use the hole). 592 * If it won't fit at the end then do it the hard way (use the hole).
605 */ 593 */
@@ -650,7 +638,6 @@ xfs_dir2_sf_check(
650 ASSERT(dp->d_ops->sf_get_ftype(sfep) < XFS_DIR3_FT_MAX); 638 ASSERT(dp->d_ops->sf_get_ftype(sfep) < XFS_DIR3_FT_MAX);
651 } 639 }
652 ASSERT(i8count == sfp->i8count); 640 ASSERT(i8count == sfp->i8count);
653 ASSERT(XFS_BIG_INUMS || i8count == 0);
654 ASSERT((char *)sfep - (char *)sfp == dp->i_d.di_size); 641 ASSERT((char *)sfep - (char *)sfp == dp->i_d.di_size);
655 ASSERT(offset + 642 ASSERT(offset +
656 (sfp->count + 2) * (uint)sizeof(xfs_dir2_leaf_entry_t) + 643 (sfp->count + 2) * (uint)sizeof(xfs_dir2_leaf_entry_t) +
@@ -870,7 +857,6 @@ xfs_dir2_sf_removename(
870 */ 857 */
871 xfs_idata_realloc(dp, newsize - oldsize, XFS_DATA_FORK); 858 xfs_idata_realloc(dp, newsize - oldsize, XFS_DATA_FORK);
872 sfp = (xfs_dir2_sf_hdr_t *)dp->i_df.if_u1.if_data; 859 sfp = (xfs_dir2_sf_hdr_t *)dp->i_df.if_u1.if_data;
873#if XFS_BIG_INUMS
874 /* 860 /*
875 * Are we changing inode number size? 861 * Are we changing inode number size?
876 */ 862 */
@@ -880,7 +866,6 @@ xfs_dir2_sf_removename(
880 else 866 else
881 sfp->i8count--; 867 sfp->i8count--;
882 } 868 }
883#endif
884 xfs_dir2_sf_check(args); 869 xfs_dir2_sf_check(args);
885 xfs_trans_log_inode(args->trans, dp, XFS_ILOG_CORE | XFS_ILOG_DDATA); 870 xfs_trans_log_inode(args->trans, dp, XFS_ILOG_CORE | XFS_ILOG_DDATA);
886 return 0; 871 return 0;
@@ -895,12 +880,8 @@ xfs_dir2_sf_replace(
895{ 880{
896 xfs_inode_t *dp; /* incore directory inode */ 881 xfs_inode_t *dp; /* incore directory inode */
897 int i; /* entry index */ 882 int i; /* entry index */
898#if XFS_BIG_INUMS || defined(DEBUG)
899 xfs_ino_t ino=0; /* entry old inode number */ 883 xfs_ino_t ino=0; /* entry old inode number */
900#endif
901#if XFS_BIG_INUMS
902 int i8elevated; /* sf_toino8 set i8count=1 */ 884 int i8elevated; /* sf_toino8 set i8count=1 */
903#endif
904 xfs_dir2_sf_entry_t *sfep; /* shortform directory entry */ 885 xfs_dir2_sf_entry_t *sfep; /* shortform directory entry */
905 xfs_dir2_sf_hdr_t *sfp; /* shortform structure */ 886 xfs_dir2_sf_hdr_t *sfp; /* shortform structure */
906 887
@@ -920,7 +901,7 @@ xfs_dir2_sf_replace(
920 ASSERT(dp->i_df.if_u1.if_data != NULL); 901 ASSERT(dp->i_df.if_u1.if_data != NULL);
921 sfp = (xfs_dir2_sf_hdr_t *)dp->i_df.if_u1.if_data; 902 sfp = (xfs_dir2_sf_hdr_t *)dp->i_df.if_u1.if_data;
922 ASSERT(dp->i_d.di_size >= xfs_dir2_sf_hdr_size(sfp->i8count)); 903 ASSERT(dp->i_d.di_size >= xfs_dir2_sf_hdr_size(sfp->i8count));
923#if XFS_BIG_INUMS 904
924 /* 905 /*
925 * New inode number is large, and need to convert to 8-byte inodes. 906 * New inode number is large, and need to convert to 8-byte inodes.
926 */ 907 */
@@ -951,17 +932,15 @@ xfs_dir2_sf_replace(
951 sfp = (xfs_dir2_sf_hdr_t *)dp->i_df.if_u1.if_data; 932 sfp = (xfs_dir2_sf_hdr_t *)dp->i_df.if_u1.if_data;
952 } else 933 } else
953 i8elevated = 0; 934 i8elevated = 0;
954#endif 935
955 ASSERT(args->namelen != 1 || args->name[0] != '.'); 936 ASSERT(args->namelen != 1 || args->name[0] != '.');
956 /* 937 /*
957 * Replace ..'s entry. 938 * Replace ..'s entry.
958 */ 939 */
959 if (args->namelen == 2 && 940 if (args->namelen == 2 &&
960 args->name[0] == '.' && args->name[1] == '.') { 941 args->name[0] == '.' && args->name[1] == '.') {
961#if XFS_BIG_INUMS || defined(DEBUG)
962 ino = dp->d_ops->sf_get_parent_ino(sfp); 942 ino = dp->d_ops->sf_get_parent_ino(sfp);
963 ASSERT(args->inumber != ino); 943 ASSERT(args->inumber != ino);
964#endif
965 dp->d_ops->sf_put_parent_ino(sfp, args->inumber); 944 dp->d_ops->sf_put_parent_ino(sfp, args->inumber);
966 } 945 }
967 /* 946 /*
@@ -972,10 +951,8 @@ xfs_dir2_sf_replace(
972 i++, sfep = dp->d_ops->sf_nextentry(sfp, sfep)) { 951 i++, sfep = dp->d_ops->sf_nextentry(sfp, sfep)) {
973 if (xfs_da_compname(args, sfep->name, sfep->namelen) == 952 if (xfs_da_compname(args, sfep->name, sfep->namelen) ==
974 XFS_CMP_EXACT) { 953 XFS_CMP_EXACT) {
975#if XFS_BIG_INUMS || defined(DEBUG)
976 ino = dp->d_ops->sf_get_ino(sfp, sfep); 954 ino = dp->d_ops->sf_get_ino(sfp, sfep);
977 ASSERT(args->inumber != ino); 955 ASSERT(args->inumber != ino);
978#endif
979 dp->d_ops->sf_put_ino(sfp, sfep, args->inumber); 956 dp->d_ops->sf_put_ino(sfp, sfep, args->inumber);
980 dp->d_ops->sf_put_ftype(sfep, args->filetype); 957 dp->d_ops->sf_put_ftype(sfep, args->filetype);
981 break; 958 break;
@@ -986,14 +963,11 @@ xfs_dir2_sf_replace(
986 */ 963 */
987 if (i == sfp->count) { 964 if (i == sfp->count) {
988 ASSERT(args->op_flags & XFS_DA_OP_OKNOENT); 965 ASSERT(args->op_flags & XFS_DA_OP_OKNOENT);
989#if XFS_BIG_INUMS
990 if (i8elevated) 966 if (i8elevated)
991 xfs_dir2_sf_toino4(args); 967 xfs_dir2_sf_toino4(args);
992#endif
993 return -ENOENT; 968 return -ENOENT;
994 } 969 }
995 } 970 }
996#if XFS_BIG_INUMS
997 /* 971 /*
998 * See if the old number was large, the new number is small. 972 * See if the old number was large, the new number is small.
999 */ 973 */
@@ -1020,13 +994,11 @@ xfs_dir2_sf_replace(
1020 if (!i8elevated) 994 if (!i8elevated)
1021 sfp->i8count++; 995 sfp->i8count++;
1022 } 996 }
1023#endif
1024 xfs_dir2_sf_check(args); 997 xfs_dir2_sf_check(args);
1025 xfs_trans_log_inode(args->trans, dp, XFS_ILOG_DDATA); 998 xfs_trans_log_inode(args->trans, dp, XFS_ILOG_DDATA);
1026 return 0; 999 return 0;
1027} 1000}
1028 1001
1029#if XFS_BIG_INUMS
1030/* 1002/*
1031 * Convert from 8-byte inode numbers to 4-byte inode numbers. 1003 * Convert from 8-byte inode numbers to 4-byte inode numbers.
1032 * The last 8-byte inode number is gone, but the count is still 1. 1004 * The last 8-byte inode number is gone, but the count is still 1.
@@ -1181,4 +1153,3 @@ xfs_dir2_sf_toino8(
1181 dp->i_d.di_size = newsize; 1153 dp->i_d.di_size = newsize;
1182 xfs_trans_log_inode(args->trans, dp, XFS_ILOG_CORE | XFS_ILOG_DDATA); 1154 xfs_trans_log_inode(args->trans, dp, XFS_ILOG_CORE | XFS_ILOG_DDATA);
1183} 1155}
1184#endif /* XFS_BIG_INUMS */
diff --git a/fs/xfs/libxfs/xfs_format.h b/fs/xfs/libxfs/xfs_format.h
index 34d85aca3058..7e42bba9a420 100644
--- a/fs/xfs/libxfs/xfs_format.h
+++ b/fs/xfs/libxfs/xfs_format.h
@@ -68,11 +68,7 @@ struct xfs_ifork;
68#define XFS_RTLOBIT(w) xfs_lowbit32(w) 68#define XFS_RTLOBIT(w) xfs_lowbit32(w)
69#define XFS_RTHIBIT(w) xfs_highbit32(w) 69#define XFS_RTHIBIT(w) xfs_highbit32(w)
70 70
71#if XFS_BIG_BLKNOS
72#define XFS_RTBLOCKLOG(b) xfs_highbit64(b) 71#define XFS_RTBLOCKLOG(b) xfs_highbit64(b)
73#else
74#define XFS_RTBLOCKLOG(b) xfs_highbit32(b)
75#endif
76 72
77/* 73/*
78 * Dquot and dquot block format definitions 74 * Dquot and dquot block format definitions
@@ -304,23 +300,15 @@ typedef struct xfs_bmbt_rec_host {
304 * Values and macros for delayed-allocation startblock fields. 300 * Values and macros for delayed-allocation startblock fields.
305 */ 301 */
306#define STARTBLOCKVALBITS 17 302#define STARTBLOCKVALBITS 17
307#define STARTBLOCKMASKBITS (15 + XFS_BIG_BLKNOS * 20) 303#define STARTBLOCKMASKBITS (15 + 20)
308#define DSTARTBLOCKMASKBITS (15 + 20)
309#define STARTBLOCKMASK \ 304#define STARTBLOCKMASK \
310 (((((xfs_fsblock_t)1) << STARTBLOCKMASKBITS) - 1) << STARTBLOCKVALBITS) 305 (((((xfs_fsblock_t)1) << STARTBLOCKMASKBITS) - 1) << STARTBLOCKVALBITS)
311#define DSTARTBLOCKMASK \
312 (((((xfs_dfsbno_t)1) << DSTARTBLOCKMASKBITS) - 1) << STARTBLOCKVALBITS)
313 306
314static inline int isnullstartblock(xfs_fsblock_t x) 307static inline int isnullstartblock(xfs_fsblock_t x)
315{ 308{
316 return ((x) & STARTBLOCKMASK) == STARTBLOCKMASK; 309 return ((x) & STARTBLOCKMASK) == STARTBLOCKMASK;
317} 310}
318 311
319static inline int isnulldstartblock(xfs_dfsbno_t x)
320{
321 return ((x) & DSTARTBLOCKMASK) == DSTARTBLOCKMASK;
322}
323
324static inline xfs_fsblock_t nullstartblock(int k) 312static inline xfs_fsblock_t nullstartblock(int k)
325{ 313{
326 ASSERT(k < (1 << STARTBLOCKVALBITS)); 314 ASSERT(k < (1 << STARTBLOCKVALBITS));
diff --git a/fs/xfs/libxfs/xfs_inode_fork.c b/fs/xfs/libxfs/xfs_inode_fork.c
index 8ac9411bcf2a..6a00f7fed69d 100644
--- a/fs/xfs/libxfs/xfs_inode_fork.c
+++ b/fs/xfs/libxfs/xfs_inode_fork.c
@@ -528,7 +528,7 @@ xfs_iroot_realloc(
528 ifp->if_broot_bytes = (int)new_size; 528 ifp->if_broot_bytes = (int)new_size;
529 ASSERT(XFS_BMAP_BMDR_SPACE(ifp->if_broot) <= 529 ASSERT(XFS_BMAP_BMDR_SPACE(ifp->if_broot) <=
530 XFS_IFORK_SIZE(ip, whichfork)); 530 XFS_IFORK_SIZE(ip, whichfork));
531 memmove(np, op, cur_max * (uint)sizeof(xfs_dfsbno_t)); 531 memmove(np, op, cur_max * (uint)sizeof(xfs_fsblock_t));
532 return; 532 return;
533 } 533 }
534 534
@@ -575,7 +575,7 @@ xfs_iroot_realloc(
575 ifp->if_broot_bytes); 575 ifp->if_broot_bytes);
576 np = (char *)XFS_BMAP_BROOT_PTR_ADDR(mp, new_broot, 1, 576 np = (char *)XFS_BMAP_BROOT_PTR_ADDR(mp, new_broot, 1,
577 (int)new_size); 577 (int)new_size);
578 memcpy(np, op, new_max * (uint)sizeof(xfs_dfsbno_t)); 578 memcpy(np, op, new_max * (uint)sizeof(xfs_fsblock_t));
579 } 579 }
580 kmem_free(ifp->if_broot); 580 kmem_free(ifp->if_broot);
581 ifp->if_broot = new_broot; 581 ifp->if_broot = new_broot;
diff --git a/fs/xfs/libxfs/xfs_inum.h b/fs/xfs/libxfs/xfs_inum.h
index 90efdaf1706f..4ff2278e147a 100644
--- a/fs/xfs/libxfs/xfs_inum.h
+++ b/fs/xfs/libxfs/xfs_inum.h
@@ -54,11 +54,7 @@ struct xfs_mount;
54#define XFS_OFFBNO_TO_AGINO(mp,b,o) \ 54#define XFS_OFFBNO_TO_AGINO(mp,b,o) \
55 ((xfs_agino_t)(((b) << XFS_INO_OFFSET_BITS(mp)) | (o))) 55 ((xfs_agino_t)(((b) << XFS_INO_OFFSET_BITS(mp)) | (o)))
56 56
57#if XFS_BIG_INUMS
58#define XFS_MAXINUMBER ((xfs_ino_t)((1ULL << 56) - 1ULL)) 57#define XFS_MAXINUMBER ((xfs_ino_t)((1ULL << 56) - 1ULL))
59#else
60#define XFS_MAXINUMBER ((xfs_ino_t)((1ULL << 32) - 1ULL))
61#endif
62#define XFS_MAXINUMBER_32 ((xfs_ino_t)((1ULL << 32) - 1ULL)) 58#define XFS_MAXINUMBER_32 ((xfs_ino_t)((1ULL << 32) - 1ULL))
63 59
64#endif /* __XFS_INUM_H__ */ 60#endif /* __XFS_INUM_H__ */
diff --git a/fs/xfs/libxfs/xfs_log_format.h b/fs/xfs/libxfs/xfs_log_format.h
index f0969c77bdbe..aff12f2d4428 100644
--- a/fs/xfs/libxfs/xfs_log_format.h
+++ b/fs/xfs/libxfs/xfs_log_format.h
@@ -380,7 +380,7 @@ typedef struct xfs_icdinode {
380 xfs_ictimestamp_t di_mtime; /* time last modified */ 380 xfs_ictimestamp_t di_mtime; /* time last modified */
381 xfs_ictimestamp_t di_ctime; /* time created/inode modified */ 381 xfs_ictimestamp_t di_ctime; /* time created/inode modified */
382 xfs_fsize_t di_size; /* number of bytes in file */ 382 xfs_fsize_t di_size; /* number of bytes in file */
383 xfs_drfsbno_t di_nblocks; /* # of direct & btree blocks used */ 383 xfs_rfsblock_t di_nblocks; /* # of direct & btree blocks used */
384 xfs_extlen_t di_extsize; /* basic/minimum extent size for file */ 384 xfs_extlen_t di_extsize; /* basic/minimum extent size for file */
385 xfs_extnum_t di_nextents; /* number of extents in data fork */ 385 xfs_extnum_t di_nextents; /* number of extents in data fork */
386 xfs_aextnum_t di_anextents; /* number of extents in attribute fork*/ 386 xfs_aextnum_t di_anextents; /* number of extents in attribute fork*/
@@ -516,7 +516,7 @@ xfs_blft_from_flags(struct xfs_buf_log_format *blf)
516 * EFI/EFD log format definitions 516 * EFI/EFD log format definitions
517 */ 517 */
518typedef struct xfs_extent { 518typedef struct xfs_extent {
519 xfs_dfsbno_t ext_start; 519 xfs_fsblock_t ext_start;
520 xfs_extlen_t ext_len; 520 xfs_extlen_t ext_len;
521} xfs_extent_t; 521} xfs_extent_t;
522 522
diff --git a/fs/xfs/libxfs/xfs_sb.h b/fs/xfs/libxfs/xfs_sb.h
index c43c2d609a24..2e739708afd3 100644
--- a/fs/xfs/libxfs/xfs_sb.h
+++ b/fs/xfs/libxfs/xfs_sb.h
@@ -87,11 +87,11 @@ struct xfs_trans;
87typedef struct xfs_sb { 87typedef struct xfs_sb {
88 __uint32_t sb_magicnum; /* magic number == XFS_SB_MAGIC */ 88 __uint32_t sb_magicnum; /* magic number == XFS_SB_MAGIC */
89 __uint32_t sb_blocksize; /* logical block size, bytes */ 89 __uint32_t sb_blocksize; /* logical block size, bytes */
90 xfs_drfsbno_t sb_dblocks; /* number of data blocks */ 90 xfs_rfsblock_t sb_dblocks; /* number of data blocks */
91 xfs_drfsbno_t sb_rblocks; /* number of realtime blocks */ 91 xfs_rfsblock_t sb_rblocks; /* number of realtime blocks */
92 xfs_drtbno_t sb_rextents; /* number of realtime extents */ 92 xfs_rtblock_t sb_rextents; /* number of realtime extents */
93 uuid_t sb_uuid; /* file system unique id */ 93 uuid_t sb_uuid; /* file system unique id */
94 xfs_dfsbno_t sb_logstart; /* starting block of log if internal */ 94 xfs_fsblock_t sb_logstart; /* starting block of log if internal */
95 xfs_ino_t sb_rootino; /* root inode number */ 95 xfs_ino_t sb_rootino; /* root inode number */
96 xfs_ino_t sb_rbmino; /* bitmap inode for realtime extents */ 96 xfs_ino_t sb_rbmino; /* bitmap inode for realtime extents */
97 xfs_ino_t sb_rsumino; /* summary inode for rt bitmap */ 97 xfs_ino_t sb_rsumino; /* summary inode for rt bitmap */