Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 114389
b: refs/heads/master
c: 1c25d93
h: refs/heads/master
i:
  114387: e3fdfae
v: v3
  • Loading branch information
Joel Becker authored and Mark Fasheh committed Oct 13, 2008
1 parent 65df3f1 commit 0e42a94
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 26 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: 0ce1010f1a4319e02574b856d50dfdc0ed855f40
refs/heads/master: 1c25d93a4a27c90c3ae33f9e724f7b67783d68d1
30 changes: 5 additions & 25 deletions trunk/fs/ocfs2/alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -618,34 +618,13 @@ int ocfs2_num_free_extents(struct ocfs2_super *osb,
struct ocfs2_extent_block *eb;
struct buffer_head *eb_bh = NULL;
u64 last_eb_blk = 0;
struct ocfs2_extent_tree et;

mlog_entry_void();

if (type == OCFS2_DINODE_EXTENT) {
struct ocfs2_dinode *fe =
(struct ocfs2_dinode *)root_bh->b_data;
if (!OCFS2_IS_VALID_DINODE(fe)) {
OCFS2_RO_ON_INVALID_DINODE(inode->i_sb, fe);
retval = -EIO;
goto bail;
}

if (fe->i_last_eb_blk)
last_eb_blk = le64_to_cpu(fe->i_last_eb_blk);
el = &fe->id2.i_list;
} else if (type == OCFS2_XATTR_VALUE_EXTENT) {
struct ocfs2_xattr_value_root *xv =
(struct ocfs2_xattr_value_root *) obj;

last_eb_blk = le64_to_cpu(xv->xr_last_eb_blk);
el = &xv->xr_list;
} else if (type == OCFS2_XATTR_TREE_EXTENT) {
struct ocfs2_xattr_block *xb =
(struct ocfs2_xattr_block *)root_bh->b_data;

last_eb_blk = le64_to_cpu(xb->xb_attrs.xb_root.xt_last_eb_blk);
el = &xb->xb_attrs.xb_root.xt_list;
}
ocfs2_get_extent_tree(&et, inode, root_bh, type, obj);
el = et.et_root_el;
last_eb_blk = ocfs2_et_get_last_eb_blk(&et);

if (last_eb_blk) {
retval = ocfs2_read_block(osb, last_eb_blk,
Expand All @@ -665,6 +644,7 @@ int ocfs2_num_free_extents(struct ocfs2_super *osb,
if (eb_bh)
brelse(eb_bh);

ocfs2_put_extent_tree(&et);
mlog_exit(retval);
return retval;
}
Expand Down

0 comments on commit 0e42a94

Please sign in to comment.