summaryrefslogtreecommitdiff
path: root/fs/gfs2/aops.c
diff options
context:
space:
mode:
authorBob Peterson <rpeterso@redhat.com>2012-06-06 10:17:59 (GMT)
committerSteven Whitehouse <swhiteho@redhat.com>2012-06-06 10:17:59 (GMT)
commit0a305e496059a113f93bdd3ad27a5aaa917fe34d (patch)
treeb0b6ce3997fef4c4e28f598a98e2e08c939414a6 /fs/gfs2/aops.c
parenteea5b5510fc5545d15b69da8e485a7424ae388cf (diff)
downloadlinux-0a305e496059a113f93bdd3ad27a5aaa917fe34d.tar.xz
GFS2: Extend the life of the reservations
This patch lengthens the lifespan of the reservations structure for inodes. Before, they were allocated and deallocated for every write operation. With this patch, they are allocated when the first write occurs, and deallocated when the last process closes the file. It's more efficient to do it this way because it saves GFS2 a lot of unnecessary allocates and frees. It also gives us more flexibility for the future: (1) we can now fold the qadata structure back into the structure and save those alloc/frees, (2) we can use this for multi-block reservations. Signed-off-by: Bob Peterson <rpeterso@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/aops.c')
-rw-r--r--fs/gfs2/aops.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/gfs2/aops.c b/fs/gfs2/aops.c
index e80a464..aba77b5 100644
--- a/fs/gfs2/aops.c
+++ b/fs/gfs2/aops.c
@@ -878,7 +878,7 @@ static int gfs2_write_end(struct file *file, struct address_space *mapping,
brelse(dibh);
failed:
gfs2_trans_end(sdp);
- if (ip->i_res)
+ if (gfs2_mb_reserved(ip))
gfs2_inplace_release(ip);
if (qa) {
gfs2_quota_unlock(ip);