diff options
author | Mark Fasheh <mark.fasheh@oracle.com> | 2008-01-23 21:35:31 -0500 |
---|---|---|
committer | Mark Fasheh <mark.fasheh@oracle.com> | 2008-01-25 18:05:48 -0500 |
commit | 2fe5c1d7eb88830b09c863a4b5b3279dc120f3af (patch) | |
tree | c04e3249e3ae14f935ae1d090cd88833c96e6e3b /fs/ocfs2/buffer_head_io.c | |
parent | 7ec373cf33533af6c50828a62f6b305c2d7fa931 (diff) |
ocfs2: clean up bh null checks
If we know a buffer_head is non-null, then brelse() is unnecessary and
put_bh() can be used instead. Also, an explicit check for NULL is
unnecessary when using brelse(). This patch only covers buffer_head_io.c and
resize.c, which have recently added code which exhibits this problem.
Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
Diffstat (limited to 'fs/ocfs2/buffer_head_io.c')
-rw-r--r-- | fs/ocfs2/buffer_head_io.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/ocfs2/buffer_head_io.c b/fs/ocfs2/buffer_head_io.c index 31aa61dc777b..f136639f5b41 100644 --- a/fs/ocfs2/buffer_head_io.c +++ b/fs/ocfs2/buffer_head_io.c | |||
@@ -79,7 +79,7 @@ int ocfs2_write_block(struct ocfs2_super *osb, struct buffer_head *bh, | |||
79 | * information for this bh as it's not marked locally | 79 | * information for this bh as it's not marked locally |
80 | * uptodate. */ | 80 | * uptodate. */ |
81 | ret = -EIO; | 81 | ret = -EIO; |
82 | brelse(bh); | 82 | put_bh(bh); |
83 | } | 83 | } |
84 | 84 | ||
85 | mutex_unlock(&OCFS2_I(inode)->ip_io_mutex); | 85 | mutex_unlock(&OCFS2_I(inode)->ip_io_mutex); |
@@ -256,7 +256,7 @@ int ocfs2_read_blocks(struct ocfs2_super *osb, u64 block, int nr, | |||
256 | * for this bh as it's not marked locally | 256 | * for this bh as it's not marked locally |
257 | * uptodate. */ | 257 | * uptodate. */ |
258 | status = -EIO; | 258 | status = -EIO; |
259 | brelse(bh); | 259 | put_bh(bh); |
260 | bhs[i] = NULL; | 260 | bhs[i] = NULL; |
261 | continue; | 261 | continue; |
262 | } | 262 | } |
@@ -334,7 +334,7 @@ int ocfs2_write_super_or_backup(struct ocfs2_super *osb, | |||
334 | 334 | ||
335 | if (!buffer_uptodate(bh)) { | 335 | if (!buffer_uptodate(bh)) { |
336 | ret = -EIO; | 336 | ret = -EIO; |
337 | brelse(bh); | 337 | put_bh(bh); |
338 | } | 338 | } |
339 | 339 | ||
340 | out: | 340 | out: |