Skip to content

Commit 4d7eece

Browse files
committed
Merge branch 'xfs-misc-fixes-3.17-1' into for-next
2 parents e0ac6d4 + d5cf09b commit 4d7eece

25 files changed

Lines changed: 166 additions & 353 deletions

fs/xfs/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
config XFS_FS
22
tristate "XFS filesystem support"
33
depends on BLOCK
4+
depends on (64BIT || LBDAF)
45
select EXPORTFS
56
select LIBCRC32C
67
help

fs/xfs/libxfs/xfs_bmap.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ xfs_bmap_check_leaf_extents(
392392
pp = XFS_BMAP_BROOT_PTR_ADDR(mp, block, 1, ifp->if_broot_bytes);
393393
bno = be64_to_cpu(*pp);
394394

395-
ASSERT(bno != NULLDFSBNO);
395+
ASSERT(bno != NULLFSBLOCK);
396396
ASSERT(XFS_FSB_TO_AGNO(mp, bno) < mp->m_sb.sb_agcount);
397397
ASSERT(XFS_FSB_TO_AGBNO(mp, bno) < mp->m_sb.sb_agblocks);
398398

@@ -1299,7 +1299,7 @@ xfs_bmap_read_extents(
12991299
ASSERT(level > 0);
13001300
pp = XFS_BMAP_BROOT_PTR_ADDR(mp, block, 1, ifp->if_broot_bytes);
13011301
bno = be64_to_cpu(*pp);
1302-
ASSERT(bno != NULLDFSBNO);
1302+
ASSERT(bno != NULLFSBLOCK);
13031303
ASSERT(XFS_FSB_TO_AGNO(mp, bno) < mp->m_sb.sb_agcount);
13041304
ASSERT(XFS_FSB_TO_AGBNO(mp, bno) < mp->m_sb.sb_agblocks);
13051305
/*
@@ -1429,11 +1429,7 @@ xfs_bmap_search_multi_extents(
14291429
gotp->br_startoff = 0xffa5a5a5a5a5a5a5LL;
14301430
gotp->br_blockcount = 0xa55a5a5a5a5a5a5aLL;
14311431
gotp->br_state = XFS_EXT_INVALID;
1432-
#if XFS_BIG_BLKNOS
14331432
gotp->br_startblock = 0xffffa5a5a5a5a5a5LL;
1434-
#else
1435-
gotp->br_startblock = 0xffffa5a5;
1436-
#endif
14371433
prevp->br_startoff = NULLFILEOFF;
14381434

14391435
ep = xfs_iext_bno_to_ext(ifp, bno, &lastx);

fs/xfs/libxfs/xfs_bmap_btree.c

Lines changed: 4 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -111,23 +111,8 @@ __xfs_bmbt_get_all(
111111
ext_flag = (int)(l0 >> (64 - BMBT_EXNTFLAG_BITLEN));
112112
s->br_startoff = ((xfs_fileoff_t)l0 &
113113
xfs_mask64lo(64 - BMBT_EXNTFLAG_BITLEN)) >> 9;
114-
#if XFS_BIG_BLKNOS
115114
s->br_startblock = (((xfs_fsblock_t)l0 & xfs_mask64lo(9)) << 43) |
116115
(((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 */
131116
s->br_blockcount = (xfs_filblks_t)(l1 & xfs_mask64lo(21));
132117
/* This is xfs_extent_state() in-line */
133118
if (ext_flag) {
@@ -163,21 +148,8 @@ xfs_fsblock_t
163148
xfs_bmbt_get_startblock(
164149
xfs_bmbt_rec_host_t *r)
165150
{
166-
#if XFS_BIG_BLKNOS
167151
return (((xfs_fsblock_t)r->l0 & xfs_mask64lo(9)) << 43) |
168152
(((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 */
181153
}
182154

183155
/*
@@ -241,7 +213,6 @@ xfs_bmbt_set_allf(
241213
ASSERT((startoff & xfs_mask64hi(64-BMBT_STARTOFF_BITLEN)) == 0);
242214
ASSERT((blockcount & xfs_mask64hi(64-BMBT_BLOCKCOUNT_BITLEN)) == 0);
243215

244-
#if XFS_BIG_BLKNOS
245216
ASSERT((startblock & xfs_mask64hi(64-BMBT_STARTBLOCK_BITLEN)) == 0);
246217

247218
r->l0 = ((xfs_bmbt_rec_base_t)extent_flag << 63) |
@@ -250,23 +221,6 @@ xfs_bmbt_set_allf(
250221
r->l1 = ((xfs_bmbt_rec_base_t)startblock << 21) |
251222
((xfs_bmbt_rec_base_t)blockcount &
252223
(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 */
270224
}
271225

272226
/*
@@ -298,8 +252,6 @@ xfs_bmbt_disk_set_allf(
298252
ASSERT(state == XFS_EXT_NORM || state == XFS_EXT_UNWRITTEN);
299253
ASSERT((startoff & xfs_mask64hi(64-BMBT_STARTOFF_BITLEN)) == 0);
300254
ASSERT((blockcount & xfs_mask64hi(64-BMBT_BLOCKCOUNT_BITLEN)) == 0);
301-
302-
#if XFS_BIG_BLKNOS
303255
ASSERT((startblock & xfs_mask64hi(64-BMBT_STARTBLOCK_BITLEN)) == 0);
304256

305257
r->l0 = cpu_to_be64(
@@ -310,26 +262,6 @@ xfs_bmbt_disk_set_allf(
310262
((xfs_bmbt_rec_base_t)startblock << 21) |
311263
((xfs_bmbt_rec_base_t)blockcount &
312264
(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 */
333265
}
334266

335267
/*
@@ -365,24 +297,11 @@ xfs_bmbt_set_startblock(
365297
xfs_bmbt_rec_host_t *r,
366298
xfs_fsblock_t v)
367299
{
368-
#if XFS_BIG_BLKNOS
369300
ASSERT((v & xfs_mask64hi(12)) == 0);
370301
r->l0 = (r->l0 & (xfs_bmbt_rec_base_t)xfs_mask64hi(55)) |
371302
(xfs_bmbt_rec_base_t)(v >> 43);
372303
r->l1 = (r->l1 & (xfs_bmbt_rec_base_t)xfs_mask64lo(21)) |
373304
(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 */
386305
}
387306

388307
/*
@@ -438,8 +357,8 @@ xfs_bmbt_to_bmdr(
438357
cpu_to_be64(XFS_BUF_DADDR_NULL));
439358
} else
440359
ASSERT(rblock->bb_magic == cpu_to_be32(XFS_BMAP_MAGIC));
441-
ASSERT(rblock->bb_u.l.bb_leftsib == cpu_to_be64(NULLDFSBNO));
442-
ASSERT(rblock->bb_u.l.bb_rightsib == cpu_to_be64(NULLDFSBNO));
360+
ASSERT(rblock->bb_u.l.bb_leftsib == cpu_to_be64(NULLFSBLOCK));
361+
ASSERT(rblock->bb_u.l.bb_rightsib == cpu_to_be64(NULLFSBLOCK));
443362
ASSERT(rblock->bb_level != 0);
444363
dblock->bb_level = rblock->bb_level;
445364
dblock->bb_numrecs = rblock->bb_numrecs;
@@ -763,11 +682,11 @@ xfs_bmbt_verify(
763682

764683
/* sibling pointer verification */
765684
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) &&
767686
!XFS_FSB_SANITY_CHECK(mp, be64_to_cpu(block->bb_u.l.bb_leftsib))))
768687
return false;
769688
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) &&
771690
!XFS_FSB_SANITY_CHECK(mp, be64_to_cpu(block->bb_u.l.bb_rightsib))))
772691
return false;
773692

fs/xfs/libxfs/xfs_btree.c

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,11 @@ xfs_btree_check_lblock(
7878
be16_to_cpu(block->bb_numrecs) <=
7979
cur->bc_ops->get_maxrecs(cur, level) &&
8080
block->bb_u.l.bb_leftsib &&
81-
(block->bb_u.l.bb_leftsib == cpu_to_be64(NULLDFSBNO) ||
81+
(block->bb_u.l.bb_leftsib == cpu_to_be64(NULLFSBLOCK) ||
8282
XFS_FSB_SANITY_CHECK(mp,
8383
be64_to_cpu(block->bb_u.l.bb_leftsib))) &&
8484
block->bb_u.l.bb_rightsib &&
85-
(block->bb_u.l.bb_rightsib == cpu_to_be64(NULLDFSBNO) ||
85+
(block->bb_u.l.bb_rightsib == cpu_to_be64(NULLFSBLOCK) ||
8686
XFS_FSB_SANITY_CHECK(mp,
8787
be64_to_cpu(block->bb_u.l.bb_rightsib)));
8888

@@ -167,12 +167,12 @@ xfs_btree_check_block(
167167
int /* error (0 or EFSCORRUPTED) */
168168
xfs_btree_check_lptr(
169169
struct xfs_btree_cur *cur, /* btree cursor */
170-
xfs_dfsbno_t bno, /* btree block disk address */
170+
xfs_fsblock_t bno, /* btree block disk address */
171171
int level) /* btree block level */
172172
{
173173
XFS_WANT_CORRUPTED_RETURN(
174174
level > 0 &&
175-
bno != NULLDFSBNO &&
175+
bno != NULLFSBLOCK &&
176176
XFS_FSB_SANITY_CHECK(cur->bc_mp, bno));
177177
return 0;
178178
}
@@ -595,7 +595,7 @@ xfs_btree_islastblock(
595595
block = xfs_btree_get_block(cur, level, &bp);
596596
xfs_btree_check_block(cur, block, level, bp);
597597
if (cur->bc_flags & XFS_BTREE_LONG_PTRS)
598-
return block->bb_u.l.bb_rightsib == cpu_to_be64(NULLDFSBNO);
598+
return block->bb_u.l.bb_rightsib == cpu_to_be64(NULLFSBLOCK);
599599
else
600600
return block->bb_u.s.bb_rightsib == cpu_to_be32(NULLAGBLOCK);
601601
}
@@ -771,16 +771,16 @@ xfs_btree_readahead_lblock(
771771
struct xfs_btree_block *block)
772772
{
773773
int rval = 0;
774-
xfs_dfsbno_t left = be64_to_cpu(block->bb_u.l.bb_leftsib);
775-
xfs_dfsbno_t right = be64_to_cpu(block->bb_u.l.bb_rightsib);
774+
xfs_fsblock_t left = be64_to_cpu(block->bb_u.l.bb_leftsib);
775+
xfs_fsblock_t right = be64_to_cpu(block->bb_u.l.bb_rightsib);
776776

777-
if ((lr & XFS_BTCUR_LEFTRA) && left != NULLDFSBNO) {
777+
if ((lr & XFS_BTCUR_LEFTRA) && left != NULLFSBLOCK) {
778778
xfs_btree_reada_bufl(cur->bc_mp, left, 1,
779779
cur->bc_ops->buf_ops);
780780
rval++;
781781
}
782782

783-
if ((lr & XFS_BTCUR_RIGHTRA) && right != NULLDFSBNO) {
783+
if ((lr & XFS_BTCUR_RIGHTRA) && right != NULLFSBLOCK) {
784784
xfs_btree_reada_bufl(cur->bc_mp, right, 1,
785785
cur->bc_ops->buf_ops);
786786
rval++;
@@ -852,7 +852,7 @@ xfs_btree_ptr_to_daddr(
852852
union xfs_btree_ptr *ptr)
853853
{
854854
if (cur->bc_flags & XFS_BTREE_LONG_PTRS) {
855-
ASSERT(ptr->l != cpu_to_be64(NULLDFSBNO));
855+
ASSERT(ptr->l != cpu_to_be64(NULLFSBLOCK));
856856

857857
return XFS_FSB_TO_DADDR(cur->bc_mp, be64_to_cpu(ptr->l));
858858
} else {
@@ -900,9 +900,9 @@ xfs_btree_setbuf(
900900

901901
b = XFS_BUF_TO_BLOCK(bp);
902902
if (cur->bc_flags & XFS_BTREE_LONG_PTRS) {
903-
if (b->bb_u.l.bb_leftsib == cpu_to_be64(NULLDFSBNO))
903+
if (b->bb_u.l.bb_leftsib == cpu_to_be64(NULLFSBLOCK))
904904
cur->bc_ra[lev] |= XFS_BTCUR_LEFTRA;
905-
if (b->bb_u.l.bb_rightsib == cpu_to_be64(NULLDFSBNO))
905+
if (b->bb_u.l.bb_rightsib == cpu_to_be64(NULLFSBLOCK))
906906
cur->bc_ra[lev] |= XFS_BTCUR_RIGHTRA;
907907
} else {
908908
if (b->bb_u.s.bb_leftsib == cpu_to_be32(NULLAGBLOCK))
@@ -918,7 +918,7 @@ xfs_btree_ptr_is_null(
918918
union xfs_btree_ptr *ptr)
919919
{
920920
if (cur->bc_flags & XFS_BTREE_LONG_PTRS)
921-
return ptr->l == cpu_to_be64(NULLDFSBNO);
921+
return ptr->l == cpu_to_be64(NULLFSBLOCK);
922922
else
923923
return ptr->s == cpu_to_be32(NULLAGBLOCK);
924924
}
@@ -929,7 +929,7 @@ xfs_btree_set_ptr_null(
929929
union xfs_btree_ptr *ptr)
930930
{
931931
if (cur->bc_flags & XFS_BTREE_LONG_PTRS)
932-
ptr->l = cpu_to_be64(NULLDFSBNO);
932+
ptr->l = cpu_to_be64(NULLFSBLOCK);
933933
else
934934
ptr->s = cpu_to_be32(NULLAGBLOCK);
935935
}
@@ -997,8 +997,8 @@ xfs_btree_init_block_int(
997997
buf->bb_numrecs = cpu_to_be16(numrecs);
998998

999999
if (flags & XFS_BTREE_LONG_PTRS) {
1000-
buf->bb_u.l.bb_leftsib = cpu_to_be64(NULLDFSBNO);
1001-
buf->bb_u.l.bb_rightsib = cpu_to_be64(NULLDFSBNO);
1000+
buf->bb_u.l.bb_leftsib = cpu_to_be64(NULLFSBLOCK);
1001+
buf->bb_u.l.bb_rightsib = cpu_to_be64(NULLFSBLOCK);
10021002
if (flags & XFS_BTREE_CRC_BLOCKS) {
10031003
buf->bb_u.l.bb_blkno = cpu_to_be64(blkno);
10041004
buf->bb_u.l.bb_owner = cpu_to_be64(owner);

fs/xfs/libxfs/xfs_btree.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ xfs_btree_check_block(
258258
int /* error (0 or EFSCORRUPTED) */
259259
xfs_btree_check_lptr(
260260
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 */
262262
int level); /* btree block level */
263263

264264
/*

fs/xfs/libxfs/xfs_da_btree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2004,7 +2004,7 @@ xfs_da_grow_inode_int(
20042004
struct xfs_trans *tp = args->trans;
20052005
struct xfs_inode *dp = args->dp;
20062006
int w = args->whichfork;
2007-
xfs_drfsbno_t nblks = dp->i_d.di_nblocks;
2007+
xfs_rfsblock_t nblks = dp->i_d.di_nblocks;
20082008
struct xfs_bmbt_irec map, *mapp;
20092009
int nmap, error, got, i, mapi;
20102010

0 commit comments

Comments
 (0)