Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 114390
b: refs/heads/master
c: 943cced
h: refs/heads/master
v: v3
  • Loading branch information
Joel Becker authored and Mark Fasheh committed Oct 13, 2008
1 parent 0e42a94 commit cd0b798
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 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: 1c25d93a4a27c90c3ae33f9e724f7b67783d68d1
refs/heads/master: 943cced39ee45ed2db25efd25eee8ba49cf2dfc4
18 changes: 15 additions & 3 deletions trunk/fs/ocfs2/alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ struct ocfs2_extent_tree_operations {
/* These are internal to ocfs2_extent_tree and don't have
* accessor functions */
void (*eo_fill_root_el)(struct ocfs2_extent_tree *et);
void (*eo_fill_max_leaf_clusters)(struct inode *inode,
struct ocfs2_extent_tree *et);
};

struct ocfs2_extent_tree {
Expand Down Expand Up @@ -205,6 +207,14 @@ static void ocfs2_xattr_tree_fill_root_el(struct ocfs2_extent_tree *et)
et->et_root_el = &xb->xb_attrs.xb_root.xt_list;
}

static void ocfs2_xattr_tree_fill_max_leaf_clusters(struct inode *inode,
struct ocfs2_extent_tree *et)
{
et->et_max_leaf_clusters =
ocfs2_clusters_for_bytes(inode->i_sb,
OCFS2_MAX_XATTR_TREE_LEAF_SIZE);
}

static void ocfs2_xattr_tree_set_last_eb_blk(struct ocfs2_extent_tree *et,
u64 blkno)
{
Expand Down Expand Up @@ -243,6 +253,7 @@ static struct ocfs2_extent_tree_operations ocfs2_xattr_tree_et_ops = {
.eo_update_clusters = ocfs2_xattr_tree_update_clusters,
.eo_sanity_check = ocfs2_xattr_tree_sanity_check,
.eo_fill_root_el = ocfs2_xattr_tree_fill_root_el,
.eo_fill_max_leaf_clusters = ocfs2_xattr_tree_fill_max_leaf_clusters,
};

static void ocfs2_get_extent_tree(struct ocfs2_extent_tree *et,
Expand All @@ -254,7 +265,6 @@ static void ocfs2_get_extent_tree(struct ocfs2_extent_tree *et,
et->et_type = et_type;
get_bh(bh);
et->et_root_bh = bh;
et->et_max_leaf_clusters = 0;
if (!obj)
obj = (void *)bh->b_data;
et->et_object = obj;
Expand All @@ -265,11 +275,13 @@ static void ocfs2_get_extent_tree(struct ocfs2_extent_tree *et,
et->et_ops = &ocfs2_xattr_et_ops;
} else if (et_type == OCFS2_XATTR_TREE_EXTENT) {
et->et_ops = &ocfs2_xattr_tree_et_ops;
et->et_max_leaf_clusters = ocfs2_clusters_for_bytes(inode->i_sb,
OCFS2_MAX_XATTR_TREE_LEAF_SIZE);
}

et->et_ops->eo_fill_root_el(et);
if (!et->et_ops->eo_fill_max_leaf_clusters)
et->et_max_leaf_clusters = 0;
else
et->et_ops->eo_fill_max_leaf_clusters(inode, et);
}

static void ocfs2_put_extent_tree(struct ocfs2_extent_tree *et)
Expand Down

0 comments on commit cd0b798

Please sign in to comment.