Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 210385
b: refs/heads/master
c: 889f004
h: refs/heads/master
i:
  210383: 011e156
v: v3
  • Loading branch information
Tao Ma committed Sep 8, 2010
1 parent 5f0cdda commit 6049e84
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 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: 04eda1a18019bb387dc7e97ee99979dd88dc608a
refs/heads/master: 889f004a8c83d515f275078687f859bc0d5ede9d
19 changes: 11 additions & 8 deletions trunk/fs/ocfs2/suballoc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2567,7 +2567,8 @@ int ocfs2_lock_allocators(struct inode *inode,
* suballoc_bit.
*/
static int ocfs2_get_suballoc_slot_bit(struct ocfs2_super *osb, u64 blkno,
u16 *suballoc_slot, u16 *suballoc_bit)
u16 *suballoc_slot, u64 *group_blkno,
u16 *suballoc_bit)
{
int status;
struct buffer_head *inode_bh = NULL;
Expand Down Expand Up @@ -2604,6 +2605,8 @@ static int ocfs2_get_suballoc_slot_bit(struct ocfs2_super *osb, u64 blkno,
*suballoc_slot = le16_to_cpu(inode_fe->i_suballoc_slot);
if (suballoc_bit)
*suballoc_bit = le16_to_cpu(inode_fe->i_suballoc_bit);
if (group_blkno)
*group_blkno = le64_to_cpu(inode_fe->i_suballoc_loc);

bail:
brelse(inode_bh);
Expand All @@ -2621,7 +2624,8 @@ static int ocfs2_get_suballoc_slot_bit(struct ocfs2_super *osb, u64 blkno,
*/
static int ocfs2_test_suballoc_bit(struct ocfs2_super *osb,
struct inode *suballoc,
struct buffer_head *alloc_bh, u64 blkno,
struct buffer_head *alloc_bh,
u64 group_blkno, u64 blkno,
u16 bit, int *res)
{
struct ocfs2_dinode *alloc_di;
Expand All @@ -2642,10 +2646,8 @@ static int ocfs2_test_suballoc_bit(struct ocfs2_super *osb,
goto bail;
}

if (alloc_di->i_suballoc_loc)
bg_blkno = le64_to_cpu(alloc_di->i_suballoc_loc);
else
bg_blkno = ocfs2_which_suballoc_group(blkno, bit);
bg_blkno = group_blkno ? group_blkno :
ocfs2_which_suballoc_group(blkno, bit);
status = ocfs2_read_group_descriptor(suballoc, alloc_di, bg_blkno,
&group_bh);
if (status < 0) {
Expand Down Expand Up @@ -2680,14 +2682,15 @@ static int ocfs2_test_suballoc_bit(struct ocfs2_super *osb,
int ocfs2_test_inode_bit(struct ocfs2_super *osb, u64 blkno, int *res)
{
int status;
u64 group_blkno = 0;
u16 suballoc_bit = 0, suballoc_slot = 0;
struct inode *inode_alloc_inode;
struct buffer_head *alloc_bh = NULL;

mlog_entry("blkno: %llu", (unsigned long long)blkno);

status = ocfs2_get_suballoc_slot_bit(osb, blkno, &suballoc_slot,
&suballoc_bit);
&group_blkno, &suballoc_bit);
if (status < 0) {
mlog(ML_ERROR, "get alloc slot and bit failed %d\n", status);
goto bail;
Expand Down Expand Up @@ -2715,7 +2718,7 @@ int ocfs2_test_inode_bit(struct ocfs2_super *osb, u64 blkno, int *res)
}

status = ocfs2_test_suballoc_bit(osb, inode_alloc_inode, alloc_bh,
blkno, suballoc_bit, res);
group_blkno, blkno, suballoc_bit, res);
if (status < 0)
mlog(ML_ERROR, "test suballoc bit failed %d\n", status);

Expand Down

0 comments on commit 6049e84

Please sign in to comment.