aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/ops_file.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2008-12-10 05:28:10 -0500
committerSteven Whitehouse <swhiteho@redhat.com>2009-01-05 02:39:17 -0500
commit7ed122e42c72b3e4531f8b4a9f72159e8303ac15 (patch)
treeaa9976f47cf34b0b6d267654e74b9ea4f7a29d75 /fs/gfs2/ops_file.c
parent9a776db7371b9c77a8f4f0d2ac6374d78ac7db7d (diff)
GFS2: Streamline alloc calculations for writes
This patch removes some unused code, and make the calculation of the number of blocks required conditional in order to reduce the number of times this (potentially expensive) calculation is done. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/ops_file.c')
-rw-r--r--fs/gfs2/ops_file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/gfs2/ops_file.c b/fs/gfs2/ops_file.c
index a6b7a733fd4d..289c5f54ba53 100644
--- a/fs/gfs2/ops_file.c
+++ b/fs/gfs2/ops_file.c
@@ -355,7 +355,6 @@ static int gfs2_page_mkwrite(struct vm_area_struct *vma, struct page *page)
355 goto out; 355 goto out;
356 356
357 set_bit(GIF_SW_PAGED, &ip->i_flags); 357 set_bit(GIF_SW_PAGED, &ip->i_flags);
358 gfs2_write_calc_reserv(ip, PAGE_CACHE_SIZE, &data_blocks, &ind_blocks);
359 ret = gfs2_write_alloc_required(ip, pos, PAGE_CACHE_SIZE, &alloc_required); 358 ret = gfs2_write_alloc_required(ip, pos, PAGE_CACHE_SIZE, &alloc_required);
360 if (ret || !alloc_required) 359 if (ret || !alloc_required)
361 goto out_unlock; 360 goto out_unlock;
@@ -367,6 +366,7 @@ static int gfs2_page_mkwrite(struct vm_area_struct *vma, struct page *page)
367 ret = gfs2_quota_lock_check(ip); 366 ret = gfs2_quota_lock_check(ip);
368 if (ret) 367 if (ret)
369 goto out_alloc_put; 368 goto out_alloc_put;
369 gfs2_write_calc_reserv(ip, PAGE_CACHE_SIZE, &data_blocks, &ind_blocks);
370 al->al_requested = data_blocks + ind_blocks; 370 al->al_requested = data_blocks + ind_blocks;
371 ret = gfs2_inplace_reserve(ip); 371 ret = gfs2_inplace_reserve(ip);
372 if (ret) 372 if (ret)