Whamcloud - gitweb
- ext2_obd.c --- fix the bugs in read/write for Linux 2.4.3
[fs/lustre-release.git] / lustre / include / linux / inofs.h
1 /* object based disk file system
2  * 
3  * This code is issued under the GNU General Public License.
4  * See the file COPYING in this distribution
5  * 
6  * Copyright (C), 1999, Stelias Computing Inc
7  *
8  *
9  */
10
11
12 #ifndef _INOFS_H
13 #define INOFS_H
14 #include <linux/obd_class.h>
15
16 #include <linux/obdo.h>
17
18 /* super.c */
19 void inofs_read_inode(struct inode *inode);
20
21
22 /* file.c */
23 ssize_t inofs_file_write(struct file *file, const char *buf, size_t count, loff_t *ppos);
24
25
26 /* rw.c */
27 struct page *inofs_getpage(struct inode *inode, unsigned long offset, int create, int locked);
28 int inofs_writepage(struct file *file, struct page *page);
29 int inofs_write_one_page(struct file *file, struct page *page, unsigned long offset, unsigned long bytes, const char * buf);
30
31 /* namei.c */
32 struct dentry *inofs_lookup(struct inode * dir, struct dentry *dentry);
33 int inofs_create (struct inode * dir, struct dentry * dentry, int mode);
34 int inofs_mkdir(struct inode *dir, struct dentry *dentry, int mode);
35 int inofs_rmdir(struct inode *dir, struct dentry *dentry);
36 int inofs_unlink(struct inode *dir, struct dentry *dentry);
37 int inofs_mknod(struct inode *dir, struct dentry *dentry, int mode, int rdev);
38 int inofs_symlink(struct inode *dir, struct dentry *dentry, const char *symname);
39 int inofs_link(struct dentry *old_dentry, struct inode *dir, struct dentry *dentry);
40 int inofs_rename(struct inode *old_dir, struct dentry *old_dentry, struct inode *new_dir, struct dentry *new_dentry);
41
42 /* dir.c */
43 int inofs_readdir(struct file * filp, void * dirent, filldir_t filldir);
44
45 struct inofs_sb_info {
46         struct list_head osi_list;      /* list of supers */
47         struct obd_conn osi_conn;
48         struct super_block *osi_super;
49         struct obd_device *osi_obd;
50         struct obd_ops *osi_ops;
51         struct list_head         osi_inodes;    /* list of dirty inodes */
52         unsigned long            osi_cache_count;
53         struct semaphore         osi_list_mutex;
54 };
55
56 void inofs_sysctl_init(void);
57 void inofs_sysctl_clean(void);
58
59 struct inofs_inode_info;
60
61 extern struct file_operations inofs_file_ops;
62 extern struct inode_operations inofs_inode_ops;
63
64 static inline struct obd_ops *iops(struct inode *i)
65 {
66         struct inofs_sb_info *sbi = (struct inofs_sb_info *) i->i_sb->u.generic_sbp;
67         return sbi->osi_ops;
68 }
69
70 #define NOLOCK 0
71 #define LOCKED 1
72
73
74 #define INOFS_SUPER_MAGIC 0x4711
75
76 #endif
77