xfs: remove the mappedbno argument to xfs_da_reada_buf
authorChristoph Hellwig <hch@lst.de>
Wed, 20 Nov 2019 17:46:02 +0000 (09:46 -0800)
committerDarrick J. Wong <darrick.wong@oracle.com>
Fri, 22 Nov 2019 16:17:09 +0000 (08:17 -0800)
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>
fs/xfs/libxfs/xfs_da_btree.c
fs/xfs/libxfs/xfs_da_btree.h
fs/xfs/libxfs/xfs_dir2_data.c
fs/xfs/libxfs/xfs_dir2_priv.h
fs/xfs/scrub/parent.c
fs/xfs/xfs_dir2_readdir.c
fs/xfs/xfs_file.c

index 4d582a327c12df81ba53c110922383a496a02695..7f8aea85511d1f69effb54655b7356b6afd39f8b 100644 (file)
@@ -2651,7 +2651,7 @@ int
 xfs_da_reada_buf(
        struct xfs_inode        *dp,
        xfs_dablk_t             bno,
-       xfs_daddr_t             mappedbno,
+       unsigned int            flags,
        int                     whichfork,
        const struct xfs_buf_ops *ops)
 {
@@ -2660,18 +2660,12 @@ xfs_da_reada_buf(
        int                     nmap;
        int                     error;
 
-       if (mappedbno >= 0)
-               return -EINVAL;
-
        mapp = &map;
        nmap = 1;
-       error = xfs_dabuf_map(dp, bno,
-                       mappedbno == -1 ? XFS_DABUF_MAP_HOLE_OK : 0,
-                       whichfork, &mapp, &nmap);
+       error = xfs_dabuf_map(dp, bno, flags, whichfork, &mapp, &nmap);
        if (error || !nmap)
                goto out_free;
 
-       mappedbno = mapp[0].bm_bn;
        xfs_buf_readahead_map(dp->i_mount->m_ddev_targp, mapp, nmap, ops);
 
 out_free:
index 64624d5717c9b964e5dea74131c82693f678b9a3..a8c69c2125945323da3a51b861309802208932e9 100644 (file)
@@ -208,8 +208,8 @@ int xfs_da_read_buf(struct xfs_trans *trans, struct xfs_inode *dp,
                               struct xfs_buf **bpp, int whichfork,
                               const struct xfs_buf_ops *ops);
 int    xfs_da_reada_buf(struct xfs_inode *dp, xfs_dablk_t bno,
-                               xfs_daddr_t mapped_bno, int whichfork,
-                               const struct xfs_buf_ops *ops);
+               unsigned int flags, int whichfork,
+               const struct xfs_buf_ops *ops);
 int    xfs_da_shrink_inode(xfs_da_args_t *args, xfs_dablk_t dead_blkno,
                                          struct xfs_buf *dead_buf);
 
index a6eb71a62b536d2ee80ce85fe474c4ac04d4b840..2ab0c78aac3f25fe31964b72595d731a8004ded2 100644 (file)
@@ -416,10 +416,10 @@ int
 xfs_dir3_data_readahead(
        struct xfs_inode        *dp,
        xfs_dablk_t             bno,
-       xfs_daddr_t             mapped_bno)
+       unsigned int            flags)
 {
-       return xfs_da_reada_buf(dp, bno, mapped_bno,
-                               XFS_DATA_FORK, &xfs_dir3_data_reada_buf_ops);
+       return xfs_da_reada_buf(dp, bno, flags, XFS_DATA_FORK,
+                               &xfs_dir3_data_reada_buf_ops);
 }
 
 /*
index eb6af7daf80375f3b45e3030e6ebb4e026a3c2b5..372c2000f951689dc3d57e10c9634802c54e1344 100644 (file)
@@ -79,8 +79,8 @@ extern xfs_failaddr_t __xfs_dir3_data_check(struct xfs_inode *dp,
                struct xfs_buf *bp);
 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);
-extern int xfs_dir3_data_readahead(struct xfs_inode *dp, xfs_dablk_t bno,
-               xfs_daddr_t mapped_bno);
+int xfs_dir3_data_readahead(struct xfs_inode *dp, xfs_dablk_t bno,
+               unsigned int flags);
 
 extern struct xfs_dir2_data_free *
 xfs_dir2_data_freeinsert(struct xfs_dir2_data_hdr *hdr,
index c962bd534690789c0931be1211ddc0e4d55a1b20..17100a83e23e74518fd162bd27cfa156e764e669 100644 (file)
@@ -80,7 +80,7 @@ xchk_parent_count_parent_dentries(
         */
        lock_mode = xfs_ilock_data_map_shared(parent);
        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);
        if (error)
                return error;
index 95bc9ef8f5f934846f089797633aeda4d58fcb1e..5df3d1e2b17f23ea65b6f2ede36cf791ab5a86ba 100644 (file)
@@ -314,7 +314,8 @@ xfs_dir2_leaf_readbuf(
                                break;
                        }
                        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_want -= geo->fsbcount;
index 865543e41fb4a65e0f877b2177fbe8f14aac598a..c932501089520f27f9198919d29d89ecb3a941d0 100644 (file)
@@ -1104,7 +1104,7 @@ xfs_dir_open(
         */
        mode = xfs_ilock_data_map_shared(ip);
        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);
        return error;
 }