buffer.c
上传用户:lgb322
上传日期:2013-02-24
资源大小:30529k
文件大小:2k
源码类别:

嵌入式Linux

开发平台:

Unix_Linux

  1. /*
  2.  * linux/fs/fat/buffer.c
  3.  *
  4.  *
  5.  */
  6. #include <linux/mm.h>
  7. #include <linux/slab.h>
  8. #include <linux/string.h>
  9. #include <linux/fs.h>
  10. #include <linux/blkdev.h>
  11. #include <linux/msdos_fs.h>
  12. #include <linux/fat_cvf.h>
  13. #if 0
  14. #  define PRINTK(x) printk x
  15. #else
  16. #  define PRINTK(x)
  17. #endif
  18. struct buffer_head *fat_bread(struct super_block *sb, int block)
  19. {
  20. return MSDOS_SB(sb)->cvf_format->cvf_bread(sb,block);
  21. }
  22. struct buffer_head *fat_getblk(struct super_block *sb, int block)
  23. {
  24. return MSDOS_SB(sb)->cvf_format->cvf_getblk(sb,block);
  25. }
  26. void fat_brelse (struct super_block *sb, struct buffer_head *bh)
  27. {
  28. if (bh) 
  29. MSDOS_SB(sb)->cvf_format->cvf_brelse(sb,bh);
  30. }
  31. void fat_mark_buffer_dirty (
  32. struct super_block *sb,
  33. struct buffer_head *bh)
  34. {
  35. MSDOS_SB(sb)->cvf_format->cvf_mark_buffer_dirty(sb,bh);
  36. }
  37. void fat_set_uptodate (
  38. struct super_block *sb,
  39. struct buffer_head *bh,
  40. int val)
  41. {
  42. MSDOS_SB(sb)->cvf_format->cvf_set_uptodate(sb,bh,val);
  43. }
  44. int fat_is_uptodate(struct super_block *sb, struct buffer_head *bh)
  45. {
  46. return MSDOS_SB(sb)->cvf_format->cvf_is_uptodate(sb,bh);
  47. }
  48. void fat_ll_rw_block (
  49. struct super_block *sb,
  50. int opr,
  51. int nbreq,
  52. struct buffer_head *bh[32])
  53. {
  54. MSDOS_SB(sb)->cvf_format->cvf_ll_rw_block(sb,opr,nbreq,bh);
  55. }
  56. struct buffer_head *default_fat_bread(struct super_block *sb, int block)
  57. {
  58. return sb_bread(sb, block);
  59. }
  60. struct buffer_head *default_fat_getblk(struct super_block *sb, int block)
  61. {
  62. return sb_getblk(sb, block);
  63. }
  64. void default_fat_brelse(struct super_block *sb, struct buffer_head *bh)
  65. {
  66. brelse (bh);
  67. }
  68. void default_fat_mark_buffer_dirty (
  69. struct super_block *sb,
  70. struct buffer_head *bh)
  71. {
  72. mark_buffer_dirty (bh);
  73. }
  74. void default_fat_set_uptodate (
  75. struct super_block *sb,
  76. struct buffer_head *bh,
  77. int val)
  78. {
  79. mark_buffer_uptodate(bh, val);
  80. }
  81. int default_fat_is_uptodate (struct super_block *sb, struct buffer_head *bh)
  82. {
  83. return buffer_uptodate(bh);
  84. }
  85. void default_fat_ll_rw_block (
  86. struct super_block *sb,
  87. int opr,
  88. int nbreq,
  89. struct buffer_head *bh[32])
  90. {
  91. ll_rw_block(opr,nbreq,bh);
  92. }