summaryrefslogtreecommitdiff
path: root/fs/btrfs/tests/btrfs-tests.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-01-11 08:30:05 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-01-11 08:30:05 +0100
commit3dba1da360da5071d013fd0fb8839124104390fa (patch)
tree6e1efe643077ca559fbf0d6c89ac9358e1f8319e /fs/btrfs/tests/btrfs-tests.c
parentd61adf609c48b9e91a84e9a943f0b3bcd84c3cad (diff)
parent7c53f6b671f4aba70ff15e1b05148b10d58c2837 (diff)
Merge 5.11-rc3 into staging-next
We need the staging fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/btrfs/tests/btrfs-tests.c')
-rw-r--r--fs/btrfs/tests/btrfs-tests.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/fs/btrfs/tests/btrfs-tests.c b/fs/btrfs/tests/btrfs-tests.c
index 8ca334d554af..6bd97bd4cb37 100644
--- a/fs/btrfs/tests/btrfs-tests.c
+++ b/fs/btrfs/tests/btrfs-tests.c
@@ -55,8 +55,14 @@ struct inode *btrfs_new_test_inode(void)
struct inode *inode;
inode = new_inode(test_mnt->mnt_sb);
- if (inode)
- inode_init_owner(inode, NULL, S_IFREG);
+ if (!inode)
+ return NULL;
+
+ inode->i_mode = S_IFREG;
+ BTRFS_I(inode)->location.type = BTRFS_INODE_ITEM_KEY;
+ BTRFS_I(inode)->location.objectid = BTRFS_FIRST_FREE_OBJECTID;
+ BTRFS_I(inode)->location.offset = 0;
+ inode_init_owner(inode, NULL, S_IFREG);
return inode;
}