]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/gfs2/ops_file.c
ALSA: hda - Fix / clean up init verbs for Cxt5047 codec
[linux-2.6-omap-h63xx.git] / fs / gfs2 / ops_file.c
index a6b7a733fd4d677e7389b4e237437dd424ccf50f..93fe41b67f9749ed6ed901943ab1e7ae0808eb00 100644 (file)
@@ -342,7 +342,7 @@ static int gfs2_page_mkwrite(struct vm_area_struct *vma, struct page *page)
        struct gfs2_inode *ip = GFS2_I(inode);
        struct gfs2_sbd *sdp = GFS2_SB(inode);
        unsigned long last_index;
-       u64 pos = page->index << (PAGE_CACHE_SIZE - inode->i_blkbits);
+       u64 pos = page->index << PAGE_CACHE_SHIFT;
        unsigned int data_blocks, ind_blocks, rblocks;
        int alloc_required = 0;
        struct gfs2_holder gh;
@@ -355,7 +355,6 @@ static int gfs2_page_mkwrite(struct vm_area_struct *vma, struct page *page)
                goto out;
 
        set_bit(GIF_SW_PAGED, &ip->i_flags);
-       gfs2_write_calc_reserv(ip, PAGE_CACHE_SIZE, &data_blocks, &ind_blocks);
        ret = gfs2_write_alloc_required(ip, pos, PAGE_CACHE_SIZE, &alloc_required);
        if (ret || !alloc_required)
                goto out_unlock;
@@ -367,6 +366,7 @@ static int gfs2_page_mkwrite(struct vm_area_struct *vma, struct page *page)
        ret = gfs2_quota_lock_check(ip);
        if (ret)
                goto out_alloc_put;
+       gfs2_write_calc_reserv(ip, PAGE_CACHE_SIZE, &data_blocks, &ind_blocks);
        al->al_requested = data_blocks + ind_blocks;
        ret = gfs2_inplace_reserve(ip);
        if (ret)