]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/patches/SuSE10.2/reiser-unpack
Hinzugefuegt:
[people/pmueller/ipfire-2.x.git] / src / patches / SuSE10.2 / reiser-unpack
1 --- grub-0.95/stage2/filesys.h.orig 2004-05-14 21:36:43.000000000 +0200
2 +++ grub-0.95/stage2/filesys.h 2004-09-30 17:16:20.741176364 +0200
3 @@ -73,6 +73,16 @@
4 int reiserfs_read (char *buf, int len);
5 int reiserfs_dir (char *dirname);
6 int reiserfs_embed (int *start_sector, int needed_sectors);
7 +#if defined(__linux__) && defined (GRUB_UTIL)
8 +#include <sys/types.h>
9 +#include <sys/stat.h>
10 +#include <sys/ioctl.h>
11 +#include <sys/statfs.h>
12 +#include <fcntl.h>
13 +/* from <linux/reiserfs_fs.h> */
14 +#define REISERFS_SUPER_MAGIC 0x52654973
15 +#define REISERFS_IOC_UNPACK _IOW(0xCD,1,long)
16 +#endif
17 #else
18 #define FSYS_REISERFS_NUM 0
19 #endif
20 --- grub-0.95/stage2/builtins.c.orig 2004-05-14 21:30:52.000000000 +0200
21 +++ grub-0.95/stage2/builtins.c 2004-09-30 17:18:52.342818812 +0200
22 @@ -1807,9 +1807,23 @@
23 #ifdef GRUB_UTIL
24 else if (grub_memcmp ("--stage2=", arg, sizeof ("--stage2=") - 1) == 0)
25 {
26 + int fd;
27 stage2_os_file = arg + sizeof ("--stage2=") - 1;
28 arg = skip_to (0, arg);
29 nul_terminate (stage2_os_file);
30 +
31 +#if defined(__linux__) && defined (FSYS_REISERFS)
32 + if ((fd=open(stage2_os_file, O_RDONLY)) >= 0)
33 + {
34 + struct statfs buf;
35 + /* see if the file sits on a reiserfs,
36 + and try do defragment it if so. */
37 + fstatfs(fd, &buf);
38 + if (buf.f_type == REISERFS_SUPER_MAGIC)
39 + ioctl (fd, REISERFS_IOC_UNPACK, 1);
40 + }
41 +#endif /* __linux__ && FSYS_REISERFS */
42 +
43 }
44 #endif /* GRUB_UTIL */
45 else