]> www.infradead.org Git - users/hch/xfsprogs.git/commitdiff
xfs: remove the mappedbno argument to xfs_da_reada_buf
authorChristoph Hellwig <hch@lst.de>
Wed, 22 Jan 2020 16:29:45 +0000 (11:29 -0500)
committerEric Sandeen <sandeen@redhat.com>
Wed, 22 Jan 2020 16:29:45 +0000 (11:29 -0500)
Source kernel commit: 06566fda428e6420aa993e32845b165936fb50d6

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>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/xfs_da_btree.c
libxfs/xfs_da_btree.h
libxfs/xfs_dir2_data.c
libxfs/xfs_dir2_priv.h

index aa72d61f7ce0f5adb434b2c5761df157a49f2273..00f3709161f3182013622b4196bb3c33ba19c363 100644 (file)
@@ -2648,7 +2648,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)
 {
@@ -2657,18 +2657,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 9fb50c3f7c81823a2f6aaa7fe4faad8de92ef007..6dc495396ca2616b7e86039caf1c0bcfaf894de8 100644 (file)
@@ -413,10 +413,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 61057362c390676e9b51c080c70e51b12d51ac8f..c1f4dc1fd7926bad5153fe4c3dfa06066ecd6ab5 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,