aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/bmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/gfs2/bmap.c')
-rw-r--r--fs/gfs2/bmap.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c
index e132d8a41008..cd5e4d863ce2 100644
--- a/fs/gfs2/bmap.c
+++ b/fs/gfs2/bmap.c
@@ -12,9 +12,12 @@
12#include <linux/spinlock.h> 12#include <linux/spinlock.h>
13#include <linux/completion.h> 13#include <linux/completion.h>
14#include <linux/buffer_head.h> 14#include <linux/buffer_head.h>
15#include <linux/gfs2_ondisk.h>
15#include <asm/semaphore.h> 16#include <asm/semaphore.h>
16 17
17#include "gfs2.h" 18#include "gfs2.h"
19#include "lm_interface.h"
20#include "incore.h"
18#include "bmap.h" 21#include "bmap.h"
19#include "glock.h" 22#include "glock.h"
20#include "inode.h" 23#include "inode.h"
@@ -24,6 +27,7 @@
24#include "rgrp.h" 27#include "rgrp.h"
25#include "trans.h" 28#include "trans.h"
26#include "dir.h" 29#include "dir.h"
30#include "util.h"
27 31
28/* This doesn't need to be that large as max 64 bit pointers in a 4k 32/* This doesn't need to be that large as max 64 bit pointers in a 4k
29 * block is 512, so __u16 is fine for that. It saves stack space to 33 * block is 512, so __u16 is fine for that. It saves stack space to
@@ -660,7 +664,7 @@ static int do_strip(struct gfs2_inode *ip, struct buffer_head *dibh,
660 664
661 for (x = 0; x < rlist.rl_rgrps; x++) { 665 for (x = 0; x < rlist.rl_rgrps; x++) {
662 struct gfs2_rgrpd *rgd; 666 struct gfs2_rgrpd *rgd;
663 rgd = get_gl2rgd(rlist.rl_ghs[x].gh_gl); 667 rgd = rlist.rl_ghs[x].gh_gl->gl_object;
664 rg_blocks += rgd->rd_ri.ri_length; 668 rg_blocks += rgd->rd_ri.ri_length;
665 } 669 }
666 670
@@ -1021,7 +1025,7 @@ void gfs2_write_calc_reserv(struct gfs2_inode *ip, unsigned int len,
1021 unsigned int tmp; 1025 unsigned int tmp;
1022 1026
1023 if (gfs2_is_dir(ip)) { 1027 if (gfs2_is_dir(ip)) {
1024 *data_blocks = DIV_RU(len, sdp->sd_jbsize) + 2; 1028 *data_blocks = DIV_ROUND_UP(len, sdp->sd_jbsize) + 2;
1025 *ind_blocks = 3 * (sdp->sd_max_jheight - 1); 1029 *ind_blocks = 3 * (sdp->sd_max_jheight - 1);
1026 } else { 1030 } else {
1027 *data_blocks = (len >> sdp->sd_sb.sb_bsize_shift) + 3; 1031 *data_blocks = (len >> sdp->sd_sb.sb_bsize_shift) + 3;
@@ -1029,7 +1033,7 @@ void gfs2_write_calc_reserv(struct gfs2_inode *ip, unsigned int len,
1029 } 1033 }
1030 1034
1031 for (tmp = *data_blocks; tmp > sdp->sd_diptrs;) { 1035 for (tmp = *data_blocks; tmp > sdp->sd_diptrs;) {
1032 tmp = DIV_RU(tmp, sdp->sd_inptrs); 1036 tmp = DIV_ROUND_UP(tmp, sdp->sd_inptrs);
1033 *ind_blocks += tmp; 1037 *ind_blocks += tmp;
1034 } 1038 }
1035} 1039}