]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blob - src/patches/suse-2.6.27.31/patches.suse/ocfs2-Provide-the-get_root_el-method-to-ocfs2_ext.patch
Reenabled linux-xen, added patches for Xen Kernel Version 2.6.27.31,
[people/teissler/ipfire-2.x.git] / src / patches / suse-2.6.27.31 / patches.suse / ocfs2-Provide-the-get_root_el-method-to-ocfs2_ext.patch
1 From: Joel Becker <joel.becker@oracle.com>
2 Subject: ocfs2: Provide the get_root_el() method to ocfs2_extent_tree_operations.
3 Patch-mainline: 2.6.28?
4 References: FATE302067
5
6 The root_el of an ocfs2_extent_tree needs to be calculated from
7 et->et_object. Make it an operation on et->et_ops.
8
9 Signed-off-by: Joel Becker <joel.becker@oracle.com>
10 Acked-by: Mark Fasheh <mark.fasheh@suse.com>
11 ---
12 fs/ocfs2/alloc.c | 38 ++++++++++++++++++++++++++++++--------
13 1 files changed, 30 insertions(+), 8 deletions(-)
14
15 diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c
16 index 93f44f4..fb6ae67 100644
17 --- a/fs/ocfs2/alloc.c
18 +++ b/fs/ocfs2/alloc.c
19 @@ -72,6 +72,10 @@ struct ocfs2_extent_tree_operations {
20 struct ocfs2_extent_tree *et,
21 u32 new_clusters);
22 int (*eo_sanity_check)(struct inode *inode, struct ocfs2_extent_tree *et);
23 +
24 + /* These are internal to ocfs2_extent_tree and don't have
25 + * accessor functions */
26 + void (*eo_fill_root_el)(struct ocfs2_extent_tree *et);
27 };
28
29 struct ocfs2_extent_tree {
30 @@ -83,6 +87,13 @@ struct ocfs2_extent_tree {
31 unsigned int et_max_leaf_clusters;
32 };
33
34 +static void ocfs2_dinode_fill_root_el(struct ocfs2_extent_tree *et)
35 +{
36 + struct ocfs2_dinode *di = et->et_object;
37 +
38 + et->et_root_el = &di->id2.i_list;
39 +}
40 +
41 static void ocfs2_dinode_set_last_eb_blk(struct ocfs2_extent_tree *et,
42 u64 blkno)
43 {
44 @@ -136,8 +147,16 @@ static struct ocfs2_extent_tree_operations ocfs2_dinode_et_ops = {
45 .eo_get_last_eb_blk = ocfs2_dinode_get_last_eb_blk,
46 .eo_update_clusters = ocfs2_dinode_update_clusters,
47 .eo_sanity_check = ocfs2_dinode_sanity_check,
48 + .eo_fill_root_el = ocfs2_dinode_fill_root_el,
49 };
50
51 +static void ocfs2_xattr_value_fill_root_el(struct ocfs2_extent_tree *et)
52 +{
53 + struct ocfs2_xattr_value_root *xv = et->et_object;
54 +
55 + et->et_root_el = &xv->xr_list;
56 +}
57 +
58 static void ocfs2_xattr_value_set_last_eb_blk(struct ocfs2_extent_tree *et,
59 u64 blkno)
60 {
61 @@ -176,8 +195,16 @@ static struct ocfs2_extent_tree_operations ocfs2_xattr_et_ops = {
62 .eo_get_last_eb_blk = ocfs2_xattr_value_get_last_eb_blk,
63 .eo_update_clusters = ocfs2_xattr_value_update_clusters,
64 .eo_sanity_check = ocfs2_xattr_value_sanity_check,
65 + .eo_fill_root_el = ocfs2_xattr_value_fill_root_el,
66 };
67
68 +static void ocfs2_xattr_tree_fill_root_el(struct ocfs2_extent_tree *et)
69 +{
70 + struct ocfs2_xattr_block *xb = et->et_object;
71 +
72 + et->et_root_el = &xb->xb_attrs.xb_root.xt_list;
73 +}
74 +
75 static void ocfs2_xattr_tree_set_last_eb_blk(struct ocfs2_extent_tree *et,
76 u64 blkno)
77 {
78 @@ -215,6 +242,7 @@ static struct ocfs2_extent_tree_operations ocfs2_xattr_tree_et_ops = {
79 .eo_get_last_eb_blk = ocfs2_xattr_tree_get_last_eb_blk,
80 .eo_update_clusters = ocfs2_xattr_tree_update_clusters,
81 .eo_sanity_check = ocfs2_xattr_tree_sanity_check,
82 + .eo_fill_root_el = ocfs2_xattr_tree_fill_root_el,
83 };
84
85 static void ocfs2_get_extent_tree(struct ocfs2_extent_tree *et,
86 @@ -232,22 +260,16 @@ static void ocfs2_get_extent_tree(struct ocfs2_extent_tree *et,
87 et->et_object = obj;
88
89 if (et_type == OCFS2_DINODE_EXTENT) {
90 - et->et_root_el =
91 - &((struct ocfs2_dinode *)obj)->id2.i_list;
92 et->et_ops = &ocfs2_dinode_et_ops;
93 } else if (et_type == OCFS2_XATTR_VALUE_EXTENT) {
94 - struct ocfs2_xattr_value_root *xv =
95 - (struct ocfs2_xattr_value_root *)obj;
96 - et->et_root_el = &xv->xr_list;
97 et->et_ops = &ocfs2_xattr_et_ops;
98 } else if (et_type == OCFS2_XATTR_TREE_EXTENT) {
99 - struct ocfs2_xattr_block *xb =
100 - (struct ocfs2_xattr_block *)obj;
101 - et->et_root_el = &xb->xb_attrs.xb_root.xt_list;
102 et->et_ops = &ocfs2_xattr_tree_et_ops;
103 et->et_max_leaf_clusters = ocfs2_clusters_for_bytes(inode->i_sb,
104 OCFS2_MAX_XATTR_TREE_LEAF_SIZE);
105 }
106 +
107 + et->et_ops->eo_fill_root_el(et);
108 }
109
110 static void ocfs2_put_extent_tree(struct ocfs2_extent_tree *et)
111 --
112 1.5.4.5
113