Whamcloud - gitweb
d668fcab94d9485e34fc18188b32cc77d38df1f1
[fs/lustre-release.git] / lustre / include / linux / obd_raid1.h
1 #ifndef _OBD_RAID1
2 #define _OBD_RAID1
3
4 #include <linux/obd_class.h>
5
6 #define MAX_RAID1 16
7
8 #ifndef OBD_RAID1_DEVICENAME
9 #define OBD_RAID1_DEVICENAME "obdraid1"
10 #endif
11
12 struct raid1_obd {
13         unsigned int raid1_count; /* how many replicas */
14         /* devices to replicate on */
15         struct obd_device *raid1_devlist[MAX_RAID1];
16         /* connections we make */
17         struct obd_conn_info raid1_connections[MAX_RAID1];
18         struct list_head raid1_clients;  /* clients we have */
19 };
20
21
22 /* development definitions */
23 extern struct obdfs_sb_info *obd_sbi;
24 extern struct file_operations *obd_fso;
25
26 /* obd_raid1.c */
27 extern struct obd_ops raid1_obd_ops;
28 inline long ext2_block_map (struct inode * inode, long block);
29
30 /* balloc.c */
31 int ext2_new_block (const struct inode * inode, unsigned long goal,
32                    u32 * prealloc_count, u32 * prealloc_block, int * err);
33 void ext2_free_blocks (const struct inode * inode, unsigned long block,
34                       unsigned long count);
35 unsigned long ext2_count_free_blocks (struct super_block * sb);
36 int ext2_group_sparse(int group);
37 struct ext2_group_desc * ext2_get_group_desc(struct super_block * sb,
38                                              unsigned int block_group,
39                                              struct buffer_head ** bh);
40
41 /* bitmap.c */
42 unsigned long ext2_count_free(struct buffer_head * map, unsigned int numchars);
43
44 /* fsync.c */
45 extern int obd_sync_file(struct file * file, struct dentry *dentry);
46
47 /* ialloc.c */
48 extern void ext2_free_inode (struct inode * inode);
49 extern struct inode * ext2_new_inode (const struct inode * dir, int mode,
50                                      int * err);
51 extern unsigned long ext2_count_free_inodes (struct super_block * sb);
52 extern void ext2_check_inodes_bitmap (struct super_block * sb);
53 extern int load_inode_bitmap (struct super_block * sb,
54                               unsigned int block_group);
55
56 /* inode.c */
57 void obd_read_inode (struct inode * inode);
58 void obd_write_inode (struct inode * inode);
59 void obd_put_inode (struct inode * inode);
60 void obd_delete_inode (struct inode * inode);
61 void obd_discard_prealloc_blocks (struct inode * inode);
62 int obd_sync_inode (struct inode *inode);
63 struct buffer_head * obd_bread (struct inode * inode, int block, 
64                                 int create, int *err);
65 struct buffer_head * obd_getblk (struct inode * inode, long block,
66                                  int create, int * err);
67
68
69 int obd_remount (struct super_block * sb, int * flags, char * data);
70 struct super_block * ext2_read_super (struct super_block * sb, void * data,
71                                       int silent);
72
73 /* truncate.c */
74 void obd_truncate (struct inode * inode);
75
76 /* operations */
77 /* dir.c */
78 extern struct inode_operations ext2_dir_inode_operations;
79
80 /* file.c */
81 extern struct file_operations ext2_file_operations;
82 extern struct inode_operations ext2_file_inode_operations;
83
84 /* super.c */
85 extern struct super_operations ext2_sops;
86
87 #endif