Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 323266
b: refs/heads/master
c: 3983903
h: refs/heads/master
v: v3
  • Loading branch information
Steven Whitehouse committed Sep 24, 2012
1 parent ab08125 commit 53d2e4a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 20 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: 5b924ae2dcb1cc5e78445a0cedb5a3673bb5ad8a
refs/heads/master: 3983903a712e74548fa08ef25d68e55b8e4349c6
25 changes: 6 additions & 19 deletions trunk/fs/gfs2/rgrp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1824,27 +1824,14 @@ void gfs2_inplace_release(struct gfs2_inode *ip)

static unsigned char gfs2_get_block_type(struct gfs2_rgrpd *rgd, u64 block)
{
struct gfs2_bitmap *bi = NULL;
u32 length, rgrp_block, buf_block;
unsigned int buf;
unsigned char type;

length = rgd->rd_length;
rgrp_block = block - rgd->rd_data0;

for (buf = 0; buf < length; buf++) {
bi = rgd->rd_bits + buf;
if (rgrp_block < (bi->bi_start + bi->bi_len) * GFS2_NBBY)
break;
}

gfs2_assert(rgd->rd_sbd, buf < length);
buf_block = rgrp_block - bi->bi_start * GFS2_NBBY;
struct gfs2_rbm rbm = { .rgd = rgd, };
int ret;

type = gfs2_testbit(rgd, bi->bi_bh->b_data + bi->bi_offset,
bi->bi_len, buf_block);
ret = gfs2_rbm_from_block(&rbm, block);
WARN_ON_ONCE(ret != 0);

return type;
return gfs2_testbit(rgd, rbm.bi->bi_bh->b_data + rbm.bi->bi_offset,
rbm.bi->bi_len, rbm.offset);
}


Expand Down

0 comments on commit 53d2e4a

Please sign in to comment.