mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

74 lines
2.3 KiB

  1. This is a part of the CLFS silo patch found at
  2. http://svn.cross-lfs.org/svn/repos/cross-lfs/trunk/patches/silo-1.4.13-fixes-3.patch
  3. diff -Naur silo-1.4.13.orig/second/fs/ufs.c silo-1.4.13/second/fs/ufs.c
  4. --- silo-1.4.13.orig/second/fs/ufs.c 2006-06-01 13:24:53.000000000 -0400
  5. +++ silo-1.4.13/second/fs/ufs.c 2007-04-03 17:02:53.000000000 -0400
  6. @@ -40,28 +40,18 @@
  7. ino_t inode = 0;
  8. -#ifdef UFS_CIGAM
  9. -/* Apparently new header */
  10. -
  11. #define ufsi_size(x) ((unsigned int)((x)->ui_size))
  12. #define ufsi_db(x) ((unsigned int *)((x)->ui_u2.ui_addr.ui_db))
  13. #define ufsi_ib(x) ((unsigned int *)((x)->ui_u2.ui_addr.ui_ib))
  14. #define ufsd_namlen(x) ((unsigned char)((x)->d_u.d_44.d_namlen))
  15. -#ifdef UFS_MINFREE
  16. -/* Apparently even newer header */
  17. -#define ufs_superblock ufs_super_block
  18. +struct ufs_superblock_full {
  19. + struct ufs_super_block_first first;
  20. + struct ufs_super_block_second second;
  21. + struct ufs_super_block_third third;
  22. +};
  23. +#define ufs_superblock ufs_super_block_first
  24. #define ufs_direct ufs_dir_entry
  25. -#endif
  26. -
  27. -#else
  28. -
  29. -#define ufsi_size(x) (((x)->ui_size.val[1]))
  30. -#define ufsi_db(x) ((unsigned int *)((x)->ui_db))
  31. -#define ufsi_ib(x) ((unsigned int *)((x)->ui_ib))
  32. -#define ufsd_namlen(x) ((unsigned char)((x)->d_namlen))
  33. -
  34. -#endif
  35. #ifndef S_ISLNK
  36. #include <sys/stat.h>
  37. @@ -92,25 +82,22 @@
  38. return p;
  39. }
  40. -static struct ufs_superblock *ufs_read_super(ufs_filsys fs)
  41. +static struct ufs_superblock_full *ufs_read_super(ufs_filsys fs)
  42. {
  43. - struct ufs_superblock *usb;
  44. + struct ufs_superblock_full *usb;
  45. - usb = (struct ufs_superblock *) malloc (2048);
  46. + usb = (struct ufs_superblock_full *) malloc (2048);
  47. if (!usb) return 0;
  48. if (io_channel_read_blk (fs->io, UFS_SBLOCK/1024, -2048, (char *)usb))
  49. return 0;
  50. - if (usb->fs_magic != UFS_MAGIC) {
  51. - /* XXX - replace hard-coded constant with a byte-swap macro */
  52. - if (usb->fs_magic == 0x54190100) {
  53. - }
  54. + if (usb->third.fs_magic != UFS_MAGIC) {
  55. return 0;
  56. }
  57. - if (usb->fs_bsize != UFS_BSIZE)
  58. + if (usb->first.fs_bsize != UFS_BSIZE)
  59. return 0;
  60. - if (usb->fs_fsize != UFS_FSIZE)
  61. + if (usb->first.fs_fsize != UFS_FSIZE)
  62. return 0;
  63. - io_channel_set_blksize (fs->io, usb->fs_fsize);
  64. + io_channel_set_blksize (fs->io, usb->first.fs_fsize);
  65. return usb;
  66. }