1 Index: linux-2.6.5-sles9/include/linux/ext3_fs.h
2 ===================================================================
3 --- linux-2.6.5-sles9.orig/include/linux/ext3_fs.h 2004-11-09 02:29:14.878513832 +0300
4 +++ linux-2.6.5-sles9/include/linux/ext3_fs.h 2004-11-09 02:32:14.151260232 +0300
6 unsigned int block_group,
7 struct buffer_head ** bh);
8 extern int ext3_should_retry_alloc(struct super_block *sb, int *retries);
9 -extern void rsv_window_add(struct super_block *sb, struct reserve_window_node *rsv);
10 +extern void rsv_window_add(struct super_block *sb, struct ext3_reserve_window_node *rsv);
13 extern int ext3_check_dir_entry(const char *, struct inode *,
14 Index: linux-2.6.5-sles9/include/linux/ext3_fs_sb.h
15 ===================================================================
16 --- linux-2.6.5-sles9.orig/include/linux/ext3_fs_sb.h 2004-11-09 02:28:18.753046200 +0300
17 +++ linux-2.6.5-sles9/include/linux/ext3_fs_sb.h 2004-11-09 02:32:27.996155488 +0300
19 /* root of the per fs reservation window tree */
20 spinlock_t s_rsv_window_lock;
21 struct rb_root s_rsv_window_root;
22 - struct reserve_window_node s_rsv_window_head;
23 + struct ext3_reserve_window_node s_rsv_window_head;
26 struct inode * s_journal_inode;
27 Index: linux-2.6.5-sles9/include/linux/ext3_fs_i.h
28 ===================================================================
29 --- linux-2.6.5-sles9.orig/include/linux/ext3_fs_i.h 2004-11-09 02:23:21.606219384 +0300
30 +++ linux-2.6.5-sles9/include/linux/ext3_fs_i.h 2004-11-09 02:32:08.752081032 +0300
32 #include <linux/rbtree.h>
33 #include <linux/seqlock.h>
35 -struct reserve_window {
36 +struct ext3_reserve_window {
37 __u32 _rsv_start; /* First byte reserved */
38 __u32 _rsv_end; /* Last byte reserved or 0 */
41 -struct reserve_window_node {
42 +struct ext3_reserve_window_node {
43 struct rb_node rsv_node;
44 atomic_t rsv_goal_size;
45 atomic_t rsv_alloc_hit;
46 seqlock_t rsv_seqlock;
47 - struct reserve_window rsv_window;
48 + struct ext3_reserve_window rsv_window;
51 #define rsv_start rsv_window._rsv_start
54 __u32 i_next_alloc_goal;
55 /* block reservation window */
56 - struct reserve_window_node i_rsv_window;
57 + struct ext3_reserve_window_node i_rsv_window;
59 __u32 i_dir_start_lookup;
60 #ifdef CONFIG_EXT3_FS_XATTR
61 Index: linux-2.6.5-sles9/fs/ext3/balloc.c
62 ===================================================================
63 --- linux-2.6.5-sles9.orig/fs/ext3/balloc.c 2004-11-09 02:26:53.078070776 +0300
64 +++ linux-2.6.5-sles9/fs/ext3/balloc.c 2004-11-09 02:32:43.108858008 +0300
69 - struct reserve_window_node *rsv, *prev;
70 + struct ext3_reserve_window_node *rsv, *prev;
76 printk("Block Allocation Reservation Windows Map (%s):\n", fn);
78 - rsv = list_entry(n, struct reserve_window_node, rsv_node);
79 + rsv = list_entry(n, struct ext3_reserve_window_node, rsv_node);
81 printk("reservation window 0x%p "
82 "start: %d, end: %d\n",
87 -goal_in_my_reservation(struct reserve_window *rsv, int goal,
88 +goal_in_my_reservation(struct ext3_reserve_window *rsv, int goal,
89 unsigned int group, struct super_block * sb)
91 unsigned long group_first_block, group_last_block;
93 * if the goal is not in any window.
94 * Returns NULL if there are no windows or if all windows start after the goal.
96 -static struct reserve_window_node *search_reserve_window(struct rb_root *root,
97 +static struct ext3_reserve_window_node *search_ext3_reserve_window(struct rb_root *root,
100 struct rb_node *n = root->rb_node;
101 - struct reserve_window_node *rsv;
102 + struct ext3_reserve_window_node *rsv;
109 - rsv = rb_entry(n, struct reserve_window_node, rsv_node);
110 + rsv = rb_entry(n, struct ext3_reserve_window_node, rsv_node);
112 if (goal < rsv->rsv_start)
114 @@ -212,13 +212,13 @@
116 if (rsv->rsv_start > goal) {
117 n = rb_prev(&rsv->rsv_node);
118 - rsv = rb_entry(n, struct reserve_window_node, rsv_node);
119 + rsv = rb_entry(n, struct ext3_reserve_window_node, rsv_node);
124 void rsv_window_add(struct super_block *sb,
125 - struct reserve_window_node *rsv)
126 + struct ext3_reserve_window_node *rsv)
128 struct rb_root *root = &EXT3_SB(sb)->s_rsv_window_root;
129 struct rb_node *node = &rsv->rsv_node;
130 @@ -226,12 +226,12 @@
132 struct rb_node ** p = &root->rb_node;
133 struct rb_node * parent = NULL;
134 - struct reserve_window_node *this;
135 + struct ext3_reserve_window_node *this;
140 - this = rb_entry(parent, struct reserve_window_node, rsv_node);
141 + this = rb_entry(parent, struct ext3_reserve_window_node, rsv_node);
143 if (start < this->rsv_start)
148 static void rsv_window_remove(struct super_block *sb,
149 - struct reserve_window_node *rsv)
150 + struct ext3_reserve_window_node *rsv)
152 rsv->rsv_start = EXT3_RESERVE_WINDOW_NOT_ALLOCATED;
153 rsv->rsv_end = EXT3_RESERVE_WINDOW_NOT_ALLOCATED;
155 rb_erase(&rsv->rsv_node, &EXT3_SB(sb)->s_rsv_window_root);
158 -static inline int rsv_is_empty(struct reserve_window *rsv)
159 +static inline int rsv_is_empty(struct ext3_reserve_window *rsv)
161 /* a valid reservation end block could not be 0 */
162 return (rsv->_rsv_end == EXT3_RESERVE_WINDOW_NOT_ALLOCATED);
164 void ext3_discard_reservation(struct inode *inode)
166 struct ext3_inode_info *ei = EXT3_I(inode);
167 - struct reserve_window_node *rsv = &ei->i_rsv_window;
168 + struct ext3_reserve_window_node *rsv = &ei->i_rsv_window;
169 spinlock_t *rsv_lock = &EXT3_SB(inode->i_sb)->s_rsv_window_lock;
171 if (!rsv_is_empty(&rsv->rsv_window)) {
175 ext3_try_to_allocate(struct super_block *sb, handle_t *handle, int group,
176 - struct buffer_head *bitmap_bh, int goal, struct reserve_window *my_rsv)
177 + struct buffer_head *bitmap_bh, int goal, struct ext3_reserve_window *my_rsv)
179 int group_first_block, start, end;
181 @@ -700,13 +700,13 @@
182 * on succeed, it returns the reservation window to be appended to.
183 * failed, return NULL.
185 -static struct reserve_window_node *find_next_reservable_window(
186 - struct reserve_window_node *search_head,
187 +static struct ext3_reserve_window_node *find_next_reservable_window(
188 + struct ext3_reserve_window_node *search_head,
189 unsigned long size, int *start_block,
192 struct rb_node *next;
193 - struct reserve_window_node *rsv, *prev;
194 + struct ext3_reserve_window_node *rsv, *prev;
197 /* TODO: make the start of the reservation window byte-aligned */
201 next = rb_next(&rsv->rsv_node);
202 - rsv = list_entry(next, struct reserve_window_node, rsv_node);
203 + rsv = list_entry(next, struct ext3_reserve_window_node, rsv_node);
206 * Reached the last reservation, we can just append to the
207 @@ -801,15 +801,15 @@
208 * @group: the group we are trying to allocate in
209 * @bitmap_bh: the block group block bitmap
211 -static int alloc_new_reservation(struct reserve_window_node *my_rsv,
212 +static int alloc_new_reservation(struct ext3_reserve_window_node *my_rsv,
213 int goal, struct super_block *sb,
214 unsigned int group, struct buffer_head *bitmap_bh)
216 - struct reserve_window_node *search_head;
217 + struct ext3_reserve_window_node *search_head;
218 int group_first_block, group_end_block, start_block;
219 int first_free_block;
220 int reservable_space_start;
221 - struct reserve_window_node *prev_rsv;
222 + struct ext3_reserve_window_node *prev_rsv;
223 struct rb_root *fs_rsv_root = &EXT3_SB(sb)->s_rsv_window_root;
228 * shift the search start to the window near the goal block
230 - search_head = search_reserve_window(fs_rsv_root, start_block);
231 + search_head = search_ext3_reserve_window(fs_rsv_root, start_block);
234 * find_next_reservable_window() simply finds a reservable window
237 ext3_try_to_allocate_with_rsv(struct super_block *sb, handle_t *handle,
238 unsigned int group, struct buffer_head *bitmap_bh,
239 - int goal, struct reserve_window_node * my_rsv,
240 + int goal, struct ext3_reserve_window_node * my_rsv,
243 spinlock_t *rsv_lock;
244 @@ -1027,7 +1027,7 @@
245 * then we could go to allocate from the reservation window directly.
248 - struct reserve_window rsv_copy;
249 + struct ext3_reserve_window rsv_copy;
253 @@ -1159,8 +1159,8 @@
254 struct ext3_group_desc *gdp;
255 struct ext3_super_block *es;
256 struct ext3_sb_info *sbi;
257 - struct reserve_window_node *my_rsv = NULL;
258 - struct reserve_window_node *rsv = &EXT3_I(inode)->i_rsv_window;
259 + struct ext3_reserve_window_node *my_rsv = NULL;
260 + struct ext3_reserve_window_node *rsv = &EXT3_I(inode)->i_rsv_window;
261 unsigned short windowsz = 0;
263 static int goal_hits, goal_attempts;