]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: remove the mappedbno argument to xfs_da_get_buf
authorChristoph Hellwig <hch@lst.de>
Wed, 22 Jan 2020 16:29:46 +0000 (11:29 -0500)
committerEric Sandeen <sandeen@redhat.com>
Wed, 22 Jan 2020 16:29:46 +0000 (11:29 -0500)
Source kernel commit: 2911edb653b9c64e0aad461f308cae8ce030eb7b

Use the xfs_da_get_buf_daddr function directly for the two callers
that pass a mapped disk address, and then remove the mappedbno argument.

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_attr_leaf.c
libxfs/xfs_da_btree.c
libxfs/xfs_da_btree.h
libxfs/xfs_dir2_data.c
libxfs/xfs_dir2_leaf.c
libxfs/xfs_dir2_node.c
repair/phase6.c

index 2d01bd43c7f2b0c08b6fbef84cacc9410a20f720..7f11de3e572af6bbf79d4f06e3c1fdc9cf218539 100644 (file)
@@ -1158,7 +1158,7 @@ xfs_attr3_leaf_to_node(
        if (error)
                goto out;
 
-       error = xfs_da_get_buf(args->trans, dp, blkno, -1, &bp2, XFS_ATTR_FORK);
+       error = xfs_da_get_buf(args->trans, dp, blkno, &bp2, XFS_ATTR_FORK);
        if (error)
                goto out;
 
@@ -1219,7 +1219,7 @@ xfs_attr3_leaf_create(
 
        trace_xfs_attr_leaf_create(args);
 
-       error = xfs_da_get_buf(args->trans, args->dp, blkno, -1, &bp,
+       error = xfs_da_get_buf(args->trans, args->dp, blkno, &bp,
                                            XFS_ATTR_FORK);
        if (error)
                return error;
index ec49dffb6911e5bda984f4c9b895f492479a7957..5102c6e02bd307c71c9e31646cdc3cb01ff7fbce 100644 (file)
@@ -426,7 +426,7 @@ xfs_da3_node_create(
        trace_xfs_da_node_create(args);
        ASSERT(level <= XFS_DA_NODE_MAXDEPTH);
 
-       error = xfs_da_get_buf(tp, dp, blkno, -1, &bp, whichfork);
+       error = xfs_da_get_buf(tp, dp, blkno, &bp, whichfork);
        if (error)
                return error;
        bp->b_ops = &xfs_da3_node_buf_ops;
@@ -653,7 +653,7 @@ xfs_da3_root_split(
 
        dp = args->dp;
        tp = args->trans;
-       error = xfs_da_get_buf(tp, dp, blkno, -1, &bp, args->whichfork);
+       error = xfs_da_get_buf(tp, dp, blkno, &bp, args->whichfork);
        if (error)
                return error;
        node = bp->b_addr;
@@ -2574,7 +2574,6 @@ xfs_da_get_buf(
        struct xfs_trans        *tp,
        struct xfs_inode        *dp,
        xfs_dablk_t             bno,
-       xfs_daddr_t             mappedbno,
        struct xfs_buf          **bpp,
        int                     whichfork)
 {
@@ -2585,22 +2584,11 @@ xfs_da_get_buf(
        int                     error;
 
        *bpp = NULL;
-
-       if (mappedbno >= 0) {
-               bp = xfs_trans_get_buf(tp, mp->m_ddev_targp, mappedbno,
-                               XFS_FSB_TO_BB(mp,
-                                       xfs_dabuf_nfsb(mp, whichfork)), 0);
-               goto done;
-       }
-
-       error = xfs_dabuf_map(dp, bno,
-                       mappedbno == -1 ? XFS_DABUF_MAP_HOLE_OK : 0,
-                       whichfork, &mapp, &nmap);
+       error = xfs_dabuf_map(dp, bno, 0, whichfork, &mapp, &nmap);
        if (error || nmap == 0)
                goto out_free;
 
        bp = xfs_trans_get_buf_map(tp, mp->m_ddev_targp, mapp, nmap, 0);
-done:
        error = bp ? bp->b_error : -EIO;
        if (error) {
                if (bp)
index f83d18a5d5f1f435c71d081bcdf9b5bcdc259cb1..e16610d1c14f3396b25ade839974604fbd4fda29 100644 (file)
@@ -203,8 +203,7 @@ int xfs_da_grow_inode(xfs_da_args_t *args, xfs_dablk_t *new_blkno);
 int    xfs_da_grow_inode_int(struct xfs_da_args *args, xfs_fileoff_t *bno,
                              int count);
 int    xfs_da_get_buf(struct xfs_trans *trans, struct xfs_inode *dp,
-                             xfs_dablk_t bno, xfs_daddr_t mappedbno,
-                             struct xfs_buf **bp, int whichfork);
+               xfs_dablk_t bno, struct xfs_buf **bp, int whichfork);
 int    xfs_da_read_buf(struct xfs_trans *trans, struct xfs_inode *dp,
                xfs_dablk_t bno, unsigned int flags, struct xfs_buf **bpp,
                int whichfork, const struct xfs_buf_ops *ops);
index 5f65664a4bdd94f38a3f002f741b79d9ff301dde..91a9cc1623bcd877d4cceff153c5c651945783ff 100644 (file)
@@ -676,7 +676,7 @@ xfs_dir3_data_init(
         * Get the buffer set up for the block.
         */
        error = xfs_da_get_buf(tp, dp, xfs_dir2_db_to_da(args->geo, blkno),
-                              -1, &bp, XFS_DATA_FORK);
+                              &bp, XFS_DATA_FORK);
        if (error)
                return error;
        bp->b_ops = &xfs_dir3_data_buf_ops;
index 8b73726df5ad4ad102b99b4e508268b410421999..d73e54eb18b48c8a5386174eec322c83dd92762b 100644 (file)
@@ -353,7 +353,7 @@ xfs_dir3_leaf_get_buf(
               bno < xfs_dir2_byte_to_db(args->geo, XFS_DIR2_FREE_OFFSET));
 
        error = xfs_da_get_buf(tp, dp, xfs_dir2_db_to_da(args->geo, bno),
-                              -1, &bp, XFS_DATA_FORK);
+                              &bp, XFS_DATA_FORK);
        if (error)
                return error;
 
index c1229e8102df3ca325e05ed519f3ad6b120a2d4d..ffa136b99becddc0b8b536a2b10ba22de1307bb2 100644 (file)
@@ -321,7 +321,7 @@ xfs_dir3_free_get_buf(
        struct xfs_dir3_icfree_hdr hdr;
 
        error = xfs_da_get_buf(tp, dp, xfs_dir2_db_to_da(args->geo, fbno),
-                                  -1, &bp, XFS_DATA_FORK);
+                       &bp, XFS_DATA_FORK);
        if (error)
                return error;
 
index 3611111c6cdb49b884d5ce3644a917b2f2be9e61..76709f73a4258cc3e29fe6645364c3198e157753 100644 (file)
@@ -1289,7 +1289,7 @@ dir_binval(
                                rec.br_blockcount);
                for (; dabno <= end_dabno; dabno += geo->fsbcount) {
                        bp = NULL;
-                       error = -libxfs_da_get_buf(tp, ip, dabno, -2, &bp,
+                       error = -libxfs_da_get_buf(tp, ip, dabno, &bp,
                                        whichfork);
                        if (error)
                                return error;