@@ -859,95 +859,26 @@ xfs_btree_offsets(
859859 }
860860}
861861
862- /*
863- * Get a buffer for the block, return it read in.
864- * Long-form addressing.
865- */
866- int
867- xfs_btree_read_bufl (
868- struct xfs_mount * mp , /* file system mount point */
869- struct xfs_trans * tp , /* transaction pointer */
870- xfs_fsblock_t fsbno , /* file system block number */
871- struct xfs_buf * * bpp , /* buffer for fsbno */
872- int refval , /* ref count value for buffer */
873- const struct xfs_buf_ops * ops )
874- {
875- struct xfs_buf * bp ; /* return value */
876- xfs_daddr_t d ; /* real disk block address */
877- int error ;
878-
879- if (!xfs_verify_fsbno (mp , fsbno ))
880- return - EFSCORRUPTED ;
881- d = XFS_FSB_TO_DADDR (mp , fsbno );
882- error = xfs_trans_read_buf (mp , tp , mp -> m_ddev_targp , d ,
883- mp -> m_bsize , 0 , & bp , ops );
884- if (error )
885- return error ;
886- if (bp )
887- xfs_buf_set_ref (bp , refval );
888- * bpp = bp ;
889- return 0 ;
890- }
891-
892- /*
893- * Read-ahead the block, don't wait for it, don't return a buffer.
894- * Long-form addressing.
895- */
896- /* ARGSUSED */
897- void
898- xfs_btree_reada_bufl (
899- struct xfs_mount * mp , /* file system mount point */
900- xfs_fsblock_t fsbno , /* file system block number */
901- xfs_extlen_t count , /* count of filesystem blocks */
902- const struct xfs_buf_ops * ops )
903- {
904- xfs_daddr_t d ;
905-
906- ASSERT (fsbno != NULLFSBLOCK );
907- d = XFS_FSB_TO_DADDR (mp , fsbno );
908- xfs_buf_readahead (mp -> m_ddev_targp , d , mp -> m_bsize * count , ops );
909- }
910-
911- /*
912- * Read-ahead the block, don't wait for it, don't return a buffer.
913- * Short-form addressing.
914- */
915- /* ARGSUSED */
916- void
917- xfs_btree_reada_bufs (
918- struct xfs_mount * mp , /* file system mount point */
919- xfs_agnumber_t agno , /* allocation group number */
920- xfs_agblock_t agbno , /* allocation group block number */
921- xfs_extlen_t count , /* count of filesystem blocks */
922- const struct xfs_buf_ops * ops )
923- {
924- xfs_daddr_t d ;
925-
926- ASSERT (agno != NULLAGNUMBER );
927- ASSERT (agbno != NULLAGBLOCK );
928- d = XFS_AGB_TO_DADDR (mp , agno , agbno );
929- xfs_buf_readahead (mp -> m_ddev_targp , d , mp -> m_bsize * count , ops );
930- }
931-
932862STATIC int
933863xfs_btree_readahead_fsblock (
934864 struct xfs_btree_cur * cur ,
935865 int lr ,
936866 struct xfs_btree_block * block )
937867{
938- int rval = 0 ;
868+ struct xfs_mount * mp = cur -> bc_mp ;
939869 xfs_fsblock_t left = be64_to_cpu (block -> bb_u .l .bb_leftsib );
940870 xfs_fsblock_t right = be64_to_cpu (block -> bb_u .l .bb_rightsib );
871+ int rval = 0 ;
941872
942873 if ((lr & XFS_BTCUR_LEFTRA ) && left != NULLFSBLOCK ) {
943- xfs_btree_reada_bufl ( cur -> bc_mp , left , 1 ,
944- cur -> bc_ops -> buf_ops );
874+ xfs_buf_readahead ( mp -> m_ddev_targp , XFS_FSB_TO_DADDR ( mp , left ) ,
875+ mp -> m_bsize , cur -> bc_ops -> buf_ops );
945876 rval ++ ;
946877 }
947878
948879 if ((lr & XFS_BTCUR_RIGHTRA ) && right != NULLFSBLOCK ) {
949- xfs_btree_reada_bufl ( cur -> bc_mp , right , 1 ,
950- cur -> bc_ops -> buf_ops );
880+ xfs_buf_readahead ( mp -> m_ddev_targp , XFS_FSB_TO_DADDR ( mp , right ) ,
881+ mp -> m_bsize , cur -> bc_ops -> buf_ops );
951882 rval ++ ;
952883 }
953884
@@ -958,22 +889,25 @@ STATIC int
958889xfs_btree_readahead_agblock (
959890 struct xfs_btree_cur * cur ,
960891 int lr ,
961- struct xfs_btree_block * block )
892+ struct xfs_btree_block * block )
962893{
963- int rval = 0 ;
894+ struct xfs_mount * mp = cur -> bc_mp ;
895+ xfs_agnumber_t agno = cur -> bc_ag .pag -> pag_agno ;
964896 xfs_agblock_t left = be32_to_cpu (block -> bb_u .s .bb_leftsib );
965897 xfs_agblock_t right = be32_to_cpu (block -> bb_u .s .bb_rightsib );
966-
898+ int rval = 0 ;
967899
968900 if ((lr & XFS_BTCUR_LEFTRA ) && left != NULLAGBLOCK ) {
969- xfs_btree_reada_bufs (cur -> bc_mp , cur -> bc_ag .pag -> pag_agno ,
970- left , 1 , cur -> bc_ops -> buf_ops );
901+ xfs_buf_readahead (mp -> m_ddev_targp ,
902+ XFS_AGB_TO_DADDR (mp , agno , left ),
903+ mp -> m_bsize , cur -> bc_ops -> buf_ops );
971904 rval ++ ;
972905 }
973906
974907 if ((lr & XFS_BTCUR_RIGHTRA ) && right != NULLAGBLOCK ) {
975- xfs_btree_reada_bufs (cur -> bc_mp , cur -> bc_ag .pag -> pag_agno ,
976- right , 1 , cur -> bc_ops -> buf_ops );
908+ xfs_buf_readahead (mp -> m_ddev_targp ,
909+ XFS_AGB_TO_DADDR (mp , agno , right ),
910+ mp -> m_bsize , cur -> bc_ops -> buf_ops );
977911 rval ++ ;
978912 }
979913
0 commit comments