Merge branch 'rmobile/kota2' into rmobile-latest
[firefly-linux-kernel-4.4.55.git] / fs / xfs / xfs_attr_leaf.c
index 8fad9602542bb4cf0fe5550ea1b970a1b7c0a3f9..d4906e7c97873b302201cddf442bdc5eeb54a29d 100644 (file)
@@ -2926,9 +2926,8 @@ xfs_attr_leaf_freextent(xfs_trans_t **trans, xfs_inode_t *dp,
                 * Try to remember where we decided to put the value.
                 */
                nmap = 1;
-               error = xfs_bmapi(*trans, dp, (xfs_fileoff_t)tblkno, tblkcnt,
-                                       XFS_BMAPI_ATTRFORK | XFS_BMAPI_METADATA,
-                                       NULL, 0, &map, &nmap, NULL);
+               error = xfs_bmapi_read(dp, (xfs_fileoff_t)tblkno, tblkcnt,
+                                      &map, &nmap, XFS_BMAPI_ATTRFORK);
                if (error) {
                        return(error);
                }
@@ -2948,6 +2947,8 @@ xfs_attr_leaf_freextent(xfs_trans_t **trans, xfs_inode_t *dp,
                        bp = xfs_trans_get_buf(*trans,
                                        dp->i_mount->m_ddev_targp,
                                        dblkno, dblkcnt, XBF_LOCK);
+                       if (!bp)
+                               return ENOMEM;
                        xfs_trans_binval(*trans, bp);
                        /*
                         * Roll to next transaction.