Skip to content

Commit 06566fd

Browse files
Christoph Hellwigdjwong
authored andcommitted
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 <[email protected]> Reviewed-by: Darrick J. Wong <[email protected]> Signed-off-by: Darrick J. Wong <[email protected]>
1 parent 199e9ba commit 06566fd

File tree

7 files changed

+13
-18
lines changed

7 files changed

+13
-18
lines changed

fs/xfs/libxfs/xfs_da_btree.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2651,7 +2651,7 @@ int
26512651
xfs_da_reada_buf(
26522652
struct xfs_inode *dp,
26532653
xfs_dablk_t bno,
2654-
xfs_daddr_t mappedbno,
2654+
unsigned int flags,
26552655
int whichfork,
26562656
const struct xfs_buf_ops *ops)
26572657
{
@@ -2660,18 +2660,12 @@ xfs_da_reada_buf(
26602660
int nmap;
26612661
int error;
26622662

2663-
if (mappedbno >= 0)
2664-
return -EINVAL;
2665-
26662663
mapp = &map;
26672664
nmap = 1;
2668-
error = xfs_dabuf_map(dp, bno,
2669-
mappedbno == -1 ? XFS_DABUF_MAP_HOLE_OK : 0,
2670-
whichfork, &mapp, &nmap);
2665+
error = xfs_dabuf_map(dp, bno, flags, whichfork, &mapp, &nmap);
26712666
if (error || !nmap)
26722667
goto out_free;
26732668

2674-
mappedbno = mapp[0].bm_bn;
26752669
xfs_buf_readahead_map(dp->i_mount->m_ddev_targp, mapp, nmap, ops);
26762670

26772671
out_free:

fs/xfs/libxfs/xfs_da_btree.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,8 @@ int xfs_da_read_buf(struct xfs_trans *trans, struct xfs_inode *dp,
208208
struct xfs_buf **bpp, int whichfork,
209209
const struct xfs_buf_ops *ops);
210210
int xfs_da_reada_buf(struct xfs_inode *dp, xfs_dablk_t bno,
211-
xfs_daddr_t mapped_bno, int whichfork,
212-
const struct xfs_buf_ops *ops);
211+
unsigned int flags, int whichfork,
212+
const struct xfs_buf_ops *ops);
213213
int xfs_da_shrink_inode(xfs_da_args_t *args, xfs_dablk_t dead_blkno,
214214
struct xfs_buf *dead_buf);
215215

fs/xfs/libxfs/xfs_dir2_data.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -416,10 +416,10 @@ int
416416
xfs_dir3_data_readahead(
417417
struct xfs_inode *dp,
418418
xfs_dablk_t bno,
419-
xfs_daddr_t mapped_bno)
419+
unsigned int flags)
420420
{
421-
return xfs_da_reada_buf(dp, bno, mapped_bno,
422-
XFS_DATA_FORK, &xfs_dir3_data_reada_buf_ops);
421+
return xfs_da_reada_buf(dp, bno, flags, XFS_DATA_FORK,
422+
&xfs_dir3_data_reada_buf_ops);
423423
}
424424

425425
/*

fs/xfs/libxfs/xfs_dir2_priv.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ extern xfs_failaddr_t __xfs_dir3_data_check(struct xfs_inode *dp,
7979
struct xfs_buf *bp);
8080
extern int xfs_dir3_data_read(struct xfs_trans *tp, struct xfs_inode *dp,
8181
xfs_dablk_t bno, xfs_daddr_t mapped_bno, struct xfs_buf **bpp);
82-
extern int xfs_dir3_data_readahead(struct xfs_inode *dp, xfs_dablk_t bno,
83-
xfs_daddr_t mapped_bno);
82+
int xfs_dir3_data_readahead(struct xfs_inode *dp, xfs_dablk_t bno,
83+
unsigned int flags);
8484

8585
extern struct xfs_dir2_data_free *
8686
xfs_dir2_data_freeinsert(struct xfs_dir2_data_hdr *hdr,

fs/xfs/scrub/parent.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ xchk_parent_count_parent_dentries(
8080
*/
8181
lock_mode = xfs_ilock_data_map_shared(parent);
8282
if (parent->i_d.di_nextents > 0)
83-
error = xfs_dir3_data_readahead(parent, 0, -1);
83+
error = xfs_dir3_data_readahead(parent, 0, 0);
8484
xfs_iunlock(parent, lock_mode);
8585
if (error)
8686
return error;

fs/xfs/xfs_dir2_readdir.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,8 @@ xfs_dir2_leaf_readbuf(
314314
break;
315315
}
316316
if (next_ra > *ra_blk) {
317-
xfs_dir3_data_readahead(dp, next_ra, -2);
317+
xfs_dir3_data_readahead(dp, next_ra,
318+
XFS_DABUF_MAP_HOLE_OK);
318319
*ra_blk = next_ra;
319320
}
320321
ra_want -= geo->fsbcount;

fs/xfs/xfs_file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1104,7 +1104,7 @@ xfs_dir_open(
11041104
*/
11051105
mode = xfs_ilock_data_map_shared(ip);
11061106
if (ip->i_d.di_nextents > 0)
1107-
error = xfs_dir3_data_readahead(ip, 0, -1);
1107+
error = xfs_dir3_data_readahead(ip, 0, 0);
11081108
xfs_iunlock(ip, mode);
11091109
return error;
11101110
}

0 commit comments

Comments
 (0)