Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Christoph Hellwig and committed by
Dave Chinner
d5cf09ba 74dc93a9

+50 -239
+1
fs/xfs/Kconfig
··· 1 1 config XFS_FS 2 2 tristate "XFS filesystem support" 3 3 depends on BLOCK 4 + depends on (64BIT || LBDAF) 4 5 select EXPORTFS 5 6 select LIBCRC32C 6 7 help
+2 -6
fs/xfs/libxfs/xfs_bmap.c
··· 392 392 pp = XFS_BMAP_BROOT_PTR_ADDR(mp, block, 1, ifp->if_broot_bytes); 393 393 bno = be64_to_cpu(*pp); 394 394 395 - ASSERT(bno != NULLDFSBNO); 395 + ASSERT(bno != NULLFSBLOCK); 396 396 ASSERT(XFS_FSB_TO_AGNO(mp, bno) < mp->m_sb.sb_agcount); 397 397 ASSERT(XFS_FSB_TO_AGBNO(mp, bno) < mp->m_sb.sb_agblocks); 398 398 ··· 1299 1299 ASSERT(level > 0); 1300 1300 pp = XFS_BMAP_BROOT_PTR_ADDR(mp, block, 1, ifp->if_broot_bytes); 1301 1301 bno = be64_to_cpu(*pp); 1302 - ASSERT(bno != NULLDFSBNO); 1302 + ASSERT(bno != NULLFSBLOCK); 1303 1303 ASSERT(XFS_FSB_TO_AGNO(mp, bno) < mp->m_sb.sb_agcount); 1304 1304 ASSERT(XFS_FSB_TO_AGBNO(mp, bno) < mp->m_sb.sb_agblocks); 1305 1305 /* ··· 1429 1429 gotp->br_startoff = 0xffa5a5a5a5a5a5a5LL; 1430 1430 gotp->br_blockcount = 0xa55a5a5a5a5a5a5aLL; 1431 1431 gotp->br_state = XFS_EXT_INVALID; 1432 - #if XFS_BIG_BLKNOS 1433 1432 gotp->br_startblock = 0xffffa5a5a5a5a5a5LL; 1434 - #else 1435 - gotp->br_startblock = 0xffffa5a5; 1436 - #endif 1437 1433 prevp->br_startoff = NULLFILEOFF; 1438 1434 1439 1435 ep = xfs_iext_bno_to_ext(ifp, bno, &lastx);
+4 -85
fs/xfs/libxfs/xfs_bmap_btree.c
··· 111 111 ext_flag = (int)(l0 >> (64 - BMBT_EXNTFLAG_BITLEN)); 112 112 s->br_startoff = ((xfs_fileoff_t)l0 & 113 113 xfs_mask64lo(64 - BMBT_EXNTFLAG_BITLEN)) >> 9; 114 - #if XFS_BIG_BLKNOS 115 114 s->br_startblock = (((xfs_fsblock_t)l0 & xfs_mask64lo(9)) << 43) | 116 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 116 s->br_blockcount = (xfs_filblks_t)(l1 & xfs_mask64lo(21)); 132 117 /* This is xfs_extent_state() in-line */ 133 118 if (ext_flag) { ··· 148 163 xfs_bmbt_get_startblock( 149 164 xfs_bmbt_rec_host_t *r) 150 165 { 151 - #if XFS_BIG_BLKNOS 152 166 return (((xfs_fsblock_t)r->l0 & xfs_mask64lo(9)) << 43) | 153 167 (((xfs_fsblock_t)r->l1) >> 21); 154 - #else 155 - #ifdef DEBUG 156 - xfs_dfsbno_t b; 157 - 158 - b = (((xfs_dfsbno_t)r->l0 & xfs_mask64lo(9)) << 43) | 159 - (((xfs_dfsbno_t)r->l1) >> 21); 160 - ASSERT((b >> 32) == 0 || isnulldstartblock(b)); 161 - return (xfs_fsblock_t)b; 162 - #else /* !DEBUG */ 163 - return (xfs_fsblock_t)(((xfs_dfsbno_t)r->l1) >> 21); 164 - #endif /* DEBUG */ 165 - #endif /* XFS_BIG_BLKNOS */ 166 168 } 167 169 168 170 /* ··· 213 241 ASSERT((startoff & xfs_mask64hi(64-BMBT_STARTOFF_BITLEN)) == 0); 214 242 ASSERT((blockcount & xfs_mask64hi(64-BMBT_BLOCKCOUNT_BITLEN)) == 0); 215 243 216 - #if XFS_BIG_BLKNOS 217 244 ASSERT((startblock & xfs_mask64hi(64-BMBT_STARTBLOCK_BITLEN)) == 0); 218 245 219 246 r->l0 = ((xfs_bmbt_rec_base_t)extent_flag << 63) | ··· 221 250 r->l1 = ((xfs_bmbt_rec_base_t)startblock << 21) | 222 251 ((xfs_bmbt_rec_base_t)blockcount & 223 252 (xfs_bmbt_rec_base_t)xfs_mask64lo(21)); 224 - #else /* !XFS_BIG_BLKNOS */ 225 - if (isnullstartblock(startblock)) { 226 - r->l0 = ((xfs_bmbt_rec_base_t)extent_flag << 63) | 227 - ((xfs_bmbt_rec_base_t)startoff << 9) | 228 - (xfs_bmbt_rec_base_t)xfs_mask64lo(9); 229 - r->l1 = xfs_mask64hi(11) | 230 - ((xfs_bmbt_rec_base_t)startblock << 21) | 231 - ((xfs_bmbt_rec_base_t)blockcount & 232 - (xfs_bmbt_rec_base_t)xfs_mask64lo(21)); 233 - } else { 234 - r->l0 = ((xfs_bmbt_rec_base_t)extent_flag << 63) | 235 - ((xfs_bmbt_rec_base_t)startoff << 9); 236 - r->l1 = ((xfs_bmbt_rec_base_t)startblock << 21) | 237 - ((xfs_bmbt_rec_base_t)blockcount & 238 - (xfs_bmbt_rec_base_t)xfs_mask64lo(21)); 239 - } 240 - #endif /* XFS_BIG_BLKNOS */ 241 253 } 242 254 243 255 /* ··· 252 298 ASSERT(state == XFS_EXT_NORM || state == XFS_EXT_UNWRITTEN); 253 299 ASSERT((startoff & xfs_mask64hi(64-BMBT_STARTOFF_BITLEN)) == 0); 254 300 ASSERT((blockcount & xfs_mask64hi(64-BMBT_BLOCKCOUNT_BITLEN)) == 0); 255 - 256 - #if XFS_BIG_BLKNOS 257 301 ASSERT((startblock & xfs_mask64hi(64-BMBT_STARTBLOCK_BITLEN)) == 0); 258 302 259 303 r->l0 = cpu_to_be64( ··· 262 310 ((xfs_bmbt_rec_base_t)startblock << 21) | 263 311 ((xfs_bmbt_rec_base_t)blockcount & 264 312 (xfs_bmbt_rec_base_t)xfs_mask64lo(21))); 265 - #else /* !XFS_BIG_BLKNOS */ 266 - if (isnullstartblock(startblock)) { 267 - r->l0 = cpu_to_be64( 268 - ((xfs_bmbt_rec_base_t)extent_flag << 63) | 269 - ((xfs_bmbt_rec_base_t)startoff << 9) | 270 - (xfs_bmbt_rec_base_t)xfs_mask64lo(9)); 271 - r->l1 = cpu_to_be64(xfs_mask64hi(11) | 272 - ((xfs_bmbt_rec_base_t)startblock << 21) | 273 - ((xfs_bmbt_rec_base_t)blockcount & 274 - (xfs_bmbt_rec_base_t)xfs_mask64lo(21))); 275 - } else { 276 - r->l0 = cpu_to_be64( 277 - ((xfs_bmbt_rec_base_t)extent_flag << 63) | 278 - ((xfs_bmbt_rec_base_t)startoff << 9)); 279 - r->l1 = cpu_to_be64( 280 - ((xfs_bmbt_rec_base_t)startblock << 21) | 281 - ((xfs_bmbt_rec_base_t)blockcount & 282 - (xfs_bmbt_rec_base_t)xfs_mask64lo(21))); 283 - } 284 - #endif /* XFS_BIG_BLKNOS */ 285 313 } 286 314 287 315 /* ··· 297 365 xfs_bmbt_rec_host_t *r, 298 366 xfs_fsblock_t v) 299 367 { 300 - #if XFS_BIG_BLKNOS 301 368 ASSERT((v & xfs_mask64hi(12)) == 0); 302 369 r->l0 = (r->l0 & (xfs_bmbt_rec_base_t)xfs_mask64hi(55)) | 303 370 (xfs_bmbt_rec_base_t)(v >> 43); 304 371 r->l1 = (r->l1 & (xfs_bmbt_rec_base_t)xfs_mask64lo(21)) | 305 372 (xfs_bmbt_rec_base_t)(v << 21); 306 - #else /* !XFS_BIG_BLKNOS */ 307 - if (isnullstartblock(v)) { 308 - r->l0 |= (xfs_bmbt_rec_base_t)xfs_mask64lo(9); 309 - r->l1 = (xfs_bmbt_rec_base_t)xfs_mask64hi(11) | 310 - ((xfs_bmbt_rec_base_t)v << 21) | 311 - (r->l1 & (xfs_bmbt_rec_base_t)xfs_mask64lo(21)); 312 - } else { 313 - r->l0 &= ~(xfs_bmbt_rec_base_t)xfs_mask64lo(9); 314 - r->l1 = ((xfs_bmbt_rec_base_t)v << 21) | 315 - (r->l1 & (xfs_bmbt_rec_base_t)xfs_mask64lo(21)); 316 - } 317 - #endif /* XFS_BIG_BLKNOS */ 318 373 } 319 374 320 375 /* ··· 357 438 cpu_to_be64(XFS_BUF_DADDR_NULL)); 358 439 } else 359 440 ASSERT(rblock->bb_magic == cpu_to_be32(XFS_BMAP_MAGIC)); 360 - ASSERT(rblock->bb_u.l.bb_leftsib == cpu_to_be64(NULLDFSBNO)); 361 - ASSERT(rblock->bb_u.l.bb_rightsib == cpu_to_be64(NULLDFSBNO)); 441 + ASSERT(rblock->bb_u.l.bb_leftsib == cpu_to_be64(NULLFSBLOCK)); 442 + ASSERT(rblock->bb_u.l.bb_rightsib == cpu_to_be64(NULLFSBLOCK)); 362 443 ASSERT(rblock->bb_level != 0); 363 444 dblock->bb_level = rblock->bb_level; 364 445 dblock->bb_numrecs = rblock->bb_numrecs; ··· 682 763 683 764 /* sibling pointer verification */ 684 765 if (!block->bb_u.l.bb_leftsib || 685 - (block->bb_u.l.bb_leftsib != cpu_to_be64(NULLDFSBNO) && 766 + (block->bb_u.l.bb_leftsib != cpu_to_be64(NULLFSBLOCK) && 686 767 !XFS_FSB_SANITY_CHECK(mp, be64_to_cpu(block->bb_u.l.bb_leftsib)))) 687 768 return false; 688 769 if (!block->bb_u.l.bb_rightsib || 689 - (block->bb_u.l.bb_rightsib != cpu_to_be64(NULLDFSBNO) && 770 + (block->bb_u.l.bb_rightsib != cpu_to_be64(NULLFSBLOCK) && 690 771 !XFS_FSB_SANITY_CHECK(mp, be64_to_cpu(block->bb_u.l.bb_rightsib)))) 691 772 return false; 692 773
+16 -16
fs/xfs/libxfs/xfs_btree.c
··· 77 77 be16_to_cpu(block->bb_numrecs) <= 78 78 cur->bc_ops->get_maxrecs(cur, level) && 79 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 81 XFS_FSB_SANITY_CHECK(mp, 82 82 be64_to_cpu(block->bb_u.l.bb_leftsib))) && 83 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 85 XFS_FSB_SANITY_CHECK(mp, 86 86 be64_to_cpu(block->bb_u.l.bb_rightsib))); 87 87 ··· 166 166 int /* error (0 or EFSCORRUPTED) */ 167 167 xfs_btree_check_lptr( 168 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 170 int level) /* btree block level */ 171 171 { 172 172 XFS_WANT_CORRUPTED_RETURN( 173 173 level > 0 && 174 - bno != NULLDFSBNO && 174 + bno != NULLFSBLOCK && 175 175 XFS_FSB_SANITY_CHECK(cur->bc_mp, bno)); 176 176 return 0; 177 177 } ··· 594 594 block = xfs_btree_get_block(cur, level, &bp); 595 595 xfs_btree_check_block(cur, block, level, bp); 596 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 598 else 599 599 return block->bb_u.s.bb_rightsib == cpu_to_be32(NULLAGBLOCK); 600 600 } ··· 770 770 struct xfs_btree_block *block) 771 771 { 772 772 int rval = 0; 773 - xfs_dfsbno_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); 773 + xfs_fsblock_t left = be64_to_cpu(block->bb_u.l.bb_leftsib); 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 777 xfs_btree_reada_bufl(cur->bc_mp, left, 1, 778 778 cur->bc_ops->buf_ops); 779 779 rval++; 780 780 } 781 781 782 - if ((lr & XFS_BTCUR_RIGHTRA) && right != NULLDFSBNO) { 782 + if ((lr & XFS_BTCUR_RIGHTRA) && right != NULLFSBLOCK) { 783 783 xfs_btree_reada_bufl(cur->bc_mp, right, 1, 784 784 cur->bc_ops->buf_ops); 785 785 rval++; ··· 851 851 union xfs_btree_ptr *ptr) 852 852 { 853 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 856 return XFS_FSB_TO_DADDR(cur->bc_mp, be64_to_cpu(ptr->l)); 857 857 } else { ··· 899 899 900 900 b = XFS_BUF_TO_BLOCK(bp); 901 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 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 905 cur->bc_ra[lev] |= XFS_BTCUR_RIGHTRA; 906 906 } else { 907 907 if (b->bb_u.s.bb_leftsib == cpu_to_be32(NULLAGBLOCK)) ··· 917 917 union xfs_btree_ptr *ptr) 918 918 { 919 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 921 else 922 922 return ptr->s == cpu_to_be32(NULLAGBLOCK); 923 923 } ··· 928 928 union xfs_btree_ptr *ptr) 929 929 { 930 930 if (cur->bc_flags & XFS_BTREE_LONG_PTRS) 931 - ptr->l = cpu_to_be64(NULLDFSBNO); 931 + ptr->l = cpu_to_be64(NULLFSBLOCK); 932 932 else 933 933 ptr->s = cpu_to_be32(NULLAGBLOCK); 934 934 } ··· 996 996 buf->bb_numrecs = cpu_to_be16(numrecs); 997 997 998 998 if (flags & XFS_BTREE_LONG_PTRS) { 999 - buf->bb_u.l.bb_leftsib = cpu_to_be64(NULLDFSBNO); 1000 - buf->bb_u.l.bb_rightsib = 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(NULLFSBLOCK); 1001 1001 if (flags & XFS_BTREE_CRC_BLOCKS) { 1002 1002 buf->bb_u.l.bb_blkno = cpu_to_be64(blkno); 1003 1003 buf->bb_u.l.bb_owner = cpu_to_be64(owner);
+1 -1
fs/xfs/libxfs/xfs_btree.h
··· 258 258 int /* error (0 or EFSCORRUPTED) */ 259 259 xfs_btree_check_lptr( 260 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 262 int level); /* btree block level */ 263 263 264 264 /*
+1 -1
fs/xfs/libxfs/xfs_da_btree.c
··· 2004 2004 struct xfs_trans *tp = args->trans; 2005 2005 struct xfs_inode *dp = args->dp; 2006 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 2008 struct xfs_bmbt_irec map, *mapp; 2009 2009 int nmap, error, got, i, mapi; 2010 2010
+8 -37
fs/xfs/libxfs/xfs_dir2_sf.c
··· 51 51 #else 52 52 #define xfs_dir2_sf_check(args) 53 53 #endif /* DEBUG */ 54 - #if XFS_BIG_INUMS 54 + 55 55 static void xfs_dir2_sf_toino4(xfs_da_args_t *args); 56 56 static void xfs_dir2_sf_toino8(xfs_da_args_t *args); 57 - #endif /* XFS_BIG_INUMS */ 58 57 59 58 /* 60 59 * Given a block directory (dp/block), calculate its size as a shortform (sf) ··· 116 117 isdotdot = 117 118 dep->namelen == 2 && 118 119 dep->name[0] == '.' && dep->name[1] == '.'; 119 - #if XFS_BIG_INUMS 120 + 120 121 if (!isdot) 121 122 i8count += be64_to_cpu(dep->inumber) > XFS_DIR2_MAX_SHORT_INUM; 122 - #endif 123 + 123 124 /* take into account the file type field */ 124 125 if (!isdot && !isdotdot) { 125 126 count++; ··· 317 318 */ 318 319 incr_isize = dp->d_ops->sf_entsize(sfp, args->namelen); 319 320 objchange = 0; 320 - #if XFS_BIG_INUMS 321 + 321 322 /* 322 323 * Do we have to change to 8 byte inodes? 323 324 */ ··· 331 332 (uint)sizeof(xfs_dir2_ino4_t)); 332 333 objchange = 1; 333 334 } 334 - #endif 335 + 335 336 new_isize = (int)dp->i_d.di_size + incr_isize; 336 337 /* 337 338 * Won't fit as shortform any more (due to size), ··· 369 370 */ 370 371 else { 371 372 ASSERT(pick == 2); 372 - #if XFS_BIG_INUMS 373 373 if (objchange) 374 374 xfs_dir2_sf_toino8(args); 375 - #endif 376 375 xfs_dir2_sf_addname_hard(args, objchange, new_isize); 377 376 } 378 377 xfs_trans_log_inode(args->trans, dp, XFS_ILOG_CORE | XFS_ILOG_DDATA); ··· 422 425 * Update the header and inode. 423 426 */ 424 427 sfp->count++; 425 - #if XFS_BIG_INUMS 426 428 if (args->inumber > XFS_DIR2_MAX_SHORT_INUM) 427 429 sfp->i8count++; 428 - #endif 429 430 dp->i_d.di_size = new_isize; 430 431 xfs_dir2_sf_check(args); 431 432 } ··· 511 516 dp->d_ops->sf_put_ino(sfp, sfep, args->inumber); 512 517 dp->d_ops->sf_put_ftype(sfep, args->filetype); 513 518 sfp->count++; 514 - #if XFS_BIG_INUMS 515 519 if (args->inumber > XFS_DIR2_MAX_SHORT_INUM && !objchange) 516 520 sfp->i8count++; 517 - #endif 518 521 /* 519 522 * If there's more left to copy, do that. 520 523 */ ··· 586 593 /* 587 594 * If changing the inode number size, do it the hard way. 588 595 */ 589 - #if XFS_BIG_INUMS 590 - if (objchange) { 596 + if (objchange) 591 597 return 2; 592 - } 593 - #else 594 - ASSERT(objchange == 0); 595 - #endif 596 598 /* 597 599 * If it won't fit at the end then do it the hard way (use the hole). 598 600 */ ··· 638 650 ASSERT(dp->d_ops->sf_get_ftype(sfep) < XFS_DIR3_FT_MAX); 639 651 } 640 652 ASSERT(i8count == sfp->i8count); 641 - ASSERT(XFS_BIG_INUMS || i8count == 0); 642 653 ASSERT((char *)sfep - (char *)sfp == dp->i_d.di_size); 643 654 ASSERT(offset + 644 655 (sfp->count + 2) * (uint)sizeof(xfs_dir2_leaf_entry_t) + ··· 857 870 */ 858 871 xfs_idata_realloc(dp, newsize - oldsize, XFS_DATA_FORK); 859 872 sfp = (xfs_dir2_sf_hdr_t *)dp->i_df.if_u1.if_data; 860 - #if XFS_BIG_INUMS 861 873 /* 862 874 * Are we changing inode number size? 863 875 */ ··· 866 880 else 867 881 sfp->i8count--; 868 882 } 869 - #endif 870 883 xfs_dir2_sf_check(args); 871 884 xfs_trans_log_inode(args->trans, dp, XFS_ILOG_CORE | XFS_ILOG_DDATA); 872 885 return 0; ··· 880 895 { 881 896 xfs_inode_t *dp; /* incore directory inode */ 882 897 int i; /* entry index */ 883 - #if XFS_BIG_INUMS || defined(DEBUG) 884 898 xfs_ino_t ino=0; /* entry old inode number */ 885 - #endif 886 - #if XFS_BIG_INUMS 887 899 int i8elevated; /* sf_toino8 set i8count=1 */ 888 - #endif 889 900 xfs_dir2_sf_entry_t *sfep; /* shortform directory entry */ 890 901 xfs_dir2_sf_hdr_t *sfp; /* shortform structure */ 891 902 ··· 901 920 ASSERT(dp->i_df.if_u1.if_data != NULL); 902 921 sfp = (xfs_dir2_sf_hdr_t *)dp->i_df.if_u1.if_data; 903 922 ASSERT(dp->i_d.di_size >= xfs_dir2_sf_hdr_size(sfp->i8count)); 904 - #if XFS_BIG_INUMS 923 + 905 924 /* 906 925 * New inode number is large, and need to convert to 8-byte inodes. 907 926 */ ··· 932 951 sfp = (xfs_dir2_sf_hdr_t *)dp->i_df.if_u1.if_data; 933 952 } else 934 953 i8elevated = 0; 935 - #endif 954 + 936 955 ASSERT(args->namelen != 1 || args->name[0] != '.'); 937 956 /* 938 957 * Replace ..'s entry. 939 958 */ 940 959 if (args->namelen == 2 && 941 960 args->name[0] == '.' && args->name[1] == '.') { 942 - #if XFS_BIG_INUMS || defined(DEBUG) 943 961 ino = dp->d_ops->sf_get_parent_ino(sfp); 944 962 ASSERT(args->inumber != ino); 945 - #endif 946 963 dp->d_ops->sf_put_parent_ino(sfp, args->inumber); 947 964 } 948 965 /* ··· 951 972 i++, sfep = dp->d_ops->sf_nextentry(sfp, sfep)) { 952 973 if (xfs_da_compname(args, sfep->name, sfep->namelen) == 953 974 XFS_CMP_EXACT) { 954 - #if XFS_BIG_INUMS || defined(DEBUG) 955 975 ino = dp->d_ops->sf_get_ino(sfp, sfep); 956 976 ASSERT(args->inumber != ino); 957 - #endif 958 977 dp->d_ops->sf_put_ino(sfp, sfep, args->inumber); 959 978 dp->d_ops->sf_put_ftype(sfep, args->filetype); 960 979 break; ··· 963 986 */ 964 987 if (i == sfp->count) { 965 988 ASSERT(args->op_flags & XFS_DA_OP_OKNOENT); 966 - #if XFS_BIG_INUMS 967 989 if (i8elevated) 968 990 xfs_dir2_sf_toino4(args); 969 - #endif 970 991 return -ENOENT; 971 992 } 972 993 } 973 - #if XFS_BIG_INUMS 974 994 /* 975 995 * See if the old number was large, the new number is small. 976 996 */ ··· 994 1020 if (!i8elevated) 995 1021 sfp->i8count++; 996 1022 } 997 - #endif 998 1023 xfs_dir2_sf_check(args); 999 1024 xfs_trans_log_inode(args->trans, dp, XFS_ILOG_DDATA); 1000 1025 return 0; 1001 1026 } 1002 1027 1003 - #if XFS_BIG_INUMS 1004 1028 /* 1005 1029 * Convert from 8-byte inode numbers to 4-byte inode numbers. 1006 1030 * The last 8-byte inode number is gone, but the count is still 1. ··· 1153 1181 dp->i_d.di_size = newsize; 1154 1182 xfs_trans_log_inode(args->trans, dp, XFS_ILOG_CORE | XFS_ILOG_DDATA); 1155 1183 } 1156 - #endif /* XFS_BIG_INUMS */
+1 -13
fs/xfs/libxfs/xfs_format.h
··· 68 68 #define XFS_RTLOBIT(w) xfs_lowbit32(w) 69 69 #define XFS_RTHIBIT(w) xfs_highbit32(w) 70 70 71 - #if XFS_BIG_BLKNOS 72 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 74 * Dquot and dquot block format definitions ··· 300 304 * Values and macros for delayed-allocation startblock fields. 301 305 */ 302 306 #define STARTBLOCKVALBITS 17 303 - #define STARTBLOCKMASKBITS (15 + XFS_BIG_BLKNOS * 20) 304 - #define DSTARTBLOCKMASKBITS (15 + 20) 307 + #define STARTBLOCKMASKBITS (15 + 20) 305 308 #define STARTBLOCKMASK \ 306 309 (((((xfs_fsblock_t)1) << STARTBLOCKMASKBITS) - 1) << STARTBLOCKVALBITS) 307 - #define DSTARTBLOCKMASK \ 308 - (((((xfs_dfsbno_t)1) << DSTARTBLOCKMASKBITS) - 1) << STARTBLOCKVALBITS) 309 310 310 311 static inline int isnullstartblock(xfs_fsblock_t x) 311 312 { 312 313 return ((x) & STARTBLOCKMASK) == STARTBLOCKMASK; 313 - } 314 - 315 - static inline int isnulldstartblock(xfs_dfsbno_t x) 316 - { 317 - return ((x) & DSTARTBLOCKMASK) == DSTARTBLOCKMASK; 318 314 } 319 315 320 316 static inline xfs_fsblock_t nullstartblock(int k)
+2 -2
fs/xfs/libxfs/xfs_inode_fork.c
··· 528 528 ifp->if_broot_bytes = (int)new_size; 529 529 ASSERT(XFS_BMAP_BMDR_SPACE(ifp->if_broot) <= 530 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 532 return; 533 533 } 534 534 ··· 575 575 ifp->if_broot_bytes); 576 576 np = (char *)XFS_BMAP_BROOT_PTR_ADDR(mp, new_broot, 1, 577 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 580 kmem_free(ifp->if_broot); 581 581 ifp->if_broot = new_broot;
-4
fs/xfs/libxfs/xfs_inum.h
··· 54 54 #define XFS_OFFBNO_TO_AGINO(mp,b,o) \ 55 55 ((xfs_agino_t)(((b) << XFS_INO_OFFSET_BITS(mp)) | (o))) 56 56 57 - #if XFS_BIG_INUMS 58 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 58 #define XFS_MAXINUMBER_32 ((xfs_ino_t)((1ULL << 32) - 1ULL)) 63 59 64 60 #endif /* __XFS_INUM_H__ */
+2 -2
fs/xfs/libxfs/xfs_log_format.h
··· 380 380 xfs_ictimestamp_t di_mtime; /* time last modified */ 381 381 xfs_ictimestamp_t di_ctime; /* time created/inode modified */ 382 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 384 xfs_extlen_t di_extsize; /* basic/minimum extent size for file */ 385 385 xfs_extnum_t di_nextents; /* number of extents in data fork */ 386 386 xfs_aextnum_t di_anextents; /* number of extents in attribute fork*/ ··· 516 516 * EFI/EFD log format definitions 517 517 */ 518 518 typedef struct xfs_extent { 519 - xfs_dfsbno_t ext_start; 519 + xfs_fsblock_t ext_start; 520 520 xfs_extlen_t ext_len; 521 521 } xfs_extent_t; 522 522
+4 -4
fs/xfs/libxfs/xfs_sb.h
··· 87 87 typedef struct xfs_sb { 88 88 __uint32_t sb_magicnum; /* magic number == XFS_SB_MAGIC */ 89 89 __uint32_t sb_blocksize; /* logical block size, bytes */ 90 - xfs_drfsbno_t sb_dblocks; /* number of data blocks */ 91 - xfs_drfsbno_t sb_rblocks; /* number of realtime blocks */ 92 - xfs_drtbno_t sb_rextents; /* number of realtime extents */ 90 + xfs_rfsblock_t sb_dblocks; /* number of data blocks */ 91 + xfs_rfsblock_t sb_rblocks; /* number of realtime blocks */ 92 + xfs_rtblock_t sb_rextents; /* number of realtime extents */ 93 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 95 xfs_ino_t sb_rootino; /* root inode number */ 96 96 xfs_ino_t sb_rbmino; /* bitmap inode for realtime extents */ 97 97 xfs_ino_t sb_rsumino; /* summary inode for rt bitmap */
+1 -1
fs/xfs/xfs_bmap_util.c
··· 478 478 ASSERT(level > 0); 479 479 pp = XFS_BMAP_BROOT_PTR_ADDR(mp, block, 1, ifp->if_broot_bytes); 480 480 bno = be64_to_cpu(*pp); 481 - ASSERT(bno != NULLDFSBNO); 481 + ASSERT(bno != NULLFSBLOCK); 482 482 ASSERT(XFS_FSB_TO_AGNO(mp, bno) < mp->m_sb.sb_agcount); 483 483 ASSERT(XFS_FSB_TO_AGBNO(mp, bno) < mp->m_sb.sb_agblocks); 484 484
+2 -2
fs/xfs/xfs_fs.h
··· 255 255 ((2 * 1024 * 1024 * 1024ULL) - XFS_MIN_LOG_BYTES) 256 256 257 257 /* Used for sanity checks on superblock */ 258 - #define XFS_MAX_DBLOCKS(s) ((xfs_drfsbno_t)(s)->sb_agcount * (s)->sb_agblocks) 259 - #define XFS_MIN_DBLOCKS(s) ((xfs_drfsbno_t)((s)->sb_agcount - 1) * \ 258 + #define XFS_MAX_DBLOCKS(s) ((xfs_rfsblock_t)(s)->sb_agcount * (s)->sb_agblocks) 259 + #define XFS_MIN_DBLOCKS(s) ((xfs_rfsblock_t)((s)->sb_agcount - 1) * \ 260 260 (s)->sb_agblocks + XFS_MIN_AG_BLOCKS) 261 261 262 262 /*
-12
fs/xfs/xfs_linux.h
··· 21 21 #include <linux/types.h> 22 22 23 23 /* 24 - * XFS_BIG_BLKNOS needs block layer disk addresses to be 64 bits. 25 - * XFS_BIG_INUMS requires XFS_BIG_BLKNOS to be set. 26 - */ 27 - #if defined(CONFIG_LBDAF) || (BITS_PER_LONG == 64) 28 - # define XFS_BIG_BLKNOS 1 29 - # define XFS_BIG_INUMS 1 30 - #else 31 - # define XFS_BIG_BLKNOS 0 32 - # define XFS_BIG_INUMS 0 33 - #endif 34 - 35 - /* 36 24 * Kernel specific type declarations for XFS 37 25 */ 38 26 typedef signed char __int8_t;
+1 -5
fs/xfs/xfs_mount.c
··· 173 173 ASSERT(PAGE_SHIFT >= sbp->sb_blocklog); 174 174 ASSERT(sbp->sb_blocklog >= BBSHIFT); 175 175 176 - #if XFS_BIG_BLKNOS /* Limited by ULONG_MAX of page cache index */ 176 + /* Limited by ULONG_MAX of page cache index */ 177 177 if (nblocks >> (PAGE_CACHE_SHIFT - sbp->sb_blocklog) > ULONG_MAX) 178 178 return -EFBIG; 179 - #else /* Limited by UINT_MAX of sectors */ 180 - if (nblocks << (sbp->sb_blocklog - BBSHIFT) > UINT_MAX) 181 - return -EFBIG; 182 - #endif 183 179 return 0; 184 180 } 185 181
+2 -2
fs/xfs/xfs_rtalloc.c
··· 944 944 xfs_buf_t *bp; /* temporary buffer */ 945 945 int error; /* error return value */ 946 946 xfs_mount_t *nmp; /* new (fake) mount structure */ 947 - xfs_drfsbno_t nrblocks; /* new number of realtime blocks */ 947 + xfs_rfsblock_t nrblocks; /* new number of realtime blocks */ 948 948 xfs_extlen_t nrbmblocks; /* new number of rt bitmap blocks */ 949 - xfs_drtbno_t nrextents; /* new number of realtime extents */ 949 + xfs_rtblock_t nrextents; /* new number of realtime extents */ 950 950 uint8_t nrextslog; /* new log2 of sb_rextents */ 951 951 xfs_extlen_t nrsumblocks; /* new number of summary blocks */ 952 952 uint nrsumlevels; /* new rt summary levels */
-8
fs/xfs/xfs_super.c
··· 204 204 */ 205 205 mp->m_flags |= XFS_MOUNT_BARRIER; 206 206 mp->m_flags |= XFS_MOUNT_COMPAT_IOSIZE; 207 - #if !XFS_BIG_INUMS 208 - mp->m_flags |= XFS_MOUNT_SMALL_INUMS; 209 - #endif 210 207 211 208 /* 212 209 * These can be overridden by the mount option parsing. ··· 310 313 mp->m_flags |= XFS_MOUNT_SMALL_INUMS; 311 314 } else if (!strcmp(this_char, MNTOPT_64BITINODE)) { 312 315 mp->m_flags &= ~XFS_MOUNT_SMALL_INUMS; 313 - #if !XFS_BIG_INUMS 314 - xfs_warn(mp, "%s option not allowed on this system", 315 - this_char); 316 - return -EINVAL; 317 - #endif 318 316 } else if (!strcmp(this_char, MNTOPT_NOUUID)) { 319 317 mp->m_flags |= XFS_MOUNT_NOUUID; 320 318 } else if (!strcmp(this_char, MNTOPT_BARRIER)) {
-11
fs/xfs/xfs_super.h
··· 44 44 # define XFS_REALTIME_STRING 45 45 #endif 46 46 47 - #if XFS_BIG_BLKNOS 48 - # if XFS_BIG_INUMS 49 - # define XFS_BIGFS_STRING "large block/inode numbers, " 50 - # else 51 - # define XFS_BIGFS_STRING "large block numbers, " 52 - # endif 53 - #else 54 - # define XFS_BIGFS_STRING 55 - #endif 56 - 57 47 #ifdef DEBUG 58 48 # define XFS_DBG_STRING "debug" 59 49 #else ··· 54 64 #define XFS_BUILD_OPTIONS XFS_ACL_STRING \ 55 65 XFS_SECURITY_STRING \ 56 66 XFS_REALTIME_STRING \ 57 - XFS_BIGFS_STRING \ 58 67 XFS_DBG_STRING /* DBG must be last */ 59 68 60 69 struct xfs_inode;
+2 -27
fs/xfs/xfs_types.h
··· 38 38 typedef __uint32_t xfs_dablk_t; /* dir/attr block number (in file) */ 39 39 typedef __uint32_t xfs_dahash_t; /* dir/attr hash value */ 40 40 41 - /* 42 - * These types are 64 bits on disk but are either 32 or 64 bits in memory. 43 - * Disk based types: 44 - */ 45 - typedef __uint64_t xfs_dfsbno_t; /* blockno in filesystem (agno|agbno) */ 46 - typedef __uint64_t xfs_drfsbno_t; /* blockno in filesystem (raw) */ 47 - typedef __uint64_t xfs_drtbno_t; /* extent (block) in realtime area */ 48 - typedef __uint64_t xfs_dfiloff_t; /* block number in a file */ 49 - typedef __uint64_t xfs_dfilblks_t; /* number of blocks in a file */ 50 - 51 - /* 52 - * Memory based types are conditional. 53 - */ 54 - #if XFS_BIG_BLKNOS 55 41 typedef __uint64_t xfs_fsblock_t; /* blockno in filesystem (agno|agbno) */ 56 42 typedef __uint64_t xfs_rfsblock_t; /* blockno in filesystem (raw) */ 57 43 typedef __uint64_t xfs_rtblock_t; /* extent (block) in realtime area */ 58 - typedef __int64_t xfs_srtblock_t; /* signed version of xfs_rtblock_t */ 59 - #else 60 - typedef __uint32_t xfs_fsblock_t; /* blockno in filesystem (agno|agbno) */ 61 - typedef __uint32_t xfs_rfsblock_t; /* blockno in filesystem (raw) */ 62 - typedef __uint32_t xfs_rtblock_t; /* extent (block) in realtime area */ 63 - typedef __int32_t xfs_srtblock_t; /* signed version of xfs_rtblock_t */ 64 - #endif 65 44 typedef __uint64_t xfs_fileoff_t; /* block number in a file */ 66 - typedef __int64_t xfs_sfiloff_t; /* signed block number in a file */ 67 45 typedef __uint64_t xfs_filblks_t; /* number of blocks in a file */ 68 46 47 + typedef __int64_t xfs_srtblock_t; /* signed version of xfs_rtblock_t */ 48 + typedef __int64_t xfs_sfiloff_t; /* signed block number in a file */ 69 49 70 50 /* 71 51 * Null values for the types. 72 52 */ 73 - #define NULLDFSBNO ((xfs_dfsbno_t)-1) 74 - #define NULLDRFSBNO ((xfs_drfsbno_t)-1) 75 - #define NULLDRTBNO ((xfs_drtbno_t)-1) 76 - #define NULLDFILOFF ((xfs_dfiloff_t)-1) 77 - 78 53 #define NULLFSBLOCK ((xfs_fsblock_t)-1) 79 54 #define NULLRFSBLOCK ((xfs_rfsblock_t)-1) 80 55 #define NULLRTBLOCK ((xfs_rtblock_t)-1)