aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_dir2_node.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_dir2_node.c')
-rw-r--r--fs/xfs/xfs_dir2_node.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/fs/xfs/xfs_dir2_node.c b/fs/xfs/xfs_dir2_node.c
index 3b70d56f4e58..89777bf63551 100644
--- a/fs/xfs/xfs_dir2_node.c
+++ b/fs/xfs/xfs_dir2_node.c
@@ -316,7 +316,7 @@ xfs_dir2_leaf_to_node(
316 if ((error = xfs_dir2_grow_inode(args, XFS_DIR2_FREE_SPACE, &fdb))) { 316 if ((error = xfs_dir2_grow_inode(args, XFS_DIR2_FREE_SPACE, &fdb))) {
317 return error; 317 return error;
318 } 318 }
319 ASSERT(fdb == xfs_dir2_byte_to_db(mp, XFS_DIR2_FREE_OFFSET)); 319 ASSERT(fdb == xfs_dir2_byte_to_db(args->geo, XFS_DIR2_FREE_OFFSET));
320 /* 320 /*
321 * Get the buffer for the new freespace block. 321 * Get the buffer for the new freespace block.
322 */ 322 */
@@ -451,7 +451,7 @@ xfs_dir2_leafn_add(
451 highstale, &lfloglow, &lfloghigh); 451 highstale, &lfloglow, &lfloghigh);
452 452
453 lep->hashval = cpu_to_be32(args->hashval); 453 lep->hashval = cpu_to_be32(args->hashval);
454 lep->address = cpu_to_be32(xfs_dir2_db_off_to_dataptr(mp, 454 lep->address = cpu_to_be32(xfs_dir2_db_off_to_dataptr(args->geo,
455 args->blkno, args->index)); 455 args->blkno, args->index));
456 456
457 dp->d_ops->leaf_hdr_to_disk(leaf, &leafhdr); 457 dp->d_ops->leaf_hdr_to_disk(leaf, &leafhdr);
@@ -577,7 +577,8 @@ xfs_dir2_leafn_lookup_for_addname(
577 /* 577 /*
578 * Pull the data block number from the entry. 578 * Pull the data block number from the entry.
579 */ 579 */
580 newdb = xfs_dir2_dataptr_to_db(mp, be32_to_cpu(lep->address)); 580 newdb = xfs_dir2_dataptr_to_db(args->geo,
581 be32_to_cpu(lep->address));
581 /* 582 /*
582 * For addname, we're looking for a place to put the new entry. 583 * For addname, we're looking for a place to put the new entry.
583 * We want to use a data block with an entry of equal 584 * We want to use a data block with an entry of equal
@@ -723,7 +724,8 @@ xfs_dir2_leafn_lookup_for_entry(
723 /* 724 /*
724 * Pull the data block number from the entry. 725 * Pull the data block number from the entry.
725 */ 726 */
726 newdb = xfs_dir2_dataptr_to_db(mp, be32_to_cpu(lep->address)); 727 newdb = xfs_dir2_dataptr_to_db(args->geo,
728 be32_to_cpu(lep->address));
727 /* 729 /*
728 * Not adding a new entry, so we really want to find 730 * Not adding a new entry, so we really want to find
729 * the name given to us. 731 * the name given to us.
@@ -761,7 +763,8 @@ xfs_dir2_leafn_lookup_for_entry(
761 * Point to the data entry. 763 * Point to the data entry.
762 */ 764 */
763 dep = (xfs_dir2_data_entry_t *)((char *)curbp->b_addr + 765 dep = (xfs_dir2_data_entry_t *)((char *)curbp->b_addr +
764 xfs_dir2_dataptr_to_off(mp, be32_to_cpu(lep->address))); 766 xfs_dir2_dataptr_to_off(args->geo,
767 be32_to_cpu(lep->address)));
765 /* 768 /*
766 * Compare the entry and if it's an exact match, return 769 * Compare the entry and if it's an exact match, return
767 * EEXIST immediately. If it's the first case-insensitive 770 * EEXIST immediately. If it's the first case-insensitive
@@ -1196,9 +1199,9 @@ xfs_dir2_leafn_remove(
1196 /* 1199 /*
1197 * Extract the data block and offset from the entry. 1200 * Extract the data block and offset from the entry.
1198 */ 1201 */
1199 db = xfs_dir2_dataptr_to_db(mp, be32_to_cpu(lep->address)); 1202 db = xfs_dir2_dataptr_to_db(args->geo, be32_to_cpu(lep->address));
1200 ASSERT(dblk->blkno == db); 1203 ASSERT(dblk->blkno == db);
1201 off = xfs_dir2_dataptr_to_off(mp, be32_to_cpu(lep->address)); 1204 off = xfs_dir2_dataptr_to_off(args->geo, be32_to_cpu(lep->address));
1202 ASSERT(dblk->index == off); 1205 ASSERT(dblk->index == off);
1203 1206
1204 /* 1207 /*
@@ -1260,7 +1263,8 @@ xfs_dir2_leafn_remove(
1260 struct xfs_dir3_icfree_hdr freehdr; 1263 struct xfs_dir3_icfree_hdr freehdr;
1261 dp->d_ops->free_hdr_from_disk(&freehdr, free); 1264 dp->d_ops->free_hdr_from_disk(&freehdr, free);
1262 ASSERT(freehdr.firstdb == dp->d_ops->free_max_bests(mp) * 1265 ASSERT(freehdr.firstdb == dp->d_ops->free_max_bests(mp) *
1263 (fdb - xfs_dir2_byte_to_db(mp, XFS_DIR2_FREE_OFFSET))); 1266 (fdb - xfs_dir2_byte_to_db(args->geo,
1267 XFS_DIR2_FREE_OFFSET)));
1264 } 1268 }
1265#endif 1269#endif
1266 /* 1270 /*
@@ -1751,7 +1755,7 @@ xfs_dir2_node_addname_int(
1751 * us a freespace block to start with. 1755 * us a freespace block to start with.
1752 */ 1756 */
1753 if (++fbno == 0) 1757 if (++fbno == 0)
1754 fbno = xfs_dir2_byte_to_db(mp, 1758 fbno = xfs_dir2_byte_to_db(args->geo,
1755 XFS_DIR2_FREE_OFFSET); 1759 XFS_DIR2_FREE_OFFSET);
1756 /* 1760 /*
1757 * If it's ifbno we already looked at it. 1761 * If it's ifbno we already looked at it.
@@ -1893,7 +1897,7 @@ xfs_dir2_node_addname_int(
1893 * Remember the first slot as our empty slot. 1897 * Remember the first slot as our empty slot.
1894 */ 1898 */
1895 freehdr.firstdb = 1899 freehdr.firstdb =
1896 (fbno - xfs_dir2_byte_to_db(mp, 1900 (fbno - xfs_dir2_byte_to_db(args->geo,
1897 XFS_DIR2_FREE_OFFSET)) * 1901 XFS_DIR2_FREE_OFFSET)) *
1898 dp->d_ops->free_max_bests(mp); 1902 dp->d_ops->free_max_bests(mp);
1899 } else { 1903 } else {
@@ -2194,7 +2198,8 @@ xfs_dir2_node_replace(
2194 hdr->magic == cpu_to_be32(XFS_DIR3_DATA_MAGIC)); 2198 hdr->magic == cpu_to_be32(XFS_DIR3_DATA_MAGIC));
2195 dep = (xfs_dir2_data_entry_t *) 2199 dep = (xfs_dir2_data_entry_t *)
2196 ((char *)hdr + 2200 ((char *)hdr +
2197 xfs_dir2_dataptr_to_off(state->mp, be32_to_cpu(lep->address))); 2201 xfs_dir2_dataptr_to_off(args->geo,
2202 be32_to_cpu(lep->address)));
2198 ASSERT(inum != be64_to_cpu(dep->inumber)); 2203 ASSERT(inum != be64_to_cpu(dep->inumber));
2199 /* 2204 /*
2200 * Fill in the new inode number and log the entry. 2205 * Fill in the new inode number and log the entry.