505-2.6.39_fix.patch 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. --- a/fs/yaffs2/yaffs_vfs_glue.c
  2. +++ b/fs/yaffs2/yaffs_vfs_glue.c
  3. @@ -72,7 +72,7 @@
  4. #include <linux/init.h>
  5. #include <linux/fs.h>
  6. #include <linux/proc_fs.h>
  7. -#include <linux/smp_lock.h>
  8. +#include <linux/mutex.h>
  9. #include <linux/pagemap.h>
  10. #include <linux/mtd/mtd.h>
  11. #include <linux/interrupt.h>
  12. @@ -97,6 +97,8 @@
  13. #include <asm/div64.h>
  14. +static DEFINE_MUTEX(yaffs_mutex);
  15. +
  16. #if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 5, 0))
  17. #include <linux/statfs.h>
  18. @@ -1538,7 +1540,7 @@ static loff_t yaffs_dir_llseek(struct fi
  19. {
  20. long long retval;
  21. - lock_kernel();
  22. + mutex_lock(&yaffs_mutex);
  23. switch (origin){
  24. case 2:
  25. @@ -1555,7 +1557,7 @@ static loff_t yaffs_dir_llseek(struct fi
  26. retval = offset;
  27. }
  28. - unlock_kernel();
  29. + mutex_unlock(&yaffs_mutex);
  30. return retval;
  31. }
  32. @@ -3087,98 +3089,52 @@ static struct super_block *yaffs_interna
  33. return sb;
  34. }
  35. -
  36. -#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 5, 0))
  37. static int yaffs_internal_read_super_mtd(struct super_block *sb, void *data,
  38. int silent)
  39. {
  40. return yaffs_internal_read_super(1, sb, data, silent) ? 0 : -EINVAL;
  41. }
  42. -#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 17))
  43. -static int yaffs_read_super(struct file_system_type *fs,
  44. +static struct dentry *yaffs_read_super(struct file_system_type *fs,
  45. int flags, const char *dev_name,
  46. - void *data, struct vfsmount *mnt)
  47. -{
  48. -
  49. - return get_sb_bdev(fs, flags, dev_name, data,
  50. - yaffs_internal_read_super_mtd, mnt);
  51. -}
  52. -#else
  53. -static struct super_block *yaffs_read_super(struct file_system_type *fs,
  54. - int flags, const char *dev_name,
  55. - void *data)
  56. + void *data)
  57. {
  58. - return get_sb_bdev(fs, flags, dev_name, data,
  59. + return mount_bdev(fs, flags, dev_name, data,
  60. yaffs_internal_read_super_mtd);
  61. }
  62. -#endif
  63. static struct file_system_type yaffs_fs_type = {
  64. .owner = THIS_MODULE,
  65. .name = "yaffs",
  66. - .get_sb = yaffs_read_super,
  67. + .mount = yaffs_read_super,
  68. .kill_sb = kill_block_super,
  69. .fs_flags = FS_REQUIRES_DEV,
  70. };
  71. -#else
  72. -static struct super_block *yaffs_read_super(struct super_block *sb, void *data,
  73. - int silent)
  74. -{
  75. - return yaffs_internal_read_super(1, sb, data, silent);
  76. -}
  77. -
  78. -static DECLARE_FSTYPE(yaffs_fs_type, "yaffs", yaffs_read_super,
  79. - FS_REQUIRES_DEV);
  80. -#endif
  81. -
  82. #ifdef CONFIG_YAFFS_YAFFS2
  83. -#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 5, 0))
  84. static int yaffs2_internal_read_super_mtd(struct super_block *sb, void *data,
  85. int silent)
  86. {
  87. return yaffs_internal_read_super(2, sb, data, silent) ? 0 : -EINVAL;
  88. }
  89. -#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 17))
  90. -static int yaffs2_read_super(struct file_system_type *fs,
  91. - int flags, const char *dev_name, void *data,
  92. - struct vfsmount *mnt)
  93. +static struct dentry *yaffs2_read_super(struct file_system_type *fs,
  94. + int flags, const char *dev_name,
  95. + void *data)
  96. {
  97. - return get_sb_bdev(fs, flags, dev_name, data,
  98. - yaffs2_internal_read_super_mtd, mnt);
  99. + return mount_bdev(fs, flags, dev_name, data,
  100. + yaffs_internal_read_super_mtd);
  101. }
  102. -#else
  103. -static struct super_block *yaffs2_read_super(struct file_system_type *fs,
  104. - int flags, const char *dev_name,
  105. - void *data)
  106. -{
  107. -
  108. - return get_sb_bdev(fs, flags, dev_name, data,
  109. - yaffs2_internal_read_super_mtd);
  110. -}
  111. -#endif
  112. static struct file_system_type yaffs2_fs_type = {
  113. .owner = THIS_MODULE,
  114. .name = "yaffs2",
  115. - .get_sb = yaffs2_read_super,
  116. + .mount = yaffs2_read_super,
  117. .kill_sb = kill_block_super,
  118. .fs_flags = FS_REQUIRES_DEV,
  119. };
  120. -#else
  121. -static struct super_block *yaffs2_read_super(struct super_block *sb,
  122. - void *data, int silent)
  123. -{
  124. - return yaffs_internal_read_super(2, sb, data, silent);
  125. -}
  126. -
  127. -static DECLARE_FSTYPE(yaffs2_fs_type, "yaffs2", yaffs2_read_super,
  128. - FS_REQUIRES_DEV);
  129. -#endif
  130. #endif /* CONFIG_YAFFS_YAFFS2 */