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