Whamcloud - gitweb
* Removed the (new) tcp zero-copy patches
[fs/lustre-release.git] / lustre / kernel_patches / patches / ext3-rename-reserve-2.6-suse.patch
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
5 @@ -709,7 +709,7 @@
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);
11  
12  /* dir.c */
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
18 @@ -86,7 +86,7 @@
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;
24  
25         /* Journaling */
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
31 @@ -20,17 +20,17 @@
32  #include <linux/rbtree.h>
33  #include <linux/seqlock.h>
34  
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 */
39  };
40  
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;
49  };
50  
51  #define rsv_start rsv_window._rsv_start
52 @@ -76,7 +76,7 @@
53          */
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;
58  
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
65 @@ -115,7 +115,7 @@
66                               const char *fn)
67  {
68         struct rb_node *n;
69 -       struct reserve_window_node *rsv, *prev;
70 +       struct ext3_reserve_window_node *rsv, *prev;
71         int bad;
72  
73  restart:
74 @@ -125,7 +125,7 @@
75  
76         printk("Block Allocation Reservation Windows Map (%s):\n", fn);
77         while (n) {
78 -               rsv = list_entry(n, struct reserve_window_node, rsv_node);
79 +               rsv = list_entry(n, struct ext3_reserve_window_node, rsv_node);
80                 if (verbose)
81                         printk("reservation window 0x%p "
82                                "start:  %d, end:  %d\n",
83 @@ -161,7 +161,7 @@
84  #endif
85  
86  static int
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)
90  {
91         unsigned long group_first_block, group_last_block;
92 @@ -184,18 +184,18 @@
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.
95   */
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,
98                                                          unsigned long goal)
99  {
100         struct rb_node *n = root->rb_node;
101 -       struct reserve_window_node *rsv;
102 +       struct ext3_reserve_window_node *rsv;
103  
104         if (!n)
105                 return NULL;
106  
107         while (n)
108         {
109 -               rsv = rb_entry(n, struct reserve_window_node, rsv_node);
110 +               rsv = rb_entry(n, struct ext3_reserve_window_node, rsv_node);
111  
112                 if (goal < rsv->rsv_start)
113                         n = n->rb_left;
114 @@ -212,13 +212,13 @@
115          */
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);
120         }
121         return rsv;
122  }
123  
124  void rsv_window_add(struct super_block *sb,
125 -                   struct reserve_window_node *rsv)
126 +                   struct ext3_reserve_window_node *rsv)
127  {
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 @@
131  
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;
136  
137         while (*p)
138         {
139                 parent = *p;
140 -               this = rb_entry(parent, struct reserve_window_node, rsv_node);
141 +               this = rb_entry(parent, struct ext3_reserve_window_node, rsv_node);
142  
143                 if (start < this->rsv_start)
144                         p = &(*p)->rb_left;
145 @@ -246,7 +246,7 @@
146  }
147  
148  static void rsv_window_remove(struct super_block *sb,
149 -                             struct reserve_window_node *rsv)
150 +                             struct ext3_reserve_window_node *rsv)
151  {
152         rsv->rsv_start = EXT3_RESERVE_WINDOW_NOT_ALLOCATED;
153         rsv->rsv_end = EXT3_RESERVE_WINDOW_NOT_ALLOCATED;
154 @@ -254,7 +254,7 @@
155         rb_erase(&rsv->rsv_node, &EXT3_SB(sb)->s_rsv_window_root);
156  }
157  
158 -static inline int rsv_is_empty(struct reserve_window *rsv)
159 +static inline int rsv_is_empty(struct ext3_reserve_window *rsv)
160  {
161         /* a valid reservation end block could not be 0 */
162         return (rsv->_rsv_end == EXT3_RESERVE_WINDOW_NOT_ALLOCATED);
163 @@ -263,7 +263,7 @@
164  void ext3_discard_reservation(struct inode *inode)
165  {
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;
170  
171         if (!rsv_is_empty(&rsv->rsv_window)) {
172 @@ -600,7 +600,7 @@
173   */
174  static int
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)
178  {
179         int group_first_block, start, end;
180  
181 @@ -700,13 +700,13 @@
182   *     on succeed, it returns the reservation window to be appended to.
183   *     failed, return NULL.
184   */
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,
190                                 int last_block)
191  {
192         struct rb_node *next;
193 -       struct reserve_window_node *rsv, *prev;
194 +       struct ext3_reserve_window_node *rsv, *prev;
195         int cur;
196  
197         /* TODO: make the start of the reservation window byte-aligned */
198 @@ -734,7 +734,7 @@
199  
200                 prev = rsv;
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);
204  
205                 /*
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
210   */
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)
215  {
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;
224         unsigned long size;
225  
226 @@ -859,7 +859,7 @@
227         /*
228          * shift the search start to the window near the goal block
229          */
230 -       search_head = search_reserve_window(fs_rsv_root, start_block);
231 +       search_head = search_ext3_reserve_window(fs_rsv_root, start_block);
232  
233         /*
234          * find_next_reservable_window() simply finds a reservable window
235 @@ -968,7 +968,7 @@
236  static int
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,
241                         int *errp)
242  {
243         spinlock_t *rsv_lock;
244 @@ -1027,7 +1027,7 @@
245          * then we could go to allocate from the reservation window directly.
246          */
247         while (1) {
248 -               struct reserve_window rsv_copy;
249 +               struct ext3_reserve_window rsv_copy;
250                 unsigned int seq;
251  
252                 do {
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;
262  #ifdef EXT3FS_DEBUG
263         static int goal_hits, goal_attempts;