Skip to content

Commit

Permalink
ocfs2: no need get dinode bh when zeroing extend
Browse files Browse the repository at this point in the history
Since di_bh won't be used when zeroing extend, set it to NULL.

Signed-off-by: Joseph Qi <[email protected]>
Cc: Mark Fasheh <[email protected]>
Cc: Joel Becker <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
josephhz authored and torvalds committed Apr 14, 2015
1 parent bdd8621 commit 7e9b195
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions fs/ocfs2/aops.c
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@ static ssize_t ocfs2_direct_IO_write(struct kiocb *iocb,
}

if (append_write) {
ret = ocfs2_inode_lock(inode, &di_bh, 1);
ret = ocfs2_inode_lock(inode, NULL, 1);
if (ret < 0) {
mlog_errno(ret);
goto clean_orphan;
Expand All @@ -720,21 +720,17 @@ static ssize_t ocfs2_direct_IO_write(struct kiocb *iocb,
if (ret < 0) {
mlog_errno(ret);
ocfs2_inode_unlock(inode, 1);
brelse(di_bh);
goto clean_orphan;
}

is_overwrite = ocfs2_is_overwrite(osb, inode, offset);
if (is_overwrite < 0) {
mlog_errno(is_overwrite);
ocfs2_inode_unlock(inode, 1);
brelse(di_bh);
goto clean_orphan;
}

ocfs2_inode_unlock(inode, 1);
brelse(di_bh);
di_bh = NULL;
}

written = __blockdev_direct_IO(WRITE, iocb, inode, inode->i_sb->s_bdev,
Expand Down

0 comments on commit 7e9b195

Please sign in to comment.