Loading fs/xfs/xfs_dir2.c +2 −2 Original line number Diff line number Diff line Loading @@ -632,7 +632,7 @@ xfs_dir2_grow_inode( if (error) return error; *dbp = xfs_dir2_da_to_db(mp, (xfs_dablk_t)bno); *dbp = xfs_dir2_da_to_db(args->geo, (xfs_dablk_t)bno); /* * Update file's size if this is the data space and it grew. Loading Loading @@ -713,7 +713,7 @@ xfs_dir2_shrink_inode( dp = args->dp; mp = dp->i_mount; tp = args->trans; da = xfs_dir2_db_to_da(mp, db); da = xfs_dir2_db_to_da(args->geo, db); /* * Unmap the fsblock(s). */ Loading fs/xfs/xfs_dir2_data.c +2 −2 Original line number Diff line number Diff line Loading @@ -584,8 +584,8 @@ xfs_dir3_data_init( /* * Get the buffer set up for the block. */ error = xfs_da_get_buf(tp, dp, xfs_dir2_db_to_da(mp, blkno), -1, &bp, XFS_DATA_FORK); error = xfs_da_get_buf(tp, dp, xfs_dir2_db_to_da(args->geo, blkno), -1, &bp, XFS_DATA_FORK); if (error) return error; bp->b_ops = &xfs_dir3_data_buf_ops; Loading fs/xfs/xfs_dir2_leaf.c +11 −10 Original line number Diff line number Diff line Loading @@ -350,8 +350,8 @@ xfs_dir3_leaf_get_buf( ASSERT(bno >= xfs_dir2_byte_to_db(mp, XFS_DIR2_LEAF_OFFSET) && bno < xfs_dir2_byte_to_db(mp, XFS_DIR2_FREE_OFFSET)); error = xfs_da_get_buf(tp, dp, xfs_dir2_db_to_da(mp, bno), -1, &bp, XFS_DATA_FORK); error = xfs_da_get_buf(tp, dp, xfs_dir2_db_to_da(args->geo, bno), -1, &bp, XFS_DATA_FORK); if (error) return error; Loading Loading @@ -403,7 +403,7 @@ xfs_dir2_block_to_leaf( if ((error = xfs_da_grow_inode(args, &blkno))) { return error; } ldb = xfs_dir2_da_to_db(mp, blkno); ldb = xfs_dir2_da_to_db(args->geo, blkno); ASSERT(ldb == xfs_dir2_byte_to_db(mp, XFS_DIR2_LEAF_OFFSET)); /* * Initialize the leaf block, get a buffer for it. Loading Loading @@ -828,7 +828,7 @@ xfs_dir2_leaf_addname( * Just read that one in. */ error = xfs_dir3_data_read(tp, dp, xfs_dir2_db_to_da(mp, use_block), xfs_dir2_db_to_da(args->geo, use_block), -1, &dbp); if (error) { xfs_trans_brelse(tp, lbp); Loading Loading @@ -1269,7 +1269,7 @@ xfs_dir2_leaf_lookup_int( if (dbp) xfs_trans_brelse(tp, dbp); error = xfs_dir3_data_read(tp, dp, xfs_dir2_db_to_da(mp, newdb), xfs_dir2_db_to_da(args->geo, newdb), -1, &dbp); if (error) { xfs_trans_brelse(tp, lbp); Loading Loading @@ -1310,7 +1310,7 @@ xfs_dir2_leaf_lookup_int( if (cidb != curdb) { xfs_trans_brelse(tp, dbp); error = xfs_dir3_data_read(tp, dp, xfs_dir2_db_to_da(mp, cidb), xfs_dir2_db_to_da(args->geo, cidb), -1, &dbp); if (error) { xfs_trans_brelse(tp, lbp); Loading Loading @@ -1609,7 +1609,8 @@ xfs_dir2_leaf_trim_data( /* * Read the offending data block. We need its buffer. */ error = xfs_dir3_data_read(tp, dp, xfs_dir2_db_to_da(mp, db), -1, &dbp); error = xfs_dir3_data_read(tp, dp, xfs_dir2_db_to_da(args->geo, db), -1, &dbp); if (error) return error; Loading fs/xfs/xfs_dir2_node.c +23 −18 Original line number Diff line number Diff line Loading @@ -195,17 +195,18 @@ xfs_dir2_free_try_read( static int xfs_dir3_free_get_buf( struct xfs_trans *tp, struct xfs_inode *dp, xfs_da_args_t *args, xfs_dir2_db_t fbno, struct xfs_buf **bpp) { struct xfs_trans *tp = args->trans; struct xfs_inode *dp = args->dp; struct xfs_mount *mp = dp->i_mount; struct xfs_buf *bp; int error; struct xfs_dir3_icfree_hdr hdr; error = xfs_da_get_buf(tp, dp, xfs_dir2_db_to_da(mp, fbno), error = xfs_da_get_buf(tp, dp, xfs_dir2_db_to_da(args->geo, fbno), -1, &bp, XFS_DATA_FORK); if (error) return error; Loading Loading @@ -319,7 +320,7 @@ xfs_dir2_leaf_to_node( /* * Get the buffer for the new freespace block. */ error = xfs_dir3_free_get_buf(tp, dp, fdb, &fbp); error = xfs_dir3_free_get_buf(args, fdb, &fbp); if (error) return error; Loading Loading @@ -605,7 +606,8 @@ xfs_dir2_leafn_lookup_for_addname( xfs_trans_brelse(tp, curbp); error = xfs_dir2_free_read(tp, dp, xfs_dir2_db_to_da(mp, newfdb), xfs_dir2_db_to_da(args->geo, newfdb), &curbp); if (error) return error; Loading Loading @@ -746,7 +748,8 @@ xfs_dir2_leafn_lookup_for_entry( curbp = state->extrablk.bp; } else { error = xfs_dir3_data_read(tp, dp, xfs_dir2_db_to_da(mp, newdb), xfs_dir2_db_to_da(args->geo, newdb), -1, &curbp); if (error) return error; Loading Loading @@ -1246,7 +1249,8 @@ xfs_dir2_leafn_remove( * read in the free block. */ fdb = dp->d_ops->db_to_fdb(mp, db); error = xfs_dir2_free_read(tp, dp, xfs_dir2_db_to_da(mp, fdb), error = xfs_dir2_free_read(tp, dp, xfs_dir2_db_to_da(args->geo, fdb), &fbp); if (error) return error; Loading Loading @@ -1336,7 +1340,7 @@ xfs_dir2_leafn_split( /* * Initialize the new leaf block. */ error = xfs_dir3_leaf_get_buf(args, xfs_dir2_da_to_db(mp, blkno), error = xfs_dir3_leaf_get_buf(args, xfs_dir2_da_to_db(args->geo, blkno), &newblk->bp, XFS_DIR2_LEAFN_MAGIC); if (error) return error; Loading Loading @@ -1729,7 +1733,7 @@ xfs_dir2_node_addname_int( if ((error = xfs_bmap_last_offset(dp, &fo, XFS_DATA_FORK))) return error; lastfbno = xfs_dir2_da_to_db(mp, (xfs_dablk_t)fo); lastfbno = xfs_dir2_da_to_db(args->geo, (xfs_dablk_t)fo); fbno = ifbno; } /* Loading Loading @@ -1766,7 +1770,7 @@ xfs_dir2_node_addname_int( * to avoid it. */ error = xfs_dir2_free_try_read(tp, dp, xfs_dir2_db_to_da(mp, fbno), xfs_dir2_db_to_da(args->geo, fbno), &fbp); if (error) return error; Loading Loading @@ -1837,7 +1841,7 @@ xfs_dir2_node_addname_int( */ fbno = dp->d_ops->db_to_fdb(mp, dbno); error = xfs_dir2_free_try_read(tp, dp, xfs_dir2_db_to_da(mp, fbno), xfs_dir2_db_to_da(args->geo, fbno), &fbp); if (error) return error; Loading Loading @@ -1878,7 +1882,7 @@ xfs_dir2_node_addname_int( /* * Get a buffer for the new block. */ error = xfs_dir3_free_get_buf(tp, dp, fbno, &fbp); error = xfs_dir3_free_get_buf(args, fbno, &fbp); if (error) return error; free = fbp->b_addr; Loading Loading @@ -1946,7 +1950,8 @@ xfs_dir2_node_addname_int( /* * Read the data block in. */ error = xfs_dir3_data_read(tp, dp, xfs_dir2_db_to_da(mp, dbno), error = xfs_dir3_data_read(tp, dp, xfs_dir2_db_to_da(args->geo, dbno), -1, &dbp); if (error) return error; Loading Loading @@ -2265,9 +2270,9 @@ xfs_dir2_node_trim_free( /* * Blow the block away. */ if ((error = xfs_dir2_shrink_inode(args, xfs_dir2_da_to_db(mp, (xfs_dablk_t)fo), bp))) { error = xfs_dir2_shrink_inode(args, xfs_dir2_da_to_db(args->geo, (xfs_dablk_t)fo), bp); if (error) { /* * Can't fail with ENOSPC since that only happens with no * space reservation, when breaking up an extent into two Loading fs/xfs/xfs_dir2_priv.h +7 −8 Original line number Diff line number Diff line Loading @@ -95,9 +95,9 @@ xfs_dir2_db_off_to_byte(struct xfs_da_geometry *geo, xfs_dir2_db_t db, * Convert block (DB) to block (dablk) */ static inline xfs_dablk_t xfs_dir2_db_to_da(struct xfs_mount *mp, xfs_dir2_db_t db) xfs_dir2_db_to_da(struct xfs_da_geometry *geo, xfs_dir2_db_t db) { return (xfs_dablk_t)(db << mp->m_sb.sb_dirblklog); return (xfs_dablk_t)(db << (geo->blklog - geo->fsblog)); } /* Loading @@ -106,7 +106,7 @@ xfs_dir2_db_to_da(struct xfs_mount *mp, xfs_dir2_db_t db) static inline xfs_dablk_t xfs_dir2_byte_to_da(struct xfs_mount *mp, xfs_dir2_off_t by) { return xfs_dir2_db_to_da(mp, xfs_dir2_byte_to_db(mp, by)); return xfs_dir2_db_to_da(mp->m_dir_geo, xfs_dir2_byte_to_db(mp, by)); } /* Loading @@ -124,19 +124,18 @@ xfs_dir2_db_off_to_dataptr(struct xfs_mount *mp, xfs_dir2_db_t db, * Convert block (dablk) to block (DB) */ static inline xfs_dir2_db_t xfs_dir2_da_to_db(struct xfs_mount *mp, xfs_dablk_t da) xfs_dir2_da_to_db(struct xfs_da_geometry *geo, xfs_dablk_t da) { return (xfs_dir2_db_t)(da >> mp->m_sb.sb_dirblklog); return (xfs_dir2_db_t)(da >> (geo->blklog - geo->fsblog)); } /* * Convert block (dablk) to byte offset in space */ static inline xfs_dir2_off_t xfs_dir2_da_to_byte(struct xfs_mount *mp, xfs_dablk_t da) xfs_dir2_da_to_byte(struct xfs_da_geometry *geo, xfs_dablk_t da) { return xfs_dir2_db_off_to_byte(mp->m_dir_geo, xfs_dir2_da_to_db(mp, da), 0); return xfs_dir2_db_off_to_byte(geo, xfs_dir2_da_to_db(geo, da), 0); } /* Loading Loading
fs/xfs/xfs_dir2.c +2 −2 Original line number Diff line number Diff line Loading @@ -632,7 +632,7 @@ xfs_dir2_grow_inode( if (error) return error; *dbp = xfs_dir2_da_to_db(mp, (xfs_dablk_t)bno); *dbp = xfs_dir2_da_to_db(args->geo, (xfs_dablk_t)bno); /* * Update file's size if this is the data space and it grew. Loading Loading @@ -713,7 +713,7 @@ xfs_dir2_shrink_inode( dp = args->dp; mp = dp->i_mount; tp = args->trans; da = xfs_dir2_db_to_da(mp, db); da = xfs_dir2_db_to_da(args->geo, db); /* * Unmap the fsblock(s). */ Loading
fs/xfs/xfs_dir2_data.c +2 −2 Original line number Diff line number Diff line Loading @@ -584,8 +584,8 @@ xfs_dir3_data_init( /* * Get the buffer set up for the block. */ error = xfs_da_get_buf(tp, dp, xfs_dir2_db_to_da(mp, blkno), -1, &bp, XFS_DATA_FORK); error = xfs_da_get_buf(tp, dp, xfs_dir2_db_to_da(args->geo, blkno), -1, &bp, XFS_DATA_FORK); if (error) return error; bp->b_ops = &xfs_dir3_data_buf_ops; Loading
fs/xfs/xfs_dir2_leaf.c +11 −10 Original line number Diff line number Diff line Loading @@ -350,8 +350,8 @@ xfs_dir3_leaf_get_buf( ASSERT(bno >= xfs_dir2_byte_to_db(mp, XFS_DIR2_LEAF_OFFSET) && bno < xfs_dir2_byte_to_db(mp, XFS_DIR2_FREE_OFFSET)); error = xfs_da_get_buf(tp, dp, xfs_dir2_db_to_da(mp, bno), -1, &bp, XFS_DATA_FORK); error = xfs_da_get_buf(tp, dp, xfs_dir2_db_to_da(args->geo, bno), -1, &bp, XFS_DATA_FORK); if (error) return error; Loading Loading @@ -403,7 +403,7 @@ xfs_dir2_block_to_leaf( if ((error = xfs_da_grow_inode(args, &blkno))) { return error; } ldb = xfs_dir2_da_to_db(mp, blkno); ldb = xfs_dir2_da_to_db(args->geo, blkno); ASSERT(ldb == xfs_dir2_byte_to_db(mp, XFS_DIR2_LEAF_OFFSET)); /* * Initialize the leaf block, get a buffer for it. Loading Loading @@ -828,7 +828,7 @@ xfs_dir2_leaf_addname( * Just read that one in. */ error = xfs_dir3_data_read(tp, dp, xfs_dir2_db_to_da(mp, use_block), xfs_dir2_db_to_da(args->geo, use_block), -1, &dbp); if (error) { xfs_trans_brelse(tp, lbp); Loading Loading @@ -1269,7 +1269,7 @@ xfs_dir2_leaf_lookup_int( if (dbp) xfs_trans_brelse(tp, dbp); error = xfs_dir3_data_read(tp, dp, xfs_dir2_db_to_da(mp, newdb), xfs_dir2_db_to_da(args->geo, newdb), -1, &dbp); if (error) { xfs_trans_brelse(tp, lbp); Loading Loading @@ -1310,7 +1310,7 @@ xfs_dir2_leaf_lookup_int( if (cidb != curdb) { xfs_trans_brelse(tp, dbp); error = xfs_dir3_data_read(tp, dp, xfs_dir2_db_to_da(mp, cidb), xfs_dir2_db_to_da(args->geo, cidb), -1, &dbp); if (error) { xfs_trans_brelse(tp, lbp); Loading Loading @@ -1609,7 +1609,8 @@ xfs_dir2_leaf_trim_data( /* * Read the offending data block. We need its buffer. */ error = xfs_dir3_data_read(tp, dp, xfs_dir2_db_to_da(mp, db), -1, &dbp); error = xfs_dir3_data_read(tp, dp, xfs_dir2_db_to_da(args->geo, db), -1, &dbp); if (error) return error; Loading
fs/xfs/xfs_dir2_node.c +23 −18 Original line number Diff line number Diff line Loading @@ -195,17 +195,18 @@ xfs_dir2_free_try_read( static int xfs_dir3_free_get_buf( struct xfs_trans *tp, struct xfs_inode *dp, xfs_da_args_t *args, xfs_dir2_db_t fbno, struct xfs_buf **bpp) { struct xfs_trans *tp = args->trans; struct xfs_inode *dp = args->dp; struct xfs_mount *mp = dp->i_mount; struct xfs_buf *bp; int error; struct xfs_dir3_icfree_hdr hdr; error = xfs_da_get_buf(tp, dp, xfs_dir2_db_to_da(mp, fbno), error = xfs_da_get_buf(tp, dp, xfs_dir2_db_to_da(args->geo, fbno), -1, &bp, XFS_DATA_FORK); if (error) return error; Loading Loading @@ -319,7 +320,7 @@ xfs_dir2_leaf_to_node( /* * Get the buffer for the new freespace block. */ error = xfs_dir3_free_get_buf(tp, dp, fdb, &fbp); error = xfs_dir3_free_get_buf(args, fdb, &fbp); if (error) return error; Loading Loading @@ -605,7 +606,8 @@ xfs_dir2_leafn_lookup_for_addname( xfs_trans_brelse(tp, curbp); error = xfs_dir2_free_read(tp, dp, xfs_dir2_db_to_da(mp, newfdb), xfs_dir2_db_to_da(args->geo, newfdb), &curbp); if (error) return error; Loading Loading @@ -746,7 +748,8 @@ xfs_dir2_leafn_lookup_for_entry( curbp = state->extrablk.bp; } else { error = xfs_dir3_data_read(tp, dp, xfs_dir2_db_to_da(mp, newdb), xfs_dir2_db_to_da(args->geo, newdb), -1, &curbp); if (error) return error; Loading Loading @@ -1246,7 +1249,8 @@ xfs_dir2_leafn_remove( * read in the free block. */ fdb = dp->d_ops->db_to_fdb(mp, db); error = xfs_dir2_free_read(tp, dp, xfs_dir2_db_to_da(mp, fdb), error = xfs_dir2_free_read(tp, dp, xfs_dir2_db_to_da(args->geo, fdb), &fbp); if (error) return error; Loading Loading @@ -1336,7 +1340,7 @@ xfs_dir2_leafn_split( /* * Initialize the new leaf block. */ error = xfs_dir3_leaf_get_buf(args, xfs_dir2_da_to_db(mp, blkno), error = xfs_dir3_leaf_get_buf(args, xfs_dir2_da_to_db(args->geo, blkno), &newblk->bp, XFS_DIR2_LEAFN_MAGIC); if (error) return error; Loading Loading @@ -1729,7 +1733,7 @@ xfs_dir2_node_addname_int( if ((error = xfs_bmap_last_offset(dp, &fo, XFS_DATA_FORK))) return error; lastfbno = xfs_dir2_da_to_db(mp, (xfs_dablk_t)fo); lastfbno = xfs_dir2_da_to_db(args->geo, (xfs_dablk_t)fo); fbno = ifbno; } /* Loading Loading @@ -1766,7 +1770,7 @@ xfs_dir2_node_addname_int( * to avoid it. */ error = xfs_dir2_free_try_read(tp, dp, xfs_dir2_db_to_da(mp, fbno), xfs_dir2_db_to_da(args->geo, fbno), &fbp); if (error) return error; Loading Loading @@ -1837,7 +1841,7 @@ xfs_dir2_node_addname_int( */ fbno = dp->d_ops->db_to_fdb(mp, dbno); error = xfs_dir2_free_try_read(tp, dp, xfs_dir2_db_to_da(mp, fbno), xfs_dir2_db_to_da(args->geo, fbno), &fbp); if (error) return error; Loading Loading @@ -1878,7 +1882,7 @@ xfs_dir2_node_addname_int( /* * Get a buffer for the new block. */ error = xfs_dir3_free_get_buf(tp, dp, fbno, &fbp); error = xfs_dir3_free_get_buf(args, fbno, &fbp); if (error) return error; free = fbp->b_addr; Loading Loading @@ -1946,7 +1950,8 @@ xfs_dir2_node_addname_int( /* * Read the data block in. */ error = xfs_dir3_data_read(tp, dp, xfs_dir2_db_to_da(mp, dbno), error = xfs_dir3_data_read(tp, dp, xfs_dir2_db_to_da(args->geo, dbno), -1, &dbp); if (error) return error; Loading Loading @@ -2265,9 +2270,9 @@ xfs_dir2_node_trim_free( /* * Blow the block away. */ if ((error = xfs_dir2_shrink_inode(args, xfs_dir2_da_to_db(mp, (xfs_dablk_t)fo), bp))) { error = xfs_dir2_shrink_inode(args, xfs_dir2_da_to_db(args->geo, (xfs_dablk_t)fo), bp); if (error) { /* * Can't fail with ENOSPC since that only happens with no * space reservation, when breaking up an extent into two Loading
fs/xfs/xfs_dir2_priv.h +7 −8 Original line number Diff line number Diff line Loading @@ -95,9 +95,9 @@ xfs_dir2_db_off_to_byte(struct xfs_da_geometry *geo, xfs_dir2_db_t db, * Convert block (DB) to block (dablk) */ static inline xfs_dablk_t xfs_dir2_db_to_da(struct xfs_mount *mp, xfs_dir2_db_t db) xfs_dir2_db_to_da(struct xfs_da_geometry *geo, xfs_dir2_db_t db) { return (xfs_dablk_t)(db << mp->m_sb.sb_dirblklog); return (xfs_dablk_t)(db << (geo->blklog - geo->fsblog)); } /* Loading @@ -106,7 +106,7 @@ xfs_dir2_db_to_da(struct xfs_mount *mp, xfs_dir2_db_t db) static inline xfs_dablk_t xfs_dir2_byte_to_da(struct xfs_mount *mp, xfs_dir2_off_t by) { return xfs_dir2_db_to_da(mp, xfs_dir2_byte_to_db(mp, by)); return xfs_dir2_db_to_da(mp->m_dir_geo, xfs_dir2_byte_to_db(mp, by)); } /* Loading @@ -124,19 +124,18 @@ xfs_dir2_db_off_to_dataptr(struct xfs_mount *mp, xfs_dir2_db_t db, * Convert block (dablk) to block (DB) */ static inline xfs_dir2_db_t xfs_dir2_da_to_db(struct xfs_mount *mp, xfs_dablk_t da) xfs_dir2_da_to_db(struct xfs_da_geometry *geo, xfs_dablk_t da) { return (xfs_dir2_db_t)(da >> mp->m_sb.sb_dirblklog); return (xfs_dir2_db_t)(da >> (geo->blklog - geo->fsblog)); } /* * Convert block (dablk) to byte offset in space */ static inline xfs_dir2_off_t xfs_dir2_da_to_byte(struct xfs_mount *mp, xfs_dablk_t da) xfs_dir2_da_to_byte(struct xfs_da_geometry *geo, xfs_dablk_t da) { return xfs_dir2_db_off_to_byte(mp->m_dir_geo, xfs_dir2_da_to_db(mp, da), 0); return xfs_dir2_db_off_to_byte(geo, xfs_dir2_da_to_db(geo, da), 0); } /* Loading