Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 348142
b: refs/heads/master
c: f1213ca
h: refs/heads/master
v: v3
  • Loading branch information
Abhijith Das authored and Steven Whitehouse committed Jan 2, 2013
1 parent c5e9531 commit 423cda4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ec1487528bed94c4aaff3687834fe94203880fd6
refs/heads/master: f1213cacc7ffc7d4cdef3692f22b28a2df3216f5
22 changes: 10 additions & 12 deletions trunk/fs/gfs2/rgrp.c
Original file line number Diff line number Diff line change
Expand Up @@ -557,22 +557,20 @@ void gfs2_free_clones(struct gfs2_rgrpd *rgd)
*/
int gfs2_rs_alloc(struct gfs2_inode *ip)
{
struct gfs2_blkreserv *res;
int error = 0;

down_write(&ip->i_rw_mutex);
if (ip->i_res)
return 0;

res = kmem_cache_zalloc(gfs2_rsrv_cachep, GFP_NOFS);
if (!res)
return -ENOMEM;
goto out;

RB_CLEAR_NODE(&res->rs_node);
ip->i_res = kmem_cache_zalloc(gfs2_rsrv_cachep, GFP_NOFS);
if (!ip->i_res) {
error = -ENOMEM;
goto out;
}

down_write(&ip->i_rw_mutex);
if (ip->i_res)
kmem_cache_free(gfs2_rsrv_cachep, res);
else
ip->i_res = res;
RB_CLEAR_NODE(&ip->i_res->rs_node);
out:
up_write(&ip->i_rw_mutex);
return 0;
}
Expand Down

0 comments on commit 423cda4

Please sign in to comment.