Whamcloud - gitweb
New files:
[fs/lustre-release.git] / lustre / include / linux / obdfs.h
1 /* object based disk file system
2  * 
3  * This software is licensed under the GPL.  See the file COPYING in the
4  * top directory of this distribution for details.
5  * 
6  * Copyright (C), 1999, Stelias Computing Inc
7  *
8  *
9  */
10
11
12 #ifndef _OBDFS_H
13 #define OBDFS_H
14 #include <../obd/linux/obd_class.h>
15
16 /* file.c */
17 ssize_t obdfs_file_write(struct file *file, const char *buf, size_t count, loff_t *ppos);
18
19
20 /* rw.c */
21 struct page *obdfs_getpage(struct inode *inode, unsigned long offset, int create, int locked);
22 int obdfs_writepage(struct file *file, struct page *page);
23 int obdfs_write_one_page(struct file *file, struct page *page, unsigned long offset, unsigned long bytes, const char * buf);
24
25 /* namei.c */
26 struct dentry *obdfs_lookup(struct inode * dir, struct dentry *dentry);
27 int obdfs_create (struct inode * dir, struct dentry * dentry, int mode);
28 int obdfs_mkdir(struct inode *dir, struct dentry *dentry, int mode);
29 int obdfs_rmdir(struct inode *dir, struct dentry *dentry);
30 int obdfs_unlink(struct inode *dir, struct dentry *dentry);
31 int obdfs_mknod(struct inode *dir, struct dentry *dentry, int mode, int rdev);
32 int obdfs_symlink(struct inode *dir, struct dentry *dentry, const char *symname);
33 int obdfs_link(struct dentry *old_dentry, struct inode *dir, struct dentry *dentry);
34 int obdfs_rename(struct inode *old_dir, struct dentry *old_dentry, struct inode *new_dir, struct dentry *new_dentry);
35 /* dir.c */
36 int obdfs_readdir(struct file * filp, void * dirent, filldir_t filldir);
37 int obdfs_check_dir_entry (const char * function, struct inode * dir,
38                           struct ext2_dir_entry_2 * de,
39                           struct page * page,
40                            unsigned long offset);
41
42 struct obdfs_sb_info {
43         struct obd_conn_info osi_conn_info;
44         struct super_block *osi_super;
45         struct obd_device *osi_obd;
46         struct obd_ops *osi_ops;
47 };
48
49 void obdfs_sysctl_init(void);
50 void obdfs_sysctl_clean(void);
51
52 struct obdfs_inode_info;
53
54 extern struct file_operations obdfs_file_ops;
55 extern struct inode_operations obdfs_inode_ops;
56
57 static inline struct obd_ops *iops(struct inode *i)
58 {
59         struct obdfs_sb_info *sbi = (struct obdfs_sb_info *) i->i_sb->u.generic_sbp;
60         return sbi->osi_ops;
61 }
62
63 #define NOLOCK 0
64 #define LOCKED 1
65
66
67 #define OBDFS_SUPER_MAGIC 0x4711
68
69 #endif
70