Merge tag 'xfs-6.9-merge-8' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux
[linux-block.git] / fs / xfs / libxfs / xfs_dir2_sf.c
index e1f83fc7b6ad1108f52680e0fdf94f322feeed1a..17a20384c8b7195350f3db6ae5926e98b3086a1b 100644 (file)
@@ -276,7 +276,7 @@ xfs_dir2_block_to_sf(
         * format the data into.  Once we have formatted the data, we can free
         * the block and copy the formatted data into the inode literal area.
         */
-       sfp = kmem_alloc(mp->m_sb.sb_inodesize, 0);
+       sfp = kmalloc(mp->m_sb.sb_inodesize, GFP_KERNEL | __GFP_NOFAIL);
        memcpy(sfp, sfhp, xfs_dir2_sf_hdr_size(sfhp->i8count));
 
        /*
@@ -350,7 +350,7 @@ xfs_dir2_block_to_sf(
        xfs_dir2_sf_check(args);
 out:
        xfs_trans_log_inode(args->trans, dp, logflags);
-       kmem_free(sfp);
+       kfree(sfp);
        return error;
 }
 
@@ -524,7 +524,7 @@ xfs_dir2_sf_addname_hard(
         * Copy the old directory to the stack buffer.
         */
        old_isize = (int)dp->i_disk_size;
-       buf = kmem_alloc(old_isize, 0);
+       buf = kmalloc(old_isize, GFP_KERNEL | __GFP_NOFAIL);
        oldsfp = (xfs_dir2_sf_hdr_t *)buf;
        memcpy(oldsfp, dp->i_df.if_data, old_isize);
        /*
@@ -576,7 +576,7 @@ xfs_dir2_sf_addname_hard(
                sfep = xfs_dir2_sf_nextentry(mp, sfp, sfep);
                memcpy(sfep, oldsfep, old_isize - nbytes);
        }
-       kmem_free(buf);
+       kfree(buf);
        dp->i_disk_size = new_isize;
        xfs_dir2_sf_check(args);
 }
@@ -1151,7 +1151,7 @@ xfs_dir2_sf_toino4(
         * Don't want xfs_idata_realloc copying the data here.
         */
        oldsize = dp->i_df.if_bytes;
-       buf = kmem_alloc(oldsize, 0);
+       buf = kmalloc(oldsize, GFP_KERNEL | __GFP_NOFAIL);
        ASSERT(oldsfp->i8count == 1);
        memcpy(buf, oldsfp, oldsize);
        /*
@@ -1190,7 +1190,7 @@ xfs_dir2_sf_toino4(
        /*
         * Clean up the inode.
         */
-       kmem_free(buf);
+       kfree(buf);
        dp->i_disk_size = newsize;
        xfs_trans_log_inode(args->trans, dp, XFS_ILOG_CORE | XFS_ILOG_DDATA);
 }
@@ -1223,7 +1223,7 @@ xfs_dir2_sf_toino8(
         * Don't want xfs_idata_realloc copying the data here.
         */
        oldsize = dp->i_df.if_bytes;
-       buf = kmem_alloc(oldsize, 0);
+       buf = kmalloc(oldsize, GFP_KERNEL | __GFP_NOFAIL);
        ASSERT(oldsfp->i8count == 0);
        memcpy(buf, oldsfp, oldsize);
        /*
@@ -1262,7 +1262,7 @@ xfs_dir2_sf_toino8(
        /*
         * Clean up the inode.
         */
-       kmem_free(buf);
+       kfree(buf);
        dp->i_disk_size = newsize;
        xfs_trans_log_inode(args->trans, dp, XFS_ILOG_CORE | XFS_ILOG_DDATA);
 }