Commit bccaef90 authored by Markus Elfring's avatar Markus Elfring Committed by Andreas Gruenbacher

gfs2: Delete an unnecessary check before brelse()

The brelse() function tests whether its argument is NULL and then
returns immediately.  Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

[The same applies to brelse() in gfs2_dir_no_add (which Coccinelle
apparently missed), so fix that as well.]
Signed-off-by: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
parent 45eb0504
...@@ -1463,8 +1463,7 @@ static int gfs2_dir_read_leaf(struct inode *inode, struct dir_context *ctx, ...@@ -1463,8 +1463,7 @@ static int gfs2_dir_read_leaf(struct inode *inode, struct dir_context *ctx,
sort_offset : entries, copied); sort_offset : entries, copied);
out_free: out_free:
for(i = 0; i < leaf; i++) for(i = 0; i < leaf; i++)
if (larr[i]) brelse(larr[i]);
brelse(larr[i]);
kvfree(larr); kvfree(larr);
out: out:
return error; return error;
......
...@@ -32,8 +32,7 @@ extern int gfs2_dir_add(struct inode *inode, const struct qstr *filename, ...@@ -32,8 +32,7 @@ extern int gfs2_dir_add(struct inode *inode, const struct qstr *filename,
const struct gfs2_inode *ip, struct gfs2_diradd *da); const struct gfs2_inode *ip, struct gfs2_diradd *da);
static inline void gfs2_dir_no_add(struct gfs2_diradd *da) static inline void gfs2_dir_no_add(struct gfs2_diradd *da)
{ {
if (da->bh) brelse(da->bh);
brelse(da->bh);
da->bh = NULL; da->bh = NULL;
} }
extern int gfs2_dir_del(struct gfs2_inode *dip, const struct dentry *dentry); extern int gfs2_dir_del(struct gfs2_inode *dip, const struct dentry *dentry);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment