1 /* object based disk file system
3 * This software is licensed under the GPL. See the file COPYING in the
4 * top directory of this distribution for details.
6 * Copyright (C), 1999, Stelias Computing Inc
14 #include <linux/obd_class.h>
17 void obdfs_read_inode(struct inode *inode);
21 ssize_t obdfs_file_write(struct file *file, const char *buf, size_t count, loff_t *ppos);
25 struct page *obdfs_getpage(struct inode *inode, unsigned long offset, int create, int locked);
26 int obdfs_write_one_page(struct file *file, struct page *page, unsigned long offset, unsigned long bytes, const char * buf);
29 struct dentry *obdfs_lookup(struct inode * dir, struct dentry *dentry);
30 int obdfs_create (struct inode * dir, struct dentry * dentry, int mode);
31 int obdfs_mkdir(struct inode *dir, struct dentry *dentry, int mode);
32 int obdfs_rmdir(struct inode *dir, struct dentry *dentry);
33 int obdfs_unlink(struct inode *dir, struct dentry *dentry);
34 int obdfs_mknod(struct inode *dir, struct dentry *dentry, int mode, int rdev);
35 int obdfs_symlink(struct inode *dir, struct dentry *dentry, const char *symname);
36 int obdfs_link(struct dentry *old_dentry, struct inode *dir, struct dentry *dentry);
37 int obdfs_rename(struct inode *old_dir, struct dentry *old_dentry, struct inode *new_dir, struct dentry *new_dentry);
39 int obdfs_readdir(struct file * filp, void * dirent, filldir_t filldir);
40 int obdfs_check_dir_entry (const char * function, struct inode * dir,
41 struct ext2_dir_entry_2 * de,
43 unsigned long offset);
45 int obdfs_readlink (struct dentry *, char *, int);
46 struct dentry *obdfs_follow_link(struct dentry *, struct dentry *, unsigned int);
48 struct obdfs_sb_info {
49 struct obd_conn osi_conn;
50 struct super_block *osi_super;
51 struct obd_device *osi_obd;
52 struct obd_ops *osi_ops;
53 ino_t osi_rootino; /* which root inode */
54 int osi_minor; /* minor of /dev/obdX */
57 void obdfs_sysctl_init(void);
58 void obdfs_sysctl_clean(void);
60 struct obdfs_inode_info;
62 extern struct file_operations obdfs_file_ops;
63 extern struct inode_operations obdfs_inode_ops;
64 extern struct inode_operations obdfs_symlink_inode_operations;
66 static inline struct obd_ops *iops(struct inode *i)
68 struct obdfs_sb_info *sbi = (struct obdfs_sb_info *) &i->i_sb->u.generic_sbp;
72 static inline struct obd_conn *iid(struct inode *i)
74 struct obdfs_sb_info *sbi = (struct obdfs_sb_info *) &i->i_sb->u.generic_sbp;
75 return &sbi->osi_conn;
82 #warning "*** WARNING redefining OPS"
84 #define OPS(sb,op) ((struct obdfs_sb_info *)(& ## sb ## ->u.generic_sbp))->osi_ops->o_ ## op
85 #define IOPS(inode,op) ((struct obdfs_sb_info *)(& ## inode->i_sb ## ->u.generic_sbp))->osi_ops->o_ ## op
89 #warning "*** WARNING redefining ID"
91 #define ID(sb) (&((struct obdfs_sb_info *)( & ## sb ## ->u.generic_sbp))->osi_conn)
92 #define IID(inode) (&((struct obdfs_sb_info *)( & ## inode->i_sb ## ->u.generic_sbp))->osi_conn)
95 #define OBDFS_SUPER_MAGIC 0x4711