diff options
Diffstat (limited to 'fs/ext4/ialloc.c')
-rw-r--r-- | fs/ext4/ialloc.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c index 10bd6fecc9ff..91d8fe3aced3 100644 --- a/fs/ext4/ialloc.c +++ b/fs/ext4/ialloc.c | |||
@@ -634,8 +634,10 @@ static int find_group_other(struct super_block *sb, struct inode *parent, | |||
634 | * For other inodes, search forward from the parent directory's block | 634 | * For other inodes, search forward from the parent directory's block |
635 | * group to find a free inode. | 635 | * group to find a free inode. |
636 | */ | 636 | */ |
637 | struct inode *ext4_new_inode(handle_t *handle, struct inode *dir, umode_t mode, | 637 | struct inode *__ext4_new_inode(handle_t *handle, struct inode *dir, |
638 | const struct qstr *qstr, __u32 goal, uid_t *owner) | 638 | umode_t mode, const struct qstr *qstr, |
639 | __u32 goal, uid_t *owner, int handle_type, | ||
640 | unsigned int line_no, int nblocks) | ||
639 | { | 641 | { |
640 | struct super_block *sb; | 642 | struct super_block *sb; |
641 | struct buffer_head *inode_bitmap_bh = NULL; | 643 | struct buffer_head *inode_bitmap_bh = NULL; |
@@ -725,6 +727,15 @@ repeat_in_this_group: | |||
725 | "inode=%lu", ino + 1); | 727 | "inode=%lu", ino + 1); |
726 | continue; | 728 | continue; |
727 | } | 729 | } |
730 | if (!handle) { | ||
731 | BUG_ON(nblocks <= 0); | ||
732 | handle = __ext4_journal_start_sb(dir->i_sb, line_no, | ||
733 | handle_type, nblocks); | ||
734 | if (IS_ERR(handle)) { | ||
735 | err = PTR_ERR(handle); | ||
736 | goto fail; | ||
737 | } | ||
738 | } | ||
728 | BUFFER_TRACE(inode_bitmap_bh, "get_write_access"); | 739 | BUFFER_TRACE(inode_bitmap_bh, "get_write_access"); |
729 | err = ext4_journal_get_write_access(handle, inode_bitmap_bh); | 740 | err = ext4_journal_get_write_access(handle, inode_bitmap_bh); |
730 | if (err) | 741 | if (err) |