xfs: remove the mappedbno argument to xfs_da_reada_buf
Replace the mappedbno argument with the simple flags for xfs_da_reada_buf and xfs_dir3_data_readahead. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
This commit is contained in:
committed by
Darrick J. Wong
parent
199e9ba4e4
commit
06566fda42
@@ -2651,7 +2651,7 @@ int
|
|||||||
xfs_da_reada_buf(
|
xfs_da_reada_buf(
|
||||||
struct xfs_inode *dp,
|
struct xfs_inode *dp,
|
||||||
xfs_dablk_t bno,
|
xfs_dablk_t bno,
|
||||||
xfs_daddr_t mappedbno,
|
unsigned int flags,
|
||||||
int whichfork,
|
int whichfork,
|
||||||
const struct xfs_buf_ops *ops)
|
const struct xfs_buf_ops *ops)
|
||||||
{
|
{
|
||||||
@@ -2660,18 +2660,12 @@ xfs_da_reada_buf(
|
|||||||
int nmap;
|
int nmap;
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
if (mappedbno >= 0)
|
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
mapp = ↦
|
mapp = ↦
|
||||||
nmap = 1;
|
nmap = 1;
|
||||||
error = xfs_dabuf_map(dp, bno,
|
error = xfs_dabuf_map(dp, bno, flags, whichfork, &mapp, &nmap);
|
||||||
mappedbno == -1 ? XFS_DABUF_MAP_HOLE_OK : 0,
|
|
||||||
whichfork, &mapp, &nmap);
|
|
||||||
if (error || !nmap)
|
if (error || !nmap)
|
||||||
goto out_free;
|
goto out_free;
|
||||||
|
|
||||||
mappedbno = mapp[0].bm_bn;
|
|
||||||
xfs_buf_readahead_map(dp->i_mount->m_ddev_targp, mapp, nmap, ops);
|
xfs_buf_readahead_map(dp->i_mount->m_ddev_targp, mapp, nmap, ops);
|
||||||
|
|
||||||
out_free:
|
out_free:
|
||||||
|
|||||||
@@ -208,7 +208,7 @@ int xfs_da_read_buf(struct xfs_trans *trans, struct xfs_inode *dp,
|
|||||||
struct xfs_buf **bpp, int whichfork,
|
struct xfs_buf **bpp, int whichfork,
|
||||||
const struct xfs_buf_ops *ops);
|
const struct xfs_buf_ops *ops);
|
||||||
int xfs_da_reada_buf(struct xfs_inode *dp, xfs_dablk_t bno,
|
int xfs_da_reada_buf(struct xfs_inode *dp, xfs_dablk_t bno,
|
||||||
xfs_daddr_t mapped_bno, int whichfork,
|
unsigned int flags, int whichfork,
|
||||||
const struct xfs_buf_ops *ops);
|
const struct xfs_buf_ops *ops);
|
||||||
int xfs_da_shrink_inode(xfs_da_args_t *args, xfs_dablk_t dead_blkno,
|
int xfs_da_shrink_inode(xfs_da_args_t *args, xfs_dablk_t dead_blkno,
|
||||||
struct xfs_buf *dead_buf);
|
struct xfs_buf *dead_buf);
|
||||||
|
|||||||
@@ -416,10 +416,10 @@ int
|
|||||||
xfs_dir3_data_readahead(
|
xfs_dir3_data_readahead(
|
||||||
struct xfs_inode *dp,
|
struct xfs_inode *dp,
|
||||||
xfs_dablk_t bno,
|
xfs_dablk_t bno,
|
||||||
xfs_daddr_t mapped_bno)
|
unsigned int flags)
|
||||||
{
|
{
|
||||||
return xfs_da_reada_buf(dp, bno, mapped_bno,
|
return xfs_da_reada_buf(dp, bno, flags, XFS_DATA_FORK,
|
||||||
XFS_DATA_FORK, &xfs_dir3_data_reada_buf_ops);
|
&xfs_dir3_data_reada_buf_ops);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -79,8 +79,8 @@ extern xfs_failaddr_t __xfs_dir3_data_check(struct xfs_inode *dp,
|
|||||||
struct xfs_buf *bp);
|
struct xfs_buf *bp);
|
||||||
extern int xfs_dir3_data_read(struct xfs_trans *tp, struct xfs_inode *dp,
|
extern int xfs_dir3_data_read(struct xfs_trans *tp, struct xfs_inode *dp,
|
||||||
xfs_dablk_t bno, xfs_daddr_t mapped_bno, struct xfs_buf **bpp);
|
xfs_dablk_t bno, xfs_daddr_t mapped_bno, struct xfs_buf **bpp);
|
||||||
extern int xfs_dir3_data_readahead(struct xfs_inode *dp, xfs_dablk_t bno,
|
int xfs_dir3_data_readahead(struct xfs_inode *dp, xfs_dablk_t bno,
|
||||||
xfs_daddr_t mapped_bno);
|
unsigned int flags);
|
||||||
|
|
||||||
extern struct xfs_dir2_data_free *
|
extern struct xfs_dir2_data_free *
|
||||||
xfs_dir2_data_freeinsert(struct xfs_dir2_data_hdr *hdr,
|
xfs_dir2_data_freeinsert(struct xfs_dir2_data_hdr *hdr,
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ xchk_parent_count_parent_dentries(
|
|||||||
*/
|
*/
|
||||||
lock_mode = xfs_ilock_data_map_shared(parent);
|
lock_mode = xfs_ilock_data_map_shared(parent);
|
||||||
if (parent->i_d.di_nextents > 0)
|
if (parent->i_d.di_nextents > 0)
|
||||||
error = xfs_dir3_data_readahead(parent, 0, -1);
|
error = xfs_dir3_data_readahead(parent, 0, 0);
|
||||||
xfs_iunlock(parent, lock_mode);
|
xfs_iunlock(parent, lock_mode);
|
||||||
if (error)
|
if (error)
|
||||||
return error;
|
return error;
|
||||||
|
|||||||
@@ -314,7 +314,8 @@ xfs_dir2_leaf_readbuf(
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (next_ra > *ra_blk) {
|
if (next_ra > *ra_blk) {
|
||||||
xfs_dir3_data_readahead(dp, next_ra, -2);
|
xfs_dir3_data_readahead(dp, next_ra,
|
||||||
|
XFS_DABUF_MAP_HOLE_OK);
|
||||||
*ra_blk = next_ra;
|
*ra_blk = next_ra;
|
||||||
}
|
}
|
||||||
ra_want -= geo->fsbcount;
|
ra_want -= geo->fsbcount;
|
||||||
|
|||||||
@@ -1104,7 +1104,7 @@ xfs_dir_open(
|
|||||||
*/
|
*/
|
||||||
mode = xfs_ilock_data_map_shared(ip);
|
mode = xfs_ilock_data_map_shared(ip);
|
||||||
if (ip->i_d.di_nextents > 0)
|
if (ip->i_d.di_nextents > 0)
|
||||||
error = xfs_dir3_data_readahead(ip, 0, -1);
|
error = xfs_dir3_data_readahead(ip, 0, 0);
|
||||||
xfs_iunlock(ip, mode);
|
xfs_iunlock(ip, mode);
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user