X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fkernel_patches%2Fpatches%2Fext-2.4-patch-1-chaos.patch;h=3de6a8f88b65a71d2e3f16f30fecb70887be9d28;hb=6eb1691529f172be126b4c69861a5657ecf725ed;hp=b59cea2cb12ed757ea802c2256f083317ebdf2fd;hpb=96ec6856f91f7f9031cfce4273c714d72cfe59ae;p=fs%2Flustre-release.git diff --git a/lustre/kernel_patches/patches/ext-2.4-patch-1-chaos.patch b/lustre/kernel_patches/patches/ext-2.4-patch-1-chaos.patch index b59cea2..3de6a8f 100644 --- a/lustre/kernel_patches/patches/ext-2.4-patch-1-chaos.patch +++ b/lustre/kernel_patches/patches/ext-2.4-patch-1-chaos.patch @@ -1190,28 +1190,28 @@ + +static void dx_sort_map (struct dx_map_entry *map, unsigned count) +{ -+ struct dx_map_entry *p, *q, *top = map + count - 1; -+ int more; -+ /* Combsort until bubble sort doesn't suck */ -+ while (count > 2) ++ struct dx_map_entry *p, *q, *top = map + count - 1; ++ int more; ++ /* Combsort until bubble sort doesn't suck */ ++ while (count > 2) + { -+ count = count*10/13; -+ if (count - 9 < 2) /* 9, 10 -> 11 */ -+ count = 11; -+ for (p = top, q = p - count; q >= map; p--, q--) -+ if (p->hash < q->hash) -+ swap(*p, *q); -+ } -+ /* Garden variety bubble sort */ -+ do { -+ more = 0; -+ q = top; -+ while (q-- > map) ++ count = count*10/13; ++ if (count - 9 < 2) /* 9, 10 -> 11 */ ++ count = 11; ++ for (p = top, q = p - count; q >= map; p--, q--) ++ if (p->hash < q->hash) ++ swap(*p, *q); ++ } ++ /* Garden variety bubble sort */ ++ do { ++ more = 0; ++ q = top; ++ while (q-- > map) + { -+ if (q[1].hash >= q[0].hash) ++ if (q[1].hash >= q[0].hash) + continue; -+ swap(*(q+1), *q); -+ more = 1; ++ swap(*(q+1), *q); ++ more = 1; + } + } while(more); +} @@ -1381,7 +1381,7 @@ } d_add(dentry, inode); return NULL; -@@ -238,6 +952,300 @@ static inline void ext3_set_de_type(stru +@@ -238,6 +952,301 @@ static inline void ext3_set_de_type(stru de->file_type = ext3_type_by_mode[(mode & S_IFMT)>>S_SHIFT]; } @@ -1642,7 +1642,8 @@ + data1 = bh2->b_data; + + /* The 0th block becomes the root, move the dirents out */ -+ de = (struct ext3_dir_entry_2 *) &root->info; ++ de = (struct ext3_dir_entry_2 *) &root->dotdot; ++ de = (struct ext3_dir_entry_2 *) ((char *)de + de->rec_len); + len = ((char *) root) + blocksize - (char *) de; + memcpy (data1, de, len); + de = (struct ext3_dir_entry_2 *) data1; @@ -2192,7 +2193,7 @@ - inode->u.ext3_i.i_disksize = inode->i_size; + EXT3_I(inode)->i_disksize = inode->i_size; err = ext3_add_nondir(handle, dentry, inode); -+ ext3_mark_inode_dirty(handle, inode); ++ ext3_mark_inode_dirty(handle, inode); out_stop: ext3_journal_stop(handle, dir); return err;