Whamcloud - gitweb
foo
[fs/lustre-release.git] / lustre / include / linux / sym_obd.h
1 #ifndef __LINUX_SYM_OBD_H
2 #define __LINUX_SYM_OBD_H
3
4 #include <linux/fs.h>
5 #include <linux/ext2_fs.h>
6
7 #define SYM_OBD_DEBUG
8
9 /*
10  * Debug code
11  */
12 #ifdef SYM_OBD_DEBUG
13 #       define obd_debug(f, a...)       { \
14                                         printk ("SYM OBD DEBUG (%s, %d): %s:", \
15                                                 __FILE__, __LINE__, __FUNCTION__); \
16                                         printk (f, ## a); \
17                                         }
18 #else
19 #       define obd_debug(f, a...)       /**/
20 #endif
21
22 /*
23  * ioctl commands
24  */
25 #define OBD_IOC_CREATE                 _IOR('f', 3, long)
26 #define OBD_IOC_SETUP                  _IOW('f', 4, long)
27 #define OBD_IOC_SYNC                   _IOR('f', 5, long)
28
29 /* balloc.c */
30 int obd_new_block (const struct inode * inode, unsigned long goal,
31                    u32 * prealloc_count, u32 * prealloc_block, int * err);
32 void obd_free_blocks (const struct inode * inode, unsigned long block,
33                       unsigned long count);
34 unsigned long obd_count_free_blocks (struct super_block * sb);
35 int ext2_group_sparse(int group);
36
37 /* fsync.c */
38 int obd_sync_file(struct file * file, struct dentry *dentry);
39
40 /* inode.c */
41 void obd_read_inode (struct inode * inode);
42 void obd_write_inode (struct inode * inode);
43 void obd_put_inode (struct inode * inode);
44 void obd_delete_inode (struct inode * inode);
45 void obd_discard_prealloc_blocks (struct inode * inode);
46 int obd_sync_inode (struct inode *inode);
47 struct buffer_head * obd_bread (struct inode * inode, int block, 
48                                 int create, int *err);
49 struct buffer_head * obd_getblk (struct inode * inode, long block,
50                                  int create, int * err);
51
52 /* interface.c */
53 extern struct inode * obd_inode_new (int inode_hint, int * err);
54 extern void obd_inode_destroy (struct inode * inode);
55 extern unsigned long obd_count_free_inodes (struct super_block * sb);
56 extern void obd_check_inodes_bitmap (struct super_block * sb);
57 unsigned long obd_count_free_inodes (struct super_block * sb);
58
59 /* ioctl.c */
60 int obd_ioctl (struct inode * inode, struct file * filp, unsigned int cmd,
61                unsigned long arg);
62
63 /* super.c */
64 #define obd_error obd_warning
65 #define obd_panic obd_warning
66 extern void obd_warning (struct super_block *, const char *, const char *, ...)
67         __attribute__ ((format (printf, 3, 4)));
68 int obd_remount (struct super_block * sb, int * flags, char * data);
69 struct super_block * obd_read_super (struct super_block * sb, void * data,
70                                      int silent);
71
72 /* truncate.c */
73 void obd_truncate (struct inode * inode);
74
75 /* operations */
76 /* dir.c */
77 extern struct inode_operations obd_dir_inode_operations;
78
79 /* file.c */
80 extern struct inode_operations obd_file_inode_operations;
81
82 #endif /* __LINUX_SYM_OBD_H */